Compare commits

...

9 Commits

Author SHA1 Message Date
Adeel Malik
c12f77fa42 SRS TOA estimates for multiple gNB 2022-12-15 15:37:35 +01:00
Adeel Malik
036c402c17 moving mqtt setup parameters into gNB.conf 2022-12-05 14:19:14 +01:00
Adeel Malik
911005fdbf moving mqtt setup parameters into gNB.conf 2022-12-05 14:17:15 +01:00
Adeel Malik
cd559c4971 minor corrections and removing .save files 2022-11-24 08:35:44 +01:00
Adeel Malik
8fa3570ba7 adding TrpId in gNB conf 2022-11-23 14:28:28 +01:00
Adeel Malik
ec638187d0 update from develop 2022-11-08 15:30:28 +01:00
Adeel Malik
876a5d9f83 updating develop 2022-11-08 13:13:34 +01:00
Adeel Malik
3168b813e3 Enabled gnb MQTT client subscribed to 2 messages (SRS estimation, Frame sample) 2022-10-28 12:17:08 +02:00
Adeel Malik
abadd46e0a enable MQTT client at gNB 2022-10-18 18:43:32 +02:00
24 changed files with 491 additions and 279 deletions

View File

@@ -131,13 +131,13 @@ if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
# for ubuntu 17.10, directories are different
elseif(EXISTS "/usr/include/x86_64-linux-gnu/cblas.h")
include_directories("/usr/include/x86_64-linux-gnu")
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
list(APPEND ATLAS_LIBRARIES cblas)
list(APPEND ATLAS_LIBRARIES atlas)
list(APPEND ATLAS_LIBRARIES lapack)
else()
message("No Blas/Atlas libs found, some targets will fail")
endif()
@@ -198,7 +198,7 @@ add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of bui
# in case /proc/cpuinfo exists we want to inspect available Intrinsics
# -so not to go always through SIMDE emulation
# -so to avoid AVX512 instructions generation by gcc
# -so to avoid AVX512 instructions generation by gcc
execute_process(COMMAND uname -m OUTPUT_VARIABLE CPUARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "CPUARCH ${CPUARCH}")
if(EXISTS "/proc/cpuinfo")
@@ -735,10 +735,10 @@ add_library(LPP_LIB
${LPP_ASN_GENERATED_C_FILES}
)
add_dependencies (LPP_LIB lpp_flag)
include_directories ("${LPP_ASN_GENERATED_C_DIR}")
include_directories ("${LPP_DIR}")
#file(GLOB LPP_C_FILES ${LPP_DIR}/*.c)
#add_library(LPP ${LPP_C_FILES} )
@@ -1867,7 +1867,7 @@ set(NR_SDAP_SRC
${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap.c
${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap_entity.c
)
set(L2_SRC
${PDCP_DIR}/pdcp.c
${PDCP_DIR}/pdcp_fifo.c
@@ -2804,6 +2804,7 @@ target_link_libraries (nr-softmodem
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (nr-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})

View File

@@ -278,8 +278,8 @@ int connect_rau(RU_t *ru) {
void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
int offset = ru->nr_frame_parms->get_samples_slot_timestamp(slot,ru->nr_frame_parms,0);
void *buffs[ru->nb_tx];
for (int aid=0;aid<ru->nb_tx;aid++) buffs[aid] = (void*)&ru->common.txdata[aid][offset];
void *buffs[ru->nb_tx];
for (int aid=0;aid<ru->nb_tx;aid++) buffs[aid] = (void*)&ru->common.txdata[aid][offset];
struct timespec txmeas;
clock_gettime(CLOCK_MONOTONIC, &txmeas);
LOG_D(PHY,"IF5 TX %d.%d, TS %llu, buffs[0] %p, buffs[1] %p ener0 %f dB, tx start %d\n",frame,slot,(unsigned long long)timestamp,buffs[0],buffs[1],
@@ -290,7 +290,7 @@ void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
0,
ru->nr_frame_parms->get_samples_per_slot(slot,ru->nr_frame_parms),
0,
ru->nb_tx);
ru->nb_tx);
}
@@ -316,10 +316,10 @@ void fh_if5_south_in(RU_t *ru,
int *tti) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5, 1 );
start_meas(&ru->rx_fhaul);
ru->ifdevice.trx_read_func2(&ru->ifdevice,&proc->timestamp_rx,NULL,fp->get_samples_per_slot(*tti,fp));
ru->ifdevice.trx_read_func2(&ru->ifdevice,&proc->timestamp_rx,NULL,fp->get_samples_per_slot(*tti,fp));
if (proc->first_rx == 1) ru->ts_offset = proc->timestamp_rx;
proc->frame_rx = ((proc->timestamp_rx-ru->ts_offset) / (fp->samples_per_subframe*10))&1023;
proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx-ru->ts_offset,fp);
@@ -622,6 +622,7 @@ void *emulatedRF_thread(void *param) {
void rx_rf(RU_t *ru,int *frame,int *slot) {
RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
openair0_config_t *cfg = &ru->openair0_cfg;
void *rxp[ru->nb_rx];
unsigned int rxs;
int i;
@@ -659,8 +660,8 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
if (rxs != samples_per_slot) LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n",samples_per_slot,rxs);
if (proc->first_rx == 1) {
ru->ts_offset = proc->timestamp_rx;
proc->timestamp_rx = 0;
// ru->ts_offset = proc->timestamp_rx;
//proc->timestamp_rx = 0;
} else {
samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp);
@@ -671,15 +672,27 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
}
}
//compute system frame number (SFN) according to O-RAN-WG4-CUS.0-v02.00 (using alpha=beta=0)
// this assumes that the USRP has been synchronized to the GPS time
// OAI uses timestamps in sample time stored in int64_t, but it will fit in double precision for many years to come.
double gps_sec = ((double) ts)/cfg->sample_rate;
//proc->frame_rx = ((int64_t) (gps_sec/0.01)) & 1023;
// in fact the following line is the same as long as the timestamp_rx is synchronized to GPS.
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx,fp);
// synchronize first reception to frame 0 subframe 0
LOG_D(PHY,"RU %d/%d TS %llu , frame %d, slot %d.%d / %d\n",
LOG_D(PHY,"RU %d/%d TS %ld, GPS %f, SR %f, frame %d, slot %d.%d / %d\n",
ru->idx,
0,
(unsigned long long int)(proc->timestamp_rx+ru->ts_offset),
ts, //(unsigned long long int)(proc->timestamp_rx+ru->ts_offset),
gps_sec,
cfg->sample_rate,
proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame);
// dump VCD output for first RU in list
if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx );
@@ -804,7 +817,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
for (i=0; i<ru->nb_tx; i++)
txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)]-sf_extension*sizeof(int32_t);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
// prepare tx buffer pointers
@@ -988,7 +1001,7 @@ void *ru_stats_thread(void *param) {
print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL);
}
print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
if (ru->if_south == REMOTE_IF5) print_meas(&ru->ifdevice.tx_fhaul,"tx_fhaul (IF5)",NULL,NULL);
if (ru->if_south == REMOTE_IF5) print_meas(&ru->ifdevice.tx_fhaul,"tx_fhaul (IF5)",NULL,NULL);
else print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
if (ru->fh_north_out) {
@@ -1009,7 +1022,7 @@ void ru_tx_func(void *param) {
int slot_tx = info->slot_tx;
int print_frame = 8;
char filename[40];
// note that this will break for 60/120 kHz, to be handled
int absslot_tx = info->timestamp_tx/fp->get_samples_per_slot(slot_tx,fp);
@@ -1110,7 +1123,7 @@ void *ru_thread( void *param ) {
if (ru->has_ctrl_prt > 0) {
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
else ret = attach_rru(ru);
AssertFatal(ret==0,"Cannot connect to remote radio\n");
}
@@ -1160,31 +1173,30 @@ void *ru_thread( void *param ) {
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
struct timespec slot_start;
clock_gettime(CLOCK_MONOTONIC, &slot_start);
struct timespec slot_duration;
struct timespec slot_duration;
slot_duration.tv_sec = 0;
//slot_duration.tv_nsec = 0.5e6;
slot_duration.tv_nsec = 0.5e6;
while (!oai_exit) {
if (NFAPI_MODE==NFAPI_MODE_VNF) {
// We should make a VNF main loop with proper tasks calls in case of VNF
slot_start = timespec_add(slot_start,slot_duration);
struct timespec curr_time;
clock_gettime(CLOCK_MONOTONIC, &curr_time);
struct timespec sleep_time;
if((slot_start.tv_sec > curr_time.tv_sec) || (slot_start.tv_sec == curr_time.tv_sec && slot_start.tv_nsec > curr_time.tv_nsec)){
sleep_time = timespec_sub(slot_start,curr_time);
usleep(sleep_time.tv_nsec * 1e-3);
usleep(sleep_time.tv_nsec * 1e-3);
}
}
if (slot==(fp->slots_per_frame-1)) {
slot=0;
frame++;
@@ -1235,7 +1247,9 @@ void *ru_thread( void *param ) {
if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023;
// do RX front-end processing (frequency-shift, dft) if needed
// do RX front-end processing (frequency-shift, dft) if needed
int slot_type = nr_slot_select(cfg,proc->frame_rx,proc->tti_rx);
if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) {
@@ -1243,6 +1257,8 @@ void *ru_thread( void *param ) {
ru->feprx(ru,proc->tti_rx);
clock_gettime(CLOCK_MONOTONIC,&ru->rt_ru_profiling.return_RU_feprx[rt_prof_idx]);
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
if (IS_SOFTMODEM_DOSCOPE && RC.gNB[0]->scopeData)
((scopeData_t *)RC.gNB[0]->scopeData)->slotFunc(ru->common.rxdataF[0],proc->tti_rx, RC.gNB[0]->scopeData);
@@ -1293,7 +1309,8 @@ void *ru_thread( void *param ) {
pushTpool(&gNB->threadPool, res);
}
printf( "Exiting ru_thread \n");
printf( "Exiting ru_thread \n");
if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0)
@@ -1352,7 +1369,7 @@ void init_RU_proc(RU_t *ru) {
if(emulate_rf)
threadCreate( &proc->pthread_emulateRF, emulatedRF_thread, (void *)proc, "emulateRF", -1, OAI_PRIORITY_RT );
if (opp_enabled == 1)
if (opp_enabled == 1)
threadCreate( &ru->ru_stats_thread, ru_stats_thread, (void *)ru,"ru_stats", -1, OAI_PRIORITY_RT );
if (get_thread_worker_conf() == WORKER_ENABLE) {
}
@@ -1604,7 +1621,7 @@ void set_function_spec_param(RU_t *ru) {
ru->do_prach = 0; // no prach processing in RU
ru->feprx = nr_fep_tp; // this is frequency-shift + DFTs
ru->feptx_ofdm = nr_feptx_tp; // this is fep with idft and precoding
ru->feptx_prec = NULL;
ru->feptx_prec = NULL;
ru->fh_north_in = NULL; // no incoming fronthaul from north
ru->fh_north_out = NULL; // no outgoing fronthaul to north
ru->nr_start_if = NULL; // no if interface
@@ -1648,7 +1665,7 @@ void set_function_spec_param(RU_t *ru) {
ru->ifdevice.eth_params = &ru->eth_params;
ru->ifdevice.configure_rru = configure_ru;
printf("starting transport : rx_num_antennas %d, tx_num_antennas %d\n",ru->openair0_cfg.rx_num_channels,ru->openair0_cfg.tx_num_channels);
printf("starting transport : rx_num_antennas %d, tx_num_antennas %d\n",ru->openair0_cfg.rx_num_channels,ru->openair0_cfg.tx_num_channels);
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
printf("openair0_transport_init returns %d for ru_id %u\n", ret, ru->idx);
@@ -1969,7 +1986,7 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->openair0_cfg.txfh_cores[0] = *(RUParamList.paramarray[j][RU_TXFH_CORE_ID].iptr);
RC.ru[j]->num_tpcores = *(RUParamList.paramarray[j][RU_NUM_TP_CORES].iptr);
RC.ru[j]->half_slot_parallelization = *(RUParamList.paramarray[j][RU_HALF_SLOT_PARALLELIZATION].iptr);
printf("[RU %d] Setting half-slot parallelization to %d\n",j,RC.ru[j]->half_slot_parallelization);
printf("[RU %d] Setting half-slot parallelization to %d\n",j,RC.ru[j]->half_slot_parallelization);
AssertFatal(RC.ru[j]->num_tpcores <= RUParamList.paramarray[j][RU_TP_CORES].numelt, "Number of TP cores should be <=16\n");
for (i=0; i<RC.ru[j]->num_tpcores; i++) RC.ru[j]->tpcores[i] = RUParamList.paramarray[j][RU_TP_CORES].iptr[i];
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
@@ -1989,3 +2006,7 @@ static void NRRCconfig_RU(void) {
return;
}

View File

@@ -34,11 +34,11 @@ typedef enum {
typedef struct {
/// Value: 0 -> 1, 0: Payload is carried directly in the value field, 1: Pointer to payload is in the value field
uint16_t tag;
/// Value: 0 -> 1, 0: Payload is carried directly in the value field, 1: Pointer to payload is in the value field
uint16_t tag;
/// Length of the actual payload in bytes, without the padding bytes Value: 0 → 65535
uint16_t length;
union {
union {
uint32_t *ptr;
uint32_t direct[38016];
} value;
@@ -166,7 +166,7 @@ typedef enum {
#define NFAPI_NR_PARAM_TLV_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG 0x0035
#define NFAPI_NR_PARAM_TLV_RSSI_MEASUREMENT_SUPPORT_TAG 0x0036
typedef struct
typedef struct
{
nfapi_uint16_tlv_t release_capability; //TAG 0x0001
nfapi_uint16_tlv_t phy_state;
@@ -177,18 +177,18 @@ typedef struct
} nfapi_nr_cell_param_t;
//table 3-10 Carrier parameters
typedef struct
typedef struct
{
nfapi_uint8_tlv_t cyclic_prefix;//TAG 0x0006
nfapi_uint16_tlv_t supported_subcarrier_spacings_dl;
nfapi_uint16_tlv_t supported_bandwidth_dl;
nfapi_uint8_tlv_t supported_subcarrier_spacings_ul;
nfapi_uint16_tlv_t supported_bandwidth_ul;
} nfapi_nr_carrier_param_t;
//table 3-11 PDCCH parameters
typedef struct
typedef struct
{
nfapi_uint8_tlv_t cce_mapping_type;
nfapi_uint8_tlv_t coreset_outside_first_3_of_ofdm_syms_of_slot;
@@ -200,7 +200,7 @@ typedef struct
} nfapi_nr_pdcch_param_t;
//table 3-12 PUCCH parameters
typedef struct
typedef struct
{
nfapi_uint8_tlv_t pucch_formats;
nfapi_uint8_tlv_t max_pucchs_per_slot;
@@ -208,7 +208,7 @@ typedef struct
} nfapi_nr_pucch_param_t;
//table 3-13 PDSCH parameters
typedef struct
typedef struct
{
nfapi_uint8_tlv_t pdsch_mapping_type;
nfapi_uint8_tlv_t pdsch_allocation_types;
@@ -228,7 +228,7 @@ typedef struct
} nfapi_nr_pdsch_param_t;
//table 3-14
typedef struct
typedef struct
{
nfapi_uint8_tlv_t uci_mux_ulsch_in_pusch;
nfapi_uint8_tlv_t uci_only_pusch;
@@ -251,7 +251,7 @@ typedef struct
} nfapi_nr_pusch_param_t;
//table 3-15
typedef struct
typedef struct
{
nfapi_uint8_tlv_t prach_long_formats;
nfapi_uint8_tlv_t prach_short_formats;
@@ -260,7 +260,7 @@ typedef struct
} nfapi_nr_prach_param_t;
//table 3-16
typedef struct
typedef struct
{
nfapi_uint8_tlv_t rssi_measurement_support;
} nfapi_nr_measurement_param_t;
@@ -330,7 +330,7 @@ typedef struct
#define NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG 0x1028
//table 3-21
typedef struct
typedef struct
{
nfapi_uint16_tlv_t dl_bandwidth;//Carrier bandwidth for DL in MHz [38.104, sec 5.3.2] Values: 5, 10, 15, 20, 25, 30, 40,50, 60, 70, 80,90,100,200,400
nfapi_uint32_tlv_t dl_frequency; //Absolute frequency of DL point A in KHz [38.104, sec5.2 and 38.211 sec 4.4.4.2] Value: 450000 -> 52600000
@@ -344,10 +344,10 @@ typedef struct
nfapi_uint16_tlv_t num_rx_ant;//
nfapi_uint8_tlv_t frequency_shift_7p5khz;//Indicates presence of 7.5KHz frequency shift. Value: 0 = false 1 = true
} nfapi_nr_carrier_config_t;
} nfapi_nr_carrier_config_t;
//table 3-22
typedef struct
typedef struct
{
nfapi_uint16_tlv_t phy_cell_id;//Physical Cell ID, 𝑁_{𝐼𝐷}^{𝑐𝑒𝑙𝑙} [38.211, sec 7.4.2.1] Value: 0 ->1007
nfapi_uint8_tlv_t frame_duplex_type;//Frame duplex type Value: 0 = FDD 1 = TDD
@@ -355,7 +355,7 @@ typedef struct
} nfapi_nr_cell_config_t;
//table 3-23
typedef struct
typedef struct
{
nfapi_int32_tlv_t ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
nfapi_uint8_tlv_t bch_payload;//Defines option selected for generation of BCH payload, see Table 3-13 (v0.0.011 Value: 0: MAC generates the full PBCH payload 1: PHY generates the timing PBCH bits 2: PHY generates the full PBCH payload
@@ -368,7 +368,7 @@ typedef struct
uint8_t unused_root_sequences;//Unused root sequence or sequences per FD occasion. Required for noise estimation.
} nfapi_nr_num_unused_root_sequences_t;*/
typedef struct
typedef struct
{
nfapi_uint16_tlv_t prach_root_sequence_index;//Starting logical root sequence index, 𝑖, equivalent to higher layer parameter prach-RootSequenceIndex [38.211, sec 6.3.3.1] Value: 0 -> 837
nfapi_uint8_tlv_t num_root_sequences;//Number of root sequences for a particular FD occasion that are required to generate the necessary number of preambles
@@ -379,7 +379,7 @@ typedef struct
} nfapi_nr_num_prach_fd_occasions_t;
typedef struct
typedef struct
{
nfapi_uint8_tlv_t prach_sequence_length;//RACH sequence length. Only short sequence length is supported for FR2. [38.211, sec 6.3.3.1] Value: 0 = Long sequence 1 = Short sequence
nfapi_uint8_tlv_t prach_sub_c_spacing;//Subcarrier spacing of PRACH. [38.211 sec 4.2] Value:0->4
@@ -394,19 +394,19 @@ typedef struct
} nfapi_nr_prach_config_t;
//table 3-25
typedef struct
typedef struct
{
nfapi_uint32_tlv_t ssb_mask;//Bitmap for actually transmitted SSB. MSB->LSB of first 32 bit number corresponds to SSB 0 to SSB 31 MSB->LSB of second 32 bit number corresponds to SSB 32 to SSB 63 Value for each bit: 0: not transmitted 1: transmitted
} nfapi_nr_ssb_mask_list_t;
typedef struct
typedef struct
{
nfapi_uint8_tlv_t beam_id;//BeamID for each SSB in SsbMask. For example, if SSB mask bit 26 is set to 1, then BeamId[26] will be used to indicate beam ID of SSB 26. Value: from 0 to 63
} nfapi_nr_ssb_beam_id_list_t;
typedef struct
typedef struct
{
nfapi_uint16_tlv_t ssb_offset_point_a;//Offset of lowest subcarrier of lowest resource block used for SS/PBCH block. Given in PRB [38.211, section 4.4.4.2] Value: 0->2199
nfapi_uint8_tlv_t beta_pss;//PSS EPRE to SSS EPRE in a SS/PBCH block [38.213, sec 4.1] Values: 0 = 0dB
@@ -422,20 +422,20 @@ typedef struct
//table 3-26
//?
typedef struct
//?
typedef struct
{
nfapi_uint8_tlv_t slot_config;//For each symbol in each slot a uint8_t value is provided indicating: 0: DL slot 1: UL slot 2: Guard slot
} nfapi_nr_max_num_of_symbol_per_slot_t;
typedef struct
typedef struct
{
nfapi_nr_max_num_of_symbol_per_slot_t* max_num_of_symbol_per_slot_list;
} nfapi_nr_max_tdd_periodicity_t;
typedef struct
typedef struct
{
nfapi_uint8_tlv_t tdd_period;//DL UL Transmission Periodicity. Value:0: ms0p5 1: ms0p625 2: ms1 3: ms1p25 4: ms2 5: ms2p5 6: ms5 7: ms10 8: ms3 9: ms4
nfapi_nr_max_tdd_periodicity_t* max_tdd_periodicity_list;
@@ -443,7 +443,7 @@ typedef struct
} nfapi_nr_tdd_table_t;
//table 3-27
typedef struct
typedef struct
{
nfapi_uint8_tlv_t rssi_measurement;//RSSI measurement unit. See Table 3-16 for RSSI definition. Value: 0: Do not report RSSI 1: dBm 2: dBFS
@@ -451,7 +451,7 @@ typedef struct
// ERROR enums
typedef enum { // Table 2-22
NFAPI_NR_PARAM_MSG_OK = 0,
NFAPI_NR_PARAM_MSG_OK = 0,
NFAPI_NR_PARAM_MSG_INVALID_STATE
} nfapi_nr_param_errors_e;
@@ -462,11 +462,11 @@ typedef enum { // Table 2-25
} nfapi_nr_config_errors_e;
typedef enum { // Table 2-27
NFAPI_NR_START_MSG_OK = 0,
NFAPI_NR_START_MSG_OK = 0,
NFAPI_NR_START_MSG_INVALID_STATE
} nfapi_nr_start_errors_e;
//PNF P5 NR
//PNF P5 NR
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_vendor_extension_tlv_t vendor_extension;
@@ -526,7 +526,7 @@ typedef struct {
typedef struct {
nfapi_p4_p5_message_header_t header;
uint8_t error_code;
uint8_t num_tlv;
nfapi_vendor_extension_tlv_t vendor_extension;
@@ -626,7 +626,7 @@ typedef struct {
//3.3.6 Storing Precoding and Beamforming Tables
//table 3-32
//?
//?
typedef struct {
uint16_t beam_idx; //0~65535
} nfapi_nr_dig_beam_t;
@@ -674,9 +674,9 @@ typedef struct {
typedef struct {
nfapi_p7_message_header_t header;
uint16_t sfn; //0->1023
uint16_t sfn; //0->1023
uint16_t slot;//0->319
} nfapi_nr_slot_indication_scf_t;
// 3.4.2
@@ -697,9 +697,9 @@ typedef struct
}nfapi_nr_tx_precoding_and_beamforming_number_of_prgs_t;
//table 3-43
typedef struct
typedef struct
{
uint16_t num_prgs;//Number of PRGs spanning this allocation. Value : 1->275
uint16_t num_prgs;//Number of PRGs spanning this allocation. Value : 1->275
uint16_t prg_size;//Size in RBs of a precoding resource block group (PRG) to which same precoding and digital beamforming gets applied. Value: 1->275
//watchout: dig_bf_interfaces here, in table 3-53 it's dig_bf_interface
uint8_t dig_bf_interfaces;//Number of STD ant ports (parallel streams) feeding into the digBF Value: 0->255
@@ -708,7 +708,7 @@ typedef struct
}nfapi_nr_tx_precoding_and_beamforming_t;
//table 3-37
//table 3-37
#define DCI_PAYLOAD_BYTE_LEN 8 // 12 ? TS38.212 sec 7.3.1
#define MAX_DCI_CORESET 8
@@ -720,7 +720,7 @@ typedef struct {
// otherwise it should be set to the phy cell ID. [TS38.211, sec 7.3.2.3] Value: 0->65535
uint16_t ScramblingId;
// For a UE-specific search space where PDCCH-DMRSScrambling- ID is configured This param equals the CRNTI.
// Otherwise, it should be set to 0. [TS38.211, sec 7.3.2.3] Value: 0 -> 65535
// Otherwise, it should be set to 0. [TS38.211, sec 7.3.2.3] Value: 0 -> 65535
uint16_t ScramblingRNTI;
// CCE start Index used to send the DCI Value: 0->135
uint8_t CceIndex;
@@ -755,7 +755,7 @@ typedef struct {
///Starting OFDM symbol for the CORESET, Value: 0->13
uint8_t StartSymbolIndex;
///Contiguous time duration of the CORESET in number of symbols. Corresponds to L1 parameter 𝑁𝑠𝑦𝑚𝑏_𝐶𝑂𝑅𝐸𝑆𝐸𝑇 [TS38.211 sec 7.3.2.2] Value: 1,2,3
uint8_t DurationSymbols;
uint8_t DurationSymbols;
///Frequency domain resources. This is a bitmap defining non-overlapping groups of 6 PRBs in ascending order. [TS38.213 10.1]. Also, corresponds to L1 parameter CORE SET RB N [TS38.211 sec 7.3.2.2] Bitmap of uint8 array. 45 bits.
uint8_t FreqDomainResource[6];
///CORESET-CCE-to-REG-mapping-type [TS38.211 sec 7.3.2.2] 0: non-interleaved 1: interleaved
@@ -763,7 +763,7 @@ typedef struct {
///The number of REGs in a bundle. Must be 6 for cceRegMappingType = nonInterleaved. For cceRegMappingType = interleaved, must belong to {2,6} if duration = 1,2 and must belong to {3,6} if duration = 3. Corresponds to parameter L. [TS38.211 sec 7.3.2.2] Value: 2,3,6
uint8_t RegBundleSize;
///The interleaver size. For interleaved mapping belongs to {2,3,6} and for non-interleaved mapping is NA. Corresponds to parameter R. [TS38.211 sec 7.3.2.2] Value: 2,3,6 CoreSetType
uint8_t InterleaverSize;
uint8_t InterleaverSize;
///[TS38.211 sec 7.3.2.2 and sec 7.4.1.3.2] 0: CORESET is configured by the PBCH or SIB1 (subcarrier 0 of CRB0 for DMRS mapping) 1: otherwise (subcarrier 0 of CORESET)
uint8_t CoreSetType;
///[TS38.211 sec 7.3.2.2] Not applicable for non-interleaved mapping. For interleaved mapping and a PDCCH transmitted in a CORESET configured by the PBCH or SIB1 this should be set to phy cell ID. Value: 10 bits Otherwise, for interleaved mapping this is set to 0-> max num of PRBs. Value 0-> 275
@@ -798,13 +798,13 @@ typedef struct {
/// Number of code words for this RNTI (UE), Value: 1 -> 2
uint8_t NrOfCodewords;
/// Target coding rate [TS38.212 sec 5.4.2.1 and 38.214 sec 5.1.3.1]. This is the number of information bits per 1024 coded bits expressed in 0.1 bit units
uint16_t targetCodeRate[2];
uint16_t targetCodeRate[2];
/// QAM modulation [TS38.212 sec 5.4.2.1 and 38.214 sec 5.1.3.1], Value: 2,4,6,8
uint8_t qamModOrder[2];
/// MCS index [TS38.214, sec 5.1.3.1], should match value sent in DCI Value : 0->31
uint8_t mcsIndex[2];
/// MCS-Table-PDSCH [TS38.214, sec 5.1.3.1] 0: notqam256, 1: qam256, 2: qam64LowSE
uint8_t mcsTable[2];
uint8_t mcsTable[2];
/// Redundancy version index [TS38.212, Table 5.4.2.1-2 and 38.214, Table 5.1.2.1-2], should match value sent in DCI Value : 0->3
uint8_t rvIndex[2];
/// Transmit block size (in bytes) [TS38.214 sec 5.1.3.2], Value: 0->65535
@@ -819,7 +819,7 @@ typedef struct {
uint8_t refPoint;
// DMRS [TS38.211 sec 7.4.1.1]
/// DMRS symbol positions [TS38.211, sec 7.4.1.1.2 and Tables 7.4.1.1.2-3 and 7.4.1.1.2-4] Bitmap occupying the 14 LSBs with: bit 0: first symbol and for each bit 0: no DMRS 1: DMRS
uint16_t dlDmrsSymbPos;
uint16_t dlDmrsSymbPos;
/// DL DMRS config type [TS38.211, sec 7.4.1.1.2] 0: type 1, 1: type 2
uint8_t dmrsConfigType;
/// DL-DMRS-Scrambling-ID [TS38.211, sec 7.4.1.1.2 ] If provided by the higher-layer and the PDSCH is scheduled by PDCCH with CRC scrambled by CRNTI or CS-RNTI, otherwise, L2 should set this to physical cell id. Value: 0->65535
@@ -833,7 +833,7 @@ typedef struct {
// Pdsch Allocation in frequency domain [TS38.214, sec 5.1.2.2]
/// Resource Allocation Type [TS38.214, sec 5.1.2.2] 0: Type 0, 1: Type 1
uint8_t resourceAlloc;
/// For resource alloc type 0. TS 38.212 V15.0.x, 7.3.1.2.2 bitmap of RBs, 273 rounded up to multiple of 32. This bitmap is in units of VRBs. LSB of byte 0 of the bitmap represents the first RB of the bwp
/// For resource alloc type 0. TS 38.212 V15.0.x, 7.3.1.2.2 bitmap of RBs, 273 rounded up to multiple of 32. This bitmap is in units of VRBs. LSB of byte 0 of the bitmap represents the first RB of the bwp
uint8_t rbBitmap[36];
/// For resource allocation type 1. [TS38.214, sec 5.1.2.2.2] The starting resource block within the BWP for this PDSCH. Value: 0->274
uint16_t rbStart;
@@ -885,7 +885,7 @@ typedef struct
uint16_t bwp_start;//bandwidth part start RB index from reference CRB [TS38.213 sec 12] Value: 0->274
uint8_t subcarrier_spacing;//Value:0->4
uint8_t cyclic_prefix;//0: Normal; 1: Extended
uint8_t nr_of_code_words;//Number of code words for this RNTI (UE) Value: 1 -> 2
uint8_t nr_of_code_words;//Number of code words for this RNTI (UE) Value: 1 -> 2
nfapi_nr_code_word_t* code_word_list;
uint16_t data_scrambling_id;//
uint8_t nr_of_layers;//
@@ -1015,7 +1015,7 @@ typedef struct {
};
} nfapi_nr_dl_tti_request_pdu_t;
#define NFAPI_NR_MAX_DL_TTI_PDUS 32
#define NFAPI_NR_MAX_DL_TTI_PDUS 32
typedef struct {
/// Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255
@@ -1042,7 +1042,7 @@ typedef struct {
nfapi_p7_message_header_t header;
uint32_t t1;
uint32_t t2;
uint32_t t3;
uint32_t t3;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_ul_node_sync_t;
@@ -1066,23 +1066,23 @@ typedef struct
nfapi_nr_dl_tti_ssb_pdu_t* ssb_pdu;
} nfapi_nr_dl_pdu_configuration_t;
*/
/*
typedef struct
/*
typedef struct
{
uint16_t pdu_type;//0: PDCCH PDU 1: PDSCH PDU 2: CSI-RS PDU 3: SSB PDU,
uint16_t pdu_type;//0: PDCCH PDU 1: PDSCH PDU 2: CSI-RS PDU 3: SSB PDU,
uint16_t pdu_size;//Size of the PDU control information (in bytes). This length value includes the 4 bytes required for the PDU type and PDU size parameters. Value 0 -> 65535
nfapi_nr_dl_pdu_configuration_t* dl_pdu_configuration;
} nfapi_nr_dl_tti_request_number_of_pdus_t;
typedef struct
typedef struct
{
uint8_t pdu_idx;//This value is an index for number of PDU identified by nPDU in this message Value: 0 -> 255
} nfapi_nr_dl_tti_request_number_of_ue_t;
typedef struct
typedef struct
{
uint8_t n_ue;//Number of UE in this group For SU-MIMO, one group includes one UE only. For MU-MIMO, one group includes up to 12 UEs. Value 1 -> 12
nfapi_nr_dl_tti_request_number_of_ue_t* ue_list;
@@ -1091,7 +1091,7 @@ typedef struct
//3.4.2 dl_tti_request
typedef struct {
uint16_t sfn; //0->1023
uint16_t sfn; //0->1023
uint16_t slot;//0->319
uint8_t n_pdus;//Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255
uint8_t n_group;//Number of UE Groups included in this message. Value 0 -> 255
@@ -1102,7 +1102,7 @@ typedef struct {
*/
// Section 3.4.3 ul_tti_request
//for prach_pdu:
typedef struct
{
@@ -1176,7 +1176,7 @@ typedef struct
}nfapi_nr_pusch_ptrs_t;
//for nfapi_nr_dfts_ofdm_t
//for nfapi_nr_dfts_ofdm_t
typedef struct
{
uint8_t low_papr_group_number;//Group number for Low PAPR sequence generation.
@@ -1368,7 +1368,7 @@ typedef struct
} nfapi_nr_ul_tti_request_number_of_pdus_t;
typedef struct
typedef struct
{
uint8_t pdu_idx;//This value is an index for number of PDU identified by nPDU in this message Value: 0 -> 255
@@ -1383,7 +1383,7 @@ typedef struct
typedef struct {
nfapi_p7_message_header_t header;
uint16_t SFN; //0->1023
uint16_t SFN; //0->1023
uint16_t Slot;//0->319
uint8_t n_pdus;//Number of PDUs that are included in this message. All PDUs in the message are numbered in order. Value 0 -> 255
uint8_t rach_present;//Indicates if a RACH PDU will be included in this message. 0: no RACH in this slot 1: RACH in this slot
@@ -1399,9 +1399,9 @@ typedef struct {
//table 3-54
/*
typedef struct
typedef struct
{
uint16_t pdu_type;//0: PDCCH PDU
uint16_t pdu_type;//0: PDCCH PDU
uint16_t pdu_size;
nfapi_nr_dl_pdu_configuration_t* phcch_pdu_configuration;
@@ -1465,7 +1465,7 @@ typedef struct
uint16_t PDU_length;
uint16_t PDU_index;
uint32_t num_TLV;
nfapi_nr_tx_data_request_tlv_t TLVs[NFAPI_NR_MAX_TX_REQUEST_TLV];
nfapi_nr_tx_data_request_tlv_t TLVs[NFAPI_NR_MAX_TX_REQUEST_TLV];
} nfapi_nr_pdu_t;
@@ -1491,7 +1491,7 @@ typedef enum {
//table 3-61
#define NFAPI_NR_RX_DATA_IND_MAX_PDU 100
typedef struct
typedef struct
{
uint32_t handle;
uint16_t rnti;
@@ -1590,7 +1590,7 @@ typedef struct
uint8_t csi_part1_crc;
uint16_t csi_part1_bit_len;
uint8_t* csi_part1_payload;
} nfapi_nr_csi_part1_pdu_t;
//table 3-72
@@ -1630,7 +1630,7 @@ typedef struct
uint16_t rssi;
nfapi_nr_sr_pdu_0_1_t *sr;//67
nfapi_nr_harq_pdu_0_1_t *harq;//68
}nfapi_nr_uci_pucch_pdu_format_0_1_t;

View File

@@ -47,6 +47,8 @@
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
int l1_north_init_gNB() {
if (RC.nb_nr_L1_inst > 0 && RC.gNB != NULL) {
@@ -59,7 +61,7 @@ int l1_north_init_gNB() {
AssertFatal(RC.gNB[i]!=NULL,"RC.gNB[%d] is null\n",i);
if ((RC.gNB[i]->if_inst = NR_IF_Module_init(i))<0) return(-1);
LOG_I(PHY,"%s() RC.gNB[%d] installing callbacks\n", __FUNCTION__, i);
RC.gNB[i]->if_inst->NR_PHY_config_req = nr_phy_config_request;
RC.gNB[i]->if_inst->NR_Schedule_response = nr_schedule_response;
@@ -501,7 +503,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
else {
gNB->number_of_nr_dlsch_max = NUMBER_OF_NR_DLSCH_MAX;
gNB->number_of_nr_ulsch_max = NUMBER_OF_NR_ULSCH_MAX;
}
}
load_dftslib();
@@ -512,7 +514,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
load_nrLDPClib(NULL);
if (gNB->ldpc_offload_flag)
load_nrLDPClib_offload();
load_nrLDPClib_offload();
init_codebook_gNB(gNB);
@@ -650,8 +652,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
common_vars->beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t));
memset(common_vars->beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame);
}
common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100);
common_vars->debugBuff_sample_offset = 0;
common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100);
common_vars->debugBuff_sample_offset = 0;
// PRACH
prach_vars->prachF = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) );
@@ -713,6 +715,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
for (ulsch_id=0; ulsch_id<NUMBER_OF_UE_MAX; ulsch_id++)
gNB->UE_stats_ptr[ulsch_id] = &gNB->UE_stats[ulsch_id];
*/
return (0);
}
@@ -885,6 +889,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
nfapi_nr_config_request_scf_t *gNB_config = &gNB->gNB_config;
//overwrite for new NR parameters
uint64_t rev_burst=0;
for (int i=0; i<64; i++)
rev_burst |= (((position_in_burst>>(63-i))&0x01)<<i);
@@ -934,9 +939,18 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
gNB->configured = 1;
LOG_I(PHY,"gNB configured\n");
}
void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
uint8_t Mod_id = phy_config->Mod_id;
uint8_t short_sequence, num_sequences, rootSequenceIndex, fd_occasion;
@@ -948,7 +962,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
uint64_t dl_bw_khz = (12*gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
fp->dl_CarrierFreq = ((dl_bw_khz>>1) + gNB_config->carrier_config.dl_frequency.value)*1000 ;
uint64_t ul_bw_khz = (12*gNB_config->carrier_config.ul_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + gNB_config->carrier_config.uplink_frequency.value)*1000 ;
@@ -965,7 +979,7 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
(unsigned long long)fp->ul_CarrierFreq);
nr_init_frame_parms(gNB_config, fp);
if (RC.gNB[Mod_id]->configured == 1) {
LOG_E(PHY,"Already gNB already configured, do nothing\n");
@@ -1065,3 +1079,5 @@ void reset_nr_transport(PHY_VARS_gNB *gNB)
for (int i=0; i<gNB->number_of_nr_ulsch_max; i++)
free_gNB_ulsch(&gNB->ulsch[i], fp->N_RB_UL);
}

View File

@@ -42,6 +42,13 @@
#define NO_INTERP 1
#define dBc(x,y) (dB_fixed(((int32_t)(x))*(x) + ((int32_t)(y))*(y)))
void srs_TOA(int32_t *buffer, int32_t buf_len);
void freq2time(uint16_t ofdm_symbol_size,
int16_t *freq_signal,
int16_t *time_signal) {
@@ -619,7 +626,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
c16_t *phase_per_symbol = (c16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx];
ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
*ptrs_re_symbol = 0;
phase_per_symbol[symbol].i = 0;
phase_per_symbol[symbol].i = 0;
/* set DMRS estimates to 0 angle with magnitude 1 */
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
/* set DMRS real estimation to 32767 */
@@ -629,7 +636,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
#endif
}
else {// real ptrs value is set to 0
phase_per_symbol[symbol].r = 0;
phase_per_symbol[symbol].r = 0;
}
if(symbol == *startSymbIndex) {
@@ -740,6 +747,7 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
fd_cdm = 2;
}
c16_t srs_ls_estimated_channel[frame_parms->ofdm_symbol_size*(1<<srs_pdu->num_symbols)];
uint32_t noise_power_per_rb[srs_pdu->bwp_size];
int16_t ch_real[frame_parms->nb_antennas_rx*N_ap*M_sc_b_SRS];
@@ -941,6 +949,14 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
(gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t));
} // for (int p_index = 0; p_index < N_ap; p_index++)
LOG_I(NR_PHY,"SRS TOA Estimate for Frame = %d, Slot = %d, phy_cell_id=%d \n", frame, slot, gNB->gNB_config.cell_config.phy_cell_id.value) ;
srs_TOA((int32_t *)srs_estimated_channel_time[ant], frame_parms->ofdm_symbol_size); // peak estimator ///
} // for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++)
// Compute signal power
@@ -986,6 +1002,7 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
sum_im2 = sum_im2 + noise_imag[base_idx+srs_symb]*noise_imag[base_idx+srs_symb];
} // for (int srs_symb = 0; srs_symb < srs_symbols_per_rb; srs_symb++)
} // for (int p_index = 0; p_index < N_ap; p_index++)
} // for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++)
noise_power_per_rb[rb] = max(sum_re2 / n_noise_est - (sum_re / n_noise_est) * (sum_re / n_noise_est) +
@@ -1009,3 +1026,35 @@ int nr_srs_channel_estimation(const PHY_VARS_gNB *gNB,
return 0;
}
void srs_TOA(int32_t *buffer, int32_t buf_len) {
//Peak Calculation
int32_t max_val = 0, max_idx = 0, abs_val = 0;
for(int k = 0; k < buf_len; k++) {
int Re = ((c16_t*)buffer)[k].r;
int Im = ((c16_t*)buffer)[k].i;
abs_val = (Re*Re/2) + (Im*Im/2);
//int im = srs_estimated_channel_time[ant][k]<<16
//int re = srs_estimated_channel_time[ant][k]>>16
if(abs_val > max_val){
max_val = abs_val;
max_idx = k;
}
}
// Scalling
//if (max_idx > buf_len/2) {
// max_idx= max_idx- buf_len;
// }
LOG_I(NR_PHY,"Peak index = %d, Peak Value = %d \n", max_idx, max_val);
}

View File

@@ -49,6 +49,8 @@
#define MAX_NUM_RU_PER_gNB MAX_NUM_RU_PER_eNB
#define MAX_PUCCH0_NID 8
typedef struct {
int nb_id;
int Nid[MAX_PUCCH0_NID];
@@ -207,7 +209,7 @@ typedef struct {
typedef struct {
int frame;
int slot;
nfapi_nr_prach_pdu_t pdu;
nfapi_nr_prach_pdu_t pdu;
} gNB_PRACH_list_t;
#define NUMBER_OF_NR_PRACH_MAX 8
@@ -268,7 +270,7 @@ typedef struct {
/// delta_TF for power control
int32_t delta_TF;
/////////////////////// ulsch decoding ///////////////////////
/// Transport block size (This is A from 38.212 V15.4.0 section 5.1)
uint32_t TBS;
@@ -381,7 +383,7 @@ typedef struct {
/// Maximum number of LDPC iterations
uint8_t max_ldpc_iterations;
/// number of iterations used in last LDPC decoding
uint8_t last_iteration_cnt;
uint8_t last_iteration_cnt;
} NR_gNB_ULSCH_t;
typedef struct {
@@ -418,7 +420,7 @@ typedef struct {
/// \brief Anaglogue beam ID for each OFDM symbol (used when beamforming not done in RU)
/// - first index: antenna port
/// - second index: beam_id [0.. symbols_per_frame[
uint8_t **beam_id;
uint8_t **beam_id;
int32_t *debugBuff;
int32_t debugBuff_sample_offset;
} NR_gNB_COMMON;
@@ -722,6 +724,7 @@ typedef struct PHY_VARS_gNB_s {
NR_UL_IND_t UL_INFO;
pthread_mutex_t UL_INFO_mutex;
/// NFAPI RX ULSCH information
nfapi_nr_rx_data_pdu_t rx_pdu_list[MAX_UL_PDUS_PER_SLOT];
/// NFAPI RX ULSCH CRC information
@@ -738,7 +741,7 @@ typedef struct PHY_VARS_gNB_s {
//Sched_Rsp_t Sched_INFO;
nfapi_nr_ul_tti_request_t UL_tti_req;
nfapi_nr_uci_indication_t uci_indication;
// nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu;
// nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu;
uint16_t num_pdsch_rnti[80];
@@ -876,7 +879,7 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t tprep;
time_stats_t tparity;
time_stats_t toutput;
time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_interleaving_stats;
time_stats_t dlsch_segmentation_stats;
@@ -912,7 +915,7 @@ typedef struct PHY_VARS_gNB_s {
int number_of_nr_ulsch_max;
void * scopeData;
/// structure for analyzing high-level RT measurements
rt_L1_profiling_t rt_L1_profiling;
rt_L1_profiling_t rt_L1_profiling;
} PHY_VARS_gNB;
typedef struct LDPCDecode_s {
@@ -920,7 +923,7 @@ typedef struct LDPCDecode_s {
NR_UL_gNB_HARQ_t *ulsch_harq;
t_nrLDPC_dec_params decoderParms;
NR_gNB_ULSCH_t *ulsch;
short* ulsch_llr;
short* ulsch_llr;
int ulsch_id;
int harq_pid;
int rv_index;

View File

@@ -110,7 +110,7 @@
#define NR_NB_NSCID 2
extern const uint8_t nr_rv_round_map[4];
extern const uint8_t nr_rv_round_map[4];
static inline
uint8_t nr_rv_to_round(uint8_t rv)
@@ -236,6 +236,9 @@ typedef struct {
uint8_t init_msg1;
} NR_PRACH_RESOURCES_t;
typedef struct {
uint8_t k_0_p[MAX_NUM_NR_SRS_AP][MAX_NUM_NR_SRS_SYMBOLS];
uint8_t srs_generated_signal_bits;

View File

@@ -20,7 +20,7 @@
*/
/*! \file openair2/GNB_APP/RRC_nr_paramsvalues.h
* \brief macro definitions for RRC authorized and asn1 parameters values, to be used in paramdef_t/chechedparam_t structure initializations
* \brief macro definitions for RRC authorized and asn1 parameters values, to be used in paramdef_t/chechedparam_t structure initializations
* \author Francois TABURET, WEI-TAI CHEN, Turker Yilmaz
* \date 2018
* \version 0.1
@@ -78,11 +78,11 @@
#define GNB_CONFIG_STRING_RARESPONSEWINDOW "ra_ResponseWindow"
#define GNB_CONFIG_STRING_SSBPERRACHOCCASIONANDCBPREAMBLESPERSSBPR "ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR"
#define GNB_CONFIG_STRING_SSBPERRACHOCCASIONANDCBPREAMBLESPERSSB "ssb_perRACH_OccasionAndCB_PreamblesPerSSB"
#define GNB_CONFIG_STRING_RACONTENTIONRESOLUTIONTIMER "ra_ContentionResolutionTimer"
#define GNB_CONFIG_STRING_RSRPTHRESHOLDSSB "rsrp_ThresholdSSB"
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR "prach_RootSequenceIndex_PR"
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX "prach_RootSequenceIndex"
#define GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING "msg1_SubcarrierSpacing"
#define GNB_CONFIG_STRING_RACONTENTIONRESOLUTIONTIMER "ra_ContentionResolutionTimer"
#define GNB_CONFIG_STRING_RSRPTHRESHOLDSSB "rsrp_ThresholdSSB"
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR "prach_RootSequenceIndex_PR"
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX "prach_RootSequenceIndex"
#define GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING "msg1_SubcarrierSpacing"
#define GNB_CONFIG_STRING_RESTRICTEDSETCONFIG "restrictedSetConfig"
#define GNB_CONFIG_STRING_MSG3TRANSFPREC "msg3_transformPrecoder"
#define GNB_CONFIG_STRING_PUSCHTIMEDOMAINALLOCATIONLIST "puschTimeDomainAllocationList"
@@ -186,7 +186,6 @@
#define GNB_CONFIG_ABSOLUTEFREQUENCYPOINTA_IDX 7
#define GNB_CONFIG_DLCARRIERBANDWIDTH_IDX 10
#define SCCPARAMS_DESC(scc) { \
{GNB_CONFIG_STRING_PHYSCELLID,NULL,0,i64ptr:scc->physCellId,defint64val:0,TYPE_INT64,0/*0*/}, \
{GNB_CONFIG_STRING_NTIMINGADVANCEOFFSET,NULL,0,i64ptr:scc->n_TimingAdvanceOffset,defint64val:NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0,TYPE_INT64,0/*1*/},\

View File

@@ -110,7 +110,7 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
scc->uplinkConfigCommon = CALLOC(1,sizeof(struct NR_UplinkConfigCommon));
scc->uplinkConfigCommon->frequencyInfoUL = CALLOC(1,sizeof(struct NR_FrequencyInfoUL));
scc->uplinkConfigCommon->initialUplinkBWP = CALLOC(1,sizeof(struct NR_BWP_UplinkCommon));
//scc->supplementaryUplinkConfig = CALLOC(1,sizeof(struct NR_UplinkConfigCommon));
//scc->supplementaryUplinkConfig = CALLOC(1,sizeof(struct NR_UplinkConfigCommon));
scc->ssb_PositionsInBurst = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__ssb_PositionsInBurst));
scc->ssb_periodicityServingCell = CALLOC(1,sizeof(long));
// scc->rateMatchPatternToAddModList = CALLOC(1,sizeof(struct NR_ServingCellConfigCommon__rateMatchPatternToAddModList));
@@ -118,17 +118,17 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
scc->ssbSubcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
scc->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon));
scc->tdd_UL_DL_ConfigurationCommon->pattern2 = CALLOC(1,sizeof(struct NR_TDD_UL_DL_Pattern));
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB = CALLOC(1,sizeof(NR_ARFCN_ValueNR_t));
dl_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t));
dl_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier));
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list,dl_frequencyBandList);
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list,dl_scs_SpecificCarrierList);
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list,dl_frequencyBandList);
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list,dl_scs_SpecificCarrierList);
// scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PDCCH_ConfigCommon));
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->present=NR_SetupRelease_PDCCH_ConfigCommon_PR_setup;
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->present=NR_SetupRelease_PDCCH_ConfigCommon_PR_setup;
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon));
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = CALLOC(1,sizeof(long));
scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = CALLOC(1,sizeof(long));
@@ -153,7 +153,7 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
// scc->uplinkConfigCommon->frequencyInfoUL->additionalSpectrumEmission = CALLOC(1,sizeof(NR_AdditionalSpectrumEmission_t));
scc->uplinkConfigCommon->frequencyInfoUL->p_Max = CALLOC(1,sizeof(NR_P_Max_t));
// scc->uplinkConfigCommon->frequencyInfoUL->frequencyShift7p5khz = CALLOC(1,sizeof(long));
// scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.cyclicPrefix = CALLOC(1,sizeof(long));
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_RACH_ConfigCommon_t));
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->present = NR_SetupRelease_RACH_ConfigCommon_PR_setup;
@@ -167,17 +167,17 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = CALLOC(1,sizeof(long));
// 0 - ENABLE, 1 - DISABLE, hence explicitly setting to DISABLED.
*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_PUSCH_ConfigCommon_t));
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_PUSCH_ConfigCommon_t));
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->present = NR_SetupRelease_PUSCH_ConfigCommon_PR_setup;
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon));
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long));
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocationList));
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble = CALLOC(1,sizeof(long));
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant = CALLOC(1,sizeof(long));
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon));
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon = CALLOC(1,sizeof(struct NR_SetupRelease_PUCCH_ConfigCommon));
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->present= NR_SetupRelease_PUCCH_ConfigCommon_PR_setup;
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUCCH_ConfigCommon));
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal = CALLOC(1,sizeof(long));
@@ -187,7 +187,7 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
// scc->ssb_PositionsInBurst->choice.shortBitmap.buf = MALLOC(1);
// scc->ssb_PositionsInBurst->choice.mediumBitmap.buf = MALLOC(1);
// scc->ssb_PositionsInBurst->choice.longBitmap.buf = MALLOC(8);
ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier));
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList);
@@ -207,14 +207,14 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) {
//ratematchpattern->patternType.choice.bitmaps->periodicityAndPattern->choice.n40.buf = MALLOC(5);
//ratematchpattern->subcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
//ratematchpatternid = CALLOC(1,sizeof(NR_RateMatchPatternId_t));
}
void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) {
*scc->physCellId=0; \
// *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0;
*scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20;
*scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20;
scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2;
*scc->ssbSubcarrierSpacing=mu_dl;
if (mu_dl == 0) {
@@ -280,7 +280,7 @@ void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_R
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1);
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1;
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90;
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither;
scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither;
*scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40;
*scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90;
scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap;
@@ -325,7 +325,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
curr_bit = 0;
else
curr_bit = (ssbmap>>(7-i))&0x01;
scc->ssb_PositionsInBurst->choice.shortBitmap.buf[0] |= curr_bit<<i;
scc->ssb_PositionsInBurst->choice.shortBitmap.buf[0] |= curr_bit<<i;
}
}else if(ssbmaplen==NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap){
scc->ssb_PositionsInBurst->choice.mediumBitmap.size = 1;
@@ -333,7 +333,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
scc->ssb_PositionsInBurst->choice.mediumBitmap.buf = CALLOC(1,1);
scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] = 0;
for (int i=0; i<8; i++)
scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] |= (((ssbmap>>(7-i))&0x01)<<i);
scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0] |= (((ssbmap>>(7-i))&0x01)<<i);
}else {
scc->ssb_PositionsInBurst->choice.longBitmap.size = 8;
scc->ssb_PositionsInBurst->choice.longBitmap.bits_unused = 0;
@@ -504,7 +504,7 @@ void fix_scd(NR_ServingCellConfig_t *scd) {
for (int bwp_i = 0 ; bwp_i<scd->downlinkBWP_ToAddModList->list.count; bwp_i++) {
NR_DMRS_DownlinkConfig_t *dmrs_dl_config = scd->downlinkBWP_ToAddModList->list.array[bwp_i]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
if (dmrs_dl_config->phaseTrackingRS) {
// If any of the frequencyDensity values are not set or are out of bounds, PTRS is assumed to be not present
for (int i = dmrs_dl_config->phaseTrackingRS->choice.setup->frequencyDensity->list.count - 1; i >= 0; i--) {
@@ -549,7 +549,7 @@ void fix_scd(NR_ServingCellConfig_t *scd) {
for (int bwp_i = 0 ; bwp_i<scd->uplinkConfig->uplinkBWP_ToAddModList->list.count; bwp_i++) {
NR_DMRS_UplinkConfig_t *dmrs_ul_config = scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_i]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
if (dmrs_ul_config->phaseTrackingRS) {
// If any of the frequencyDensity values are not set or are out of bounds, PTRS is assumed to be not present
for (int i = dmrs_ul_config->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.count-1; i >= 0; i--) {
@@ -641,7 +641,7 @@ void RCconfig_nr_flexran()
/* gNB ID from configuration, as read in by RCconfig_RRC() */
if (!GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr) {
// Calculate a default gNB ID
if (get_softmodem_params()->sa)
if (get_softmodem_params()->sa)
gnb_id = i + (ngap_generate_gNB_id () & 0xFFFFFF8);
else
gnb_id = i;
@@ -720,7 +720,7 @@ void RCconfig_nr_prs(void)
for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++)
{
prs_config->MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l];
if (k == 0) // print only for 0th resource
if (k == 0) // print only for 0th resource
snprintf(str[5]+strlen(str[5]),sizeof(str[5])-strlen(str[5]),"%d, ",prs_config->MutingPattern1[l]);
}
for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++)
@@ -774,7 +774,7 @@ void RCconfig_NR_L1(void) {
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal (num_gnbs > 0,"Failed to parse config file no gnbs %s \n",GNB_CONFIG_STRING_ACTIVE_GNBS);
@@ -865,12 +865,12 @@ void RCconfig_NR_L1(void) {
RC.gNB[j]->eth_params_n.my_portd,
RC.gNB[j]->eth_params_n.remote_portd);
}else { // other midhaul
}
}
}// for (j = 0; j < RC.nb_nr_L1_inst; j++)
printf("Initializing northbound interface for L1\n");
l1_north_init_gNB();
}else{
LOG_I(PHY,"No " CONFIG_STRING_L1_LIST " configuration found");
LOG_I(PHY,"No " CONFIG_STRING_L1_LIST " configuration found");
// DJP need to create some structures for VNF
@@ -882,7 +882,7 @@ void RCconfig_NR_L1(void) {
memset((void*)RC.gNB[j],0,sizeof(PHY_VARS_gNB));
LOG_I(PHY,"RC.gNB[%d] = %p\n",j,RC.gNB[j]);
RC.gNB[j]->Mod_id = j;
}
}
}
}
@@ -896,12 +896,12 @@ void RCconfig_nr_macrlc() {
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
ngran_node_t node_type = get_node_type();
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal (num_gnbs > 0,"Failed to parse config file no gnbs %s \n",GNB_CONFIG_STRING_ACTIVE_GNBS);
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr;
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr;
char *save = NULL;
char *pt = strtok_r(ulprbbl, ",", &save);
uint16_t prbbl[275];
@@ -920,11 +920,11 @@ void RCconfig_nr_macrlc() {
checkedparam_t config_check_MacRLCParams [] = MACRLCPARAMS_CHECK;
for (int i = 0; i < sizeof(MacRLC_Params) / sizeof(paramdef_t); ++i)
MacRLC_Params[i].chkPptr = &(config_check_MacRLCParams[i]);
config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL);
config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL);
if ( MacRLC_ParamList.numelt > 0) {
RC.nb_nr_macrlc_inst=MacRLC_ParamList.numelt;
RC.nb_nr_macrlc_inst=MacRLC_ParamList.numelt;
mac_top_init_gNB(node_type);
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
@@ -935,15 +935,15 @@ void RCconfig_nr_macrlc() {
RC.nrmac[j]->ul_prbblack_SNR_threshold = *(MacRLC_ParamList.paramarray[j][MACRLC_UL_PRBBLACK_SNR_THRESHOLD_IDX].iptr);
RC.nrmac[j]->pucch_failure_thres = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCHFAILURETHRES_IDX].iptr);
RC.nrmac[j]->pusch_failure_thres = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCHFAILURETHRES_IDX].iptr);
LOG_I(NR_MAC,"PUSCH Target %d, PUCCH Target %d, PUCCH Failure %d, PUSCH Failure %d\n",
RC.nrmac[j]->pusch_target_snrx10,
RC.nrmac[j]->pucch_target_snrx10,
RC.nrmac[j]->pucch_failure_thres,
RC.nrmac[j]->pusch_failure_thres);
RC.nrmac[j]->pusch_failure_thres);
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
// check number of instances is same as RRC/PDCP
}else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
printf("Configuring F1 interfaces for MACRLC\n");
RC.nrmac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
@@ -966,7 +966,7 @@ void RCconfig_nr_macrlc() {
RC.nrmac[j]->eth_params_n.transp_preference = ETH_UDP_MODE;
}else { // other midhaul
AssertFatal(1==0,"MACRLC %d: %s unknown northbound midhaul\n",j, *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr));
}
}
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_L1") == 0) {
@@ -985,7 +985,7 @@ void RCconfig_nr_macrlc() {
printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.nrmac[j]->eth_params_s.my_portc);
}else { // other midhaul
AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr));
}
}
RC.nrmac[j]->ulsch_max_frame_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_FRAME_INACTIVITY].uptr);
NR_bler_options_t *dl_bler_options = &RC.nrmac[j]->dl_bler;
dl_bler_options->upper = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_BLER_TARGET_UPPER_IDX].dblptr);
@@ -1004,7 +1004,7 @@ void RCconfig_nr_macrlc() {
}// for (j=0;j<RC.nb_nr_macrlc_inst;j++)
}else {// MacRLC_ParamList.numelt > 0
LOG_E(PHY,"No %s configuration found\n", CONFIG_STRING_MACRLC_LIST);
// AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found");
// AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found");
}
}
@@ -1156,19 +1156,19 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
////////// Physical parameters
/* get global parameters, defined outside any section in the config file */
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal (i<num_gnbs,"Failed to parse config file no %ith element in %s \n",i, GNB_CONFIG_STRING_ACTIVE_GNBS);
if (num_gnbs>0) {
// Output a list of all gNBs. ////////// Identification parameters
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
if (GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID
if (get_softmodem_params()->sa) {
if (get_softmodem_params()->sa) {
uint32_t hash;
hash = ngap_generate_gNB_id ();
gnb_id = i + (hash & 0xFFFFFF8);
@@ -1193,9 +1193,9 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
config_getlist(&SCCsParamList, NULL, 0, aprefix);
if (SCCsParamList.numelt > 0) {
if (SCCsParamList.numelt > 0) {
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, 0);
config_get( SCCsParams,sizeof(SCCsParams)/sizeof(paramdef_t),aprefix);
config_get( SCCsParams,sizeof(SCCsParams)/sizeof(paramdef_t),aprefix);
LOG_I(RRC,"Read in ServingCellConfigCommon (PhysCellId %d, ABSFREQSSB %d, DLBand %d, ABSFREQPOINTA %d, DLBW %d,RACH_TargetReceivedPower %d\n",
(int)*scc->physCellId,
(int)*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB,
@@ -1203,15 +1203,16 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
(int)scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA,
(int)scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth,
(int)scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower);
fix_scc(scc,ssb_bitmap);
fix_scc(scc,ssb_bitmap);
}
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
config_getlist(&SCDsParamList, NULL, 0, aprefix);
if (SCDsParamList.numelt > 0) {
if (SCDsParamList.numelt > 0) {
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, 0);
config_get( SCDsParams,sizeof(SCDsParams)/sizeof(paramdef_t),aprefix);
config_get( SCDsParams,sizeof(SCDsParams)/sizeof(paramdef_t),aprefix);
LOG_I(RRC,"Read in ServingCellConfigDedicated UL (FreqDensity_0 %d, FreqDensity_1 %d, TimeDensity_0 %d, TimeDensity_1 %d, TimeDensity_2 %d, RE offset %d, First_active_BWP_ID %d SCS %d, LocationandBW %d \n",
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[0],
(int)*scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup->transformPrecoderDisabled->frequencyDensity->list.array[1],
@@ -1264,7 +1265,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
rrc->um_on_default_drb = *(GNBParamList.paramarray[i][GNB_UMONDEFAULTDRB_IDX].uptr);
if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) {
} else if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) {
rrc->eth_params_s.local_if_name = strdup(*(GNBParamList.paramarray[i][GNB_LOCAL_S_IF_NAME_IDX].strptr));
rrc->eth_params_s.my_addr = strdup(*(GNBParamList.paramarray[i][GNB_LOCAL_S_ADDRESS_IDX].strptr));
@@ -1275,17 +1276,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
rrc->eth_params_s.remote_portd = *(GNBParamList.paramarray[i][GNB_REMOTE_S_PORTD_IDX].uptr);
rrc->eth_params_s.transp_preference = ETH_UDP_MODE;
} else { // other midhaul
}
}
// search if in active list
for (k=0; k <num_gnbs ; k++) {
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[k], *(GNBParamList.paramarray[i][GNB_GNB_NAME_IDX].strptr) )== 0) {
char gnbpath[MAX_OPTNAME_SIZE + 8];
sprintf(gnbpath,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
@@ -1315,7 +1316,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
NRRRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt;
for (int l = 0; l < PLMNParamList.numelt; ++l) {
NRRRC_CONFIGURATION_REQ (msg_p).mcc[l] = *PLMNParamList.paramarray[l][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
NRRRC_CONFIGURATION_REQ (msg_p).mnc[l] = *PLMNParamList.paramarray[l][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] = *PLMNParamList.paramarray[l][GNB_MNC_DIGIT_LENGTH].u8ptr;
@@ -1370,20 +1371,20 @@ int RCconfig_nr_gtpu(void ) {
LOG_I(GTPU,"Configuring GTPu\n");
/* get number of active eNodeBs */
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal (num_gnbs >0,
"Failed to parse config file no active gNodeBs in %s \n", GNB_CONFIG_STRING_ACTIVE_GNBS);
sprintf(gtpupath,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get(NETParams,sizeof(NETParams)/sizeof(paramdef_t),gtpupath);
config_get(NETParams,sizeof(NETParams)/sizeof(paramdef_t),gtpupath);
char *cidr=NULL, *address = NULL;
int port;
if (NETParams[1].strptr != NULL) {
LOG_I(GTPU, "SA mode \n");
address = strtok_r(gnb_ipv4_address_for_NGU, "/", &cidr);
port=gnb_port_for_NGU;
} else {
} else {
LOG_I(GTPU, "NSA mode \n");
address = strtok_r(gnb_ipv4_address_for_S1U, "/", &cidr);
port=gnb_port_for_S1U;
@@ -1401,7 +1402,7 @@ int RCconfig_nr_gtpu(void ) {
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
} else
LOG_E(GTPU,"invalid address for NGU or S1U\n");
return 0;
}
@@ -1414,7 +1415,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
char *address = NULL;
char *cidr = NULL;
// for no gcc warnings
// for no gcc warnings
(void) my_int;
@@ -1429,23 +1430,23 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
/* get global parameters, defined outside any section in the config file */
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
AssertFatal (i<GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt,
"Failed to parse config file %s, %uth attribute %s \n",
RC.config_file_name, i, GNB_CONFIG_STRING_ACTIVE_GNBS);
if (GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt>0) {
// Output a list of all gNBs.
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
if (GNBParamList.numelt > 0) {
for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID
if (get_softmodem_params()->sa) {
uint32_t hash;
hash = ngap_generate_gNB_id ();
gnb_id = k + (hash & 0xFFFFFF8);
} else {
@@ -1454,8 +1455,8 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
} else {
gnb_id = *(GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr);
}
// search if in active list
for (j=0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) {
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) {
@@ -1474,14 +1475,14 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
paramdef_t NGParams[] = GNBNGPARAMS_DESC;
paramlist_def_t NGParamList = {GNB_CONFIG_STRING_AMF_IP_ADDRESS,NULL,0};
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k);
NGAP_REGISTER_GNB_REQ (msg_p).gNB_id = gnb_id;
if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_MACRO_GNB") == 0) {
NGAP_REGISTER_GNB_REQ (msg_p).cell_type = CELL_MACRO_GNB;
} else if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_HOME_GNB") == 0) {
@@ -1491,7 +1492,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_GNB or CELL_HOME_GNB !\n",
RC.config_file_name, i, *(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr));
}
NGAP_REGISTER_GNB_REQ (msg_p).gNB_name = strdup(*(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr));
NGAP_REGISTER_GNB_REQ (msg_p).tac = *GNBParamList.paramarray[k][GNB_TRACKING_AREA_CODE_IDX].uptr;
AssertFatal(!GNBParamList.paramarray[k][GNB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
@@ -1524,10 +1525,10 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
(NGAP_REGISTER_GNB_REQ (msg_p).mnc_digit_length[l] == 3),
"BAD MNC DIGIT LENGTH %d",
NGAP_REGISTER_GNB_REQ (msg_p).mnc_digit_length[l]);
NGAP_REGISTER_GNB_REQ (msg_p).num_nssai[l] = SNSSAIParamList.numelt;
for (int s = 0; s < SNSSAIParamList.numelt; ++s) {
NGAP_REGISTER_GNB_REQ (msg_p).s_nssai[l][s].sST = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
NGAP_REGISTER_GNB_REQ (msg_p).s_nssai[l][s].sD_flag = 0;
if(SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr != 0 // SD is optional
@@ -1540,19 +1541,19 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
}
}
sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
config_getlist( &NGParamList,NGParams,sizeof(NGParams)/sizeof(paramdef_t),aprefix);
config_getlist( &NGParamList,NGParams,sizeof(NGParams)/sizeof(paramdef_t),aprefix);
NGAP_REGISTER_GNB_REQ (msg_p).nb_amf = 0;
for (int l = 0; l < NGParamList.numelt; l++) {
NGAP_REGISTER_GNB_REQ (msg_p).nb_amf += 1;
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[l].ipv4_address,*(NGParamList.paramarray[l][GNB_AMF_IPV4_ADDRESS_IDX].strptr));
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[l].ipv6_address,*(NGParamList.paramarray[l][GNB_AMF_IPV6_ADDRESS_IDX].strptr));
if (strcmp(*(NGParamList.paramarray[l][GNB_AMF_IP_ADDRESS_ACTIVE_IDX].strptr), "yes") == 0) {
}
}
if (strcmp(*(NGParamList.paramarray[l][GNB_AMF_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv4 = 1;
} else if (strcmp(*(NGParamList.paramarray[l][GNB_AMF_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) {
@@ -1592,34 +1593,34 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
for (int el = 0; el < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++el)
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] = el;
}
}
// SCTP SETTING
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (get_softmodem_params()->sa) {
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
}
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
// NETWORK_INTERFACES
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
// NGAP_REGISTER_GNB_REQ (msg_p).enb_interface_name_for_NGU = strdup(enb_interface_name_for_NGU);
cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr);
char *save = NULL;
address = strtok_r(cidr, "/", &save);
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv6 = 0;
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4 = 1;
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4_address, address);
break;
}
}
@@ -1664,12 +1665,12 @@ void NRRCConfig(void) {
paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0};
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
/* get global parameters, defined outside any section in the config file */
LOG_I(GNB_APP, "Getting GNBSParams\n");
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
RC.nb_nr_inst = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
// Get num MACRLC instances
@@ -1678,13 +1679,13 @@ void NRRCConfig(void) {
// Get num L1 instances
config_getlist( &L1ParamList,NULL,0, NULL);
RC.nb_nr_L1_inst = L1ParamList.numelt;
// Get num RU instances
config_getlist( &RUParamList,NULL,0, NULL);
RC.nb_RU = RUParamList.numelt;
config_getlist( &RUParamList,NULL,0, NULL);
RC.nb_RU = RUParamList.numelt;
RCconfig_nr_parallel();
}
@@ -2044,7 +2045,7 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
SEQUENCE_free( &asn_DEF_NR_BCCH_DL_SCH_Message, bcch_message, 1 );
exit(1);
}
NR_SIB1_t *bcch_SIB1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
f1Setup->sib1[k] = calloc(1,rrc->carrier.sizeof_SIB1);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_SIB1,
@@ -2307,7 +2308,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
// generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).num_cells_failed_to_be_activated = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
@@ -2333,11 +2334,11 @@ static ngran_node_t get_node_type(void)
paramdef_t GNBParams[] = GNBPARAMS_DESC;
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL);
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL);
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
if ( MacRLC_ParamList.numelt > 0) {
RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt;
RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt;
for (int j = 0; j < RC.nb_nr_macrlc_inst; j++) {
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
macrlc_has_f1 = 1;

View File

@@ -39,11 +39,11 @@
#include "NR_BCCH-BCH-Message.h"
#include "NR_ServingCellConfigCommon.h"
#include "NR_MIB.h"
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "SCHED_NR/phy_frame_config_nr.h"
#include "NR_MIB.h"
#include "RRC/NR/nr_rrc_config.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
#include "../../../../nfapi/oai_integration/vendor_ext.h"
/* Softmodem params */
@@ -205,7 +205,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts,
if (scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA == NULL)
UL_pointA = scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
else
UL_pointA = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
UL_pointA = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
cfg->carrier_config.uplink_frequency.value = from_nrarfcn(*scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],
*scc->ssbSubcarrierSpacing,
@@ -265,11 +265,11 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts,
cfg->prach_config.prach_sequence_length.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present-1;
cfg->prach_config.prach_sequence_length.tl.tag = NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG;
cfg->num_tlv++;
cfg->num_tlv++;
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
cfg->prach_config.prach_sub_c_spacing.value = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
else
else
cfg->prach_config.prach_sub_c_spacing.value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
cfg->prach_config.prach_sub_c_spacing.tl.tag = NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG;
cfg->num_tlv++;
@@ -295,7 +295,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts,
break;
default:
AssertFatal(1==0,"msg1 FDM identifier %ld undefined (0,1,2,3) \n", scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM);
}
}
cfg->prach_config.num_prach_fd_occasions.tl.tag = NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG;
cfg->num_tlv++;
@@ -307,7 +307,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts,
for (int i=0; i<cfg->prach_config.num_prach_fd_occasions.value; i++) {
// cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i;
if (cfg->prach_config.prach_sequence_length.value)
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
else
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.tl.tag = NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG;
@@ -399,7 +399,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts,
num_ssb++;
}
cfg->num_tlv++;
}
}
cfg->carrier_config.num_rx_ant.value = pusch_AntennaPorts;
AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n");
@@ -488,7 +488,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
pusch_AntennaPorts,
scc);
LOG_D(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
if (NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) {
// fake that the gNB is configured in nFAPI mode, which would normally be
// done in a NR_PHY_config_req, but in this mode, there is no PHY
@@ -553,7 +553,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
}
}
}
if (mib) RC.nrmac[Mod_idP]->common_channels[0].mib = mib;
if (sib1) RC.nrmac[Mod_idP]->common_channels[0].sib1 = sib1;
@@ -579,7 +579,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if (ra_index == NR_NB_RA_PROC_MAX) {
LOG_E(NR_MAC, "%s() %s:%d RA processes are not available for CFRA RNTI :%x\n", __FUNCTION__, __FILE__, __LINE__, rnti);
return -1;
}
}
NR_RA_t *ra = &cc->ra[ra_index];
ra->CellGroup = CellGroup;
if (CellGroup->spCellConfig && CellGroup->spCellConfig->reconfigurationWithSync &&
@@ -639,6 +639,26 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
process_CellGroup(CellGroup,&UE->UE_sched_ctrl);
}
}
if (scc) {
//configure SRS for secondary cell
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
RC.nrmac[Mod_idP]->setup_srs_config[0] = calloc(1,sizeof(NR_SetupRelease_SRS_Config_t));
config_srs(RC.nrmac[Mod_idP]->setup_srs_config[0],
NULL,
curr_bwp,
0, //lets assume ue_id = 0.
0, //res_id = 0 for initial BWP
1, //maxMIMO_Layers
1); //do_srsg
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
return 0;

View File

@@ -162,7 +162,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot);
/*VNF first entry into scheduler. Since frame numbers for future_ul_tti_req of some future slots
/*VNF first entry into scheduler. Since frame numbers for future_ul_tti_req of some future slots
will not be set before we encounter them, set them here */
if (NFAPI_MODE == NFAPI_MODE_VNF){
@@ -219,8 +219,12 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
nr_csi_meas_reporting(module_idP, frame, slot);
// Schedule SRS: check in slot 0 for the whole frame
if (slot == 0)
nr_schedule_srs(module_idP, frame);
if (slot == 0){
nr_schedule_srs(module_idP, frame);}
if ((slot==0) && (get_softmodem_params()->phy_test == 0)){
nr_schedule_srs_secondary(module_idP,frame,0/*UE_id*/);}
// This schedule RA procedure if not in phy_test mode
// Otherwise already consider 5G already connected
@@ -233,7 +237,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
// This schedules the DCI for Downlink and PDSCH
start_meas(&gNB->schedule_dlsch);
nr_schedule_ue_spec(module_idP, frame, slot);
nr_schedule_ue_spec(module_idP, frame, slot);
stop_meas(&gNB->schedule_dlsch);
nr_sr_reporting(RC.nrmac[module_idP], frame, slot);
@@ -241,6 +245,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
nr_schedule_pucch(RC.nrmac[module_idP], frame, slot);
stop_meas(&RC.nrmac[module_idP]->eNB_scheduler);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
}

View File

@@ -165,6 +165,7 @@ void nr_schedule_srs(int module_id, frame_t frame) {
}
}
if (srs_resource == NULL) {
continue;
}
@@ -184,3 +185,80 @@ void nr_schedule_srs(int module_id, frame_t frame) {
}
}
}
/*******************************************************************
*
* NAME : nr_schedule_srs_secondary
*
* PARAMETERS : module id
* frame number for possible SRS reception
*
* DESCRIPTION : It informs the PHY layer that has an SRS to receive.
* To be used at secondary gNB (where UE is not connected).
* Only for periodic scheduling yet.
*
*********************************************************************/
void nr_schedule_srs_secondary(int module_id, frame_t frame, int UE_id) {
const int CC_id = 0;
// lets configure SRS on the initial BWP. This will only work for cell sizes of 60MHz or lower.
// for anything else this needs to be adapted to use the dedicated BWP.
NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[CC_id].ServingCellConfigCommon;
NR_SRS_Config_t *srs_config = RC.nrmac[module_id]->setup_srs_config[0]->choice.setup;
if(!scc) {
LOG_W(MAC,"no scc, returning\n");
return;
}
for(int rs = 0; rs < srs_config->srs_ResourceSetToAddModList->list.count; rs++) {
// Find periodic resource set
NR_SRS_ResourceSet_t *srs_resource_set = srs_config->srs_ResourceSetToAddModList->list.array[rs];
if (srs_resource_set->resourceType.present != NR_SRS_ResourceSet__resourceType_PR_periodic) {
continue;
}
// Find the corresponding srs resource
NR_SRS_Resource_t *srs_resource = NULL;
for (int r1 = 0; r1 < srs_resource_set->srs_ResourceIdList->list.count; r1++) {
for (int r2 = 0; r2 < srs_config->srs_ResourceToAddModList->list.count; r2++) {
if ((*srs_resource_set->srs_ResourceIdList->list.array[r1] ==
srs_config->srs_ResourceToAddModList->list.array[r2]->srs_ResourceId) &&
(srs_config->srs_ResourceToAddModList->list.array[r2]->resourceType.present ==
NR_SRS_Resource__resourceType_PR_periodic)) {
srs_resource = srs_config->srs_ResourceToAddModList->list.array[r2];
break;
}
}
}
if (srs_resource == NULL) {
continue;
}
NR_BWP_t ubwp = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present];
uint16_t offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p);
int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing];
NR_UE_info_t dummy_ue_info;
dummy_ue_info.current_UL_BWP.BWPSize = NRRIV2BW(ubwp.locationAndBandwidth,MAX_BWP_SIZE);
dummy_ue_info.current_UL_BWP.BWPStart = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth,MAX_BWP_SIZE);
dummy_ue_info.current_UL_BWP.scs = ubwp.subcarrierSpacing;
// Check if UE will transmit the SRS in this frame
if ( ((frame - offset/n_slots_frame)*n_slots_frame)%period == 0) {
LOG_D(NR_MAC,"Scheduling SRS reception for %d.%d\n", frame, offset%n_slots_frame);
nr_fill_nfapi_srs(module_id, CC_id, &dummy_ue_info, offset%n_slots_frame, srs_resource_set, srs_resource);
}
}
}

View File

@@ -60,9 +60,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
uint32_t rnti,
NR_CellGroupConfig_t *CellGroup);
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
int CC_idP,
frame_t frameP,
frame_t frameP,
sub_frame_t subframeP);
void nr_mac_update_timers(module_id_t module_id,
@@ -200,6 +200,8 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac,
void nr_schedule_srs(int module_id, frame_t frame);
void nr_schedule_srs_secondary(int module_id, frame_t frame, int UE_id);
void nr_csirs_scheduling(int Mod_idP,
frame_t frame,
sub_frame_t slot,
@@ -219,7 +221,7 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac,
void get_pdsch_to_harq_feedback(NR_PUCCH_Config_t *pucch_Config,
nr_dci_format_t dci_format,
uint8_t *pdsch_to_harq_feedback);
void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
nr_scs_e scs_common,
nr_scs_e pdcch_scs,

View File

@@ -242,6 +242,7 @@ typedef struct {
NR_BCCH_DL_SCH_Message_t *sib1;
NR_ServingCellConfigCommon_t *ServingCellConfigCommon;
NR_ARFCN_ValueEUTRA_t ul_CarrierFreq;
long ul_Bandwidth;
/// Outgoing MIB PDU for PHY
MIB_PDU MIB_pdu;
@@ -325,7 +326,7 @@ typedef struct SPCSIReportingpucch {
bool s0tos3_actDeact[4];
} SPCSIReportingpucch_t;
#define MAX_APERIODIC_TRIGGER_STATES 128 //38.331
#define MAX_APERIODIC_TRIGGER_STATES 128 //38.331
typedef struct aperiodicCSI_triggerStateSelection {
bool is_scheduled;
uint8_t servingCellId;
@@ -334,7 +335,7 @@ typedef struct aperiodicCSI_triggerStateSelection {
bool triggerStateSelection[MAX_APERIODIC_TRIGGER_STATES];
} aperiodicCSI_triggerStateSelection_t;
#define MAX_TCI_STATES 128 //38.331
#define MAX_TCI_STATES 128 //38.331
typedef struct pdschTciStatesActDeact {
bool is_scheduled;
uint8_t servingCellId;
@@ -522,9 +523,9 @@ struct CSI_Report {
#define MAX_SR_BITLEN 8
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
the number of CSI_report will depend on number of CSI resource sets that are configured in CSI-ResourceConfig RRC IE
From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set
From spec 38.331 from the IE CSI-ResourceConfig for SSB RSRP reporting we can configure only one resource set
From spec 38.214 section 5.2.1.2 For periodic and semi-persistent CSI Resource Settings, the number of CSI-RS Resource Sets configured is limited to S=1
*/
#define MAX_CSI_RESOURCE_SET_IN_CSI_RESOURCE_CONFIG 16
@@ -848,6 +849,11 @@ typedef struct gNB_MAC_INST_s {
int16_t frame;
int16_t slot;
//holds the SRS config for UEs of neighboring cells
//to be expanded to multiple users later
NR_SetupRelease_SRS_Config_t *setup_srs_config[1];
} gNB_MAC_INST;
#endif /*__LAYER2_NR_MAC_GNB_H__ */

View File

@@ -1,7 +1,7 @@
NR-RRC-Definitions DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
BEGIN
-- TAG-BCCH-BCH-MESSAGE-START
BCCH-BCH-Message ::= SEQUENCE {
@@ -12949,14 +12949,14 @@ maxNrofTxDC-TwoCarrier-r16 INTEGER ::= 64 -- Maximum number of
-- TAG-MULTIPLICITY-AND-TYPE-CONSTRAINT-DEFINITIONS-STOP
END
END
-- TAG-PC5-RRC-DEFINITIONS-START
PC5-RRC-Definitions DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
BEGIN
IMPORTS
SetupRelease,
RRC-TransactionIdentifier,
@@ -13260,13 +13260,13 @@ BandSidelinkPC5-r16 ::= SEQUENCE {
-- TAG-UECAPABILITYINFORMATIONSIDELINK-STOP
END
END
-- NR-UE-VARIABLES-START
NR-UE-Variables DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
BEGIN
IMPORTS
ARFCN-ValueNR,
CellIdentity,
@@ -13509,14 +13509,14 @@ VarShortMAC-Input ::= SEQUENCE {
-- TAG-VARSHORTMAC-INPUT-STOP
END
END
-- TAG-NR-SIDELINK-PRECONF-DEFINITIONS-START
NR-Sidelink-Preconf DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
BEGIN
IMPORTS
SL-CBR-CommonTxConfigList-r16,
SL-FreqConfigCommon-r16,
@@ -13580,13 +13580,13 @@ SL-RoHC-Profiles-r16 ::= SEQUENCE {
-- TAG-SL-PRECONFIGURATIONNR-STOP
END
END
-- TAG-NR-INTER-NODE-DEFINITIONS-START
NR-InterNodeDefinitions DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
BEGIN
IMPORTS
ARFCN-ValueNR,
ARFCN-ValueEUTRA,
@@ -14299,6 +14299,6 @@ maxCellPrep INTEGER ::= 32 -- Maximum number of cells prepared
-- TAG-NR-MULTIPLICITY-AND-CONSTRAINTS-STOP
-- TAG-NR-INTER-NODE-DEFINITIONS-END-START
END
END
-- TAG-NR-INTER-NODE-DEFINITIONS-END-STOP

View File

@@ -476,9 +476,10 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
if (do_srs) {
srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_periodic;
srs_res0->resourceType.choice.periodic = calloc(1,sizeof(*srs_res0->resourceType.choice.periodic));
srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160;
srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl160 = 17 + (uid>1)*10; // 17/17/.../147/157 are mixed slots
} else {
//srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160;
srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl20;
srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl20 = 17 + (uid>1)*10; // 17/17/.../147/157 are mixed slots
} else {
srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_aperiodic;
srs_res0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic));
}
@@ -591,7 +592,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
*pusch_timedomainresourceallocation->k2 = k2;
pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13);
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation);
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation);
if(frame_type==TDD) {
if(scc->tdd_UL_DL_ConfigurationCommon) {

View File

@@ -364,7 +364,7 @@ static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt,
}
} /* for */
if (found==0)
prnt("Channel %s not found or not currently used\n",modelname);
prnt("Channel %s not found or not currently used\n",modelname);
}
} else {
prnt("ERROR: 2 parameters required: model name and model type (%i found)\n",s);
@@ -658,7 +658,8 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
AssertFatal( (conn_sock = accept(t->listen_sock,NULL,NULL)) != -1, "");
setblocking(conn_sock, notBlocking);
allocCirBuf(t, conn_sock);
LOG_I(HW,"A client connected, sending the current time\n");
openair0_timestamp ts = t->lastWroteTS > 1 ? t->lastWroteTS-1 : 0;
LOG_I(HW,"A client connected, sending the current time %lu\n",ts);
c16_t v= {0};
void *samplesVoid[t->tx_num_channels];
@@ -868,7 +869,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
CirSize);
}
else { // no channel modeling
double H_awgn_mimo[4][4] ={{1.0, 0.2, 0.1, 0.05}, //rx 0
{0.2, 1.0, 0.2, 0.1}, //rx 1
{0.1, 0.2, 1.0, 0.2}, //rx 2
@@ -934,7 +935,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
rfsimulator->tx_num_channels=openair0_cfg->tx_num_channels;
rfsimulator->rx_num_channels=openair0_cfg->rx_num_channels;
rfsimulator->sample_rate=openair0_cfg->sample_rate;
rfsimulator->tx_bw=openair0_cfg->tx_bw;
rfsimulator->tx_bw=openair0_cfg->tx_bw;
rfsimulator_readconfig(rfsimulator);
LOG_W(HW, "rfsim: sample_rate %f\n", rfsimulator->sample_rate);
pthread_mutex_init(&Sockmutex, NULL);

1
targets/bin/libcoding.so Symbolic link
View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/cmake_targets/ran_build/build/libcoding.so

View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/cmake_targets/ran_build/build/liboai_eth_transpro.so

View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/targets/bin/liboai_eth_transpro.so.Rel15

View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/cmake_targets/ran_build/build/libparams_libconfig.so

View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/cmake_targets/ran_build/build/librfsimulator.so

View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem

View File

@@ -0,0 +1 @@
/home/bugatti/Geo_5g_srs_mqtt/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem