diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 9d25cd546d1ec4f12545e9dd545677269e12fb44..72761862c3c1cb22c9d9fc969add79cd7a19e391 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2745,7 +2745,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr add_executable(${myExe} ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c ${OPENAIR_DIR}/common/utils/backtrace.c - ${OPENAIR_DIR}/common/utils/system.c + ${OPENAIR_DIR}/common/utils/system.c ${XFORMS_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 442f40662c9ec281294cbce48efd7d683dca3af1..dbd97ca7482e34534bec1a076a756029fb9b266b 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -87,11 +87,15 @@ unsigned short config_frames[4] = {2,9,11,13}; #endif -/* these variables have to be defined before including ENB_APP/enb_paramdef.h */ +/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */ static int DEFBANDS[] = {7}; static int DEFENBS[] = {0}; +static int DEFNRBANDS[] = {7}; +static int DEFGNBS[] = {0}; + #include "ENB_APP/enb_paramdef.h" +#include "GNB_APP/gnb_paramdef.h" #include "common/config/config_userapi.h" #ifndef OPENAIR2 @@ -1660,7 +1664,7 @@ void init_RU_proc(RU_t *ru) { if (opp_enabled == 1) threadCreate(&ru->ru_stats_thread,ru_stats_thread,(void *)ru, "emulateRF", -1, OAI_PRIORITY_RT_LOW); } -void kill_RU_proc(int inst) { +void kill_NR_RU_proc(int inst) { RU_t *ru = RC.ru[inst]; RU_proc_t *proc = &ru->proc; pthread_mutex_lock(&proc->mutex_FH); @@ -2136,7 +2140,7 @@ void init_RU(char *rf_config_file) { void stop_RU(int nb_ru) { for (int inst = 0; inst < nb_ru; inst++) { LOG_I(PHY, "Stopping RU %d processing threads\n", inst); - kill_RU_proc(inst); + kill_NR_RU_proc(inst); } } @@ -2144,11 +2148,10 @@ void stop_RU(int nb_ru) { /* --------------------------------------------------------*/ /* from here function to use configuration module */ void RCconfig_RU(void) { - int j = 0; - int i = 0; + int i = 0, j = 0; paramdef_t RUParams[] = GNBRUPARAMS_DESC; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; - config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL); + config_getlist( &RUParamList, RUParams, sizeof(RUParams)/sizeof(paramdef_t), NULL); if ( RUParamList.numelt > 0) { RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *)); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index affa349aba17c670798a4359d8ca0e757f6888d1..ddbc6fb0ff257c2883fca9517c1dae900e02640b 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -48,12 +48,12 @@ #include "PHY/phy_vars.h" #include "SCHED/sched_common_vars.h" #include "LAYER2/MAC/mac_vars.h" - #include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" #include "gnb_config.h" +#include "SIMULATION/TOOLS/sim.h" #ifdef SMBV #include "PHY/TOOLS/smbv.h" @@ -91,7 +91,7 @@ unsigned short config_frames[4] = {2,9,11,13}; // current status is that every UE has a DL scope for a SINGLE eNB (gnb_id=0) // at eNB 0, an UL scope for every UE - FD_phy_scope_gnb *form_gnb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; + FD_phy_scope_gnb *form_gnb[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; FD_stats_form *form_stats=NULL,*form_stats_l2=NULL; char title[255]; unsigned char scope_enb_num_ue = 2; @@ -144,11 +144,11 @@ FILE *input_fd=NULL; #if MAX_NUM_CCs == 1 -rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; +rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}}; double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0}}; double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0}}; #else -rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain},{max_gain,max_gain,max_gain,max_gain}}; +rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain},{max_gain,max_gain,max_gain,max_gain}}; double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0},{20,0,0,0}}; double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}}; #endif @@ -574,8 +574,8 @@ static void get_options(void) { uint32_t online_log_messages; uint32_t glog_level, glog_verbosity; uint32_t start_telnetsrv; - paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; - paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; + paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC ; + paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC ; config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); if (strlen(in_path) > 0) { @@ -858,8 +858,8 @@ int stop_L1L2(module_id_t gnb_id) { terminate_task(TASK_L2L1, gnb_id); LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id); kill_gNB_proc(gnb_id); - LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", gnb_id); - kill_RU_proc(gnb_id); + LOG_I(ENB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id); + kill_NR_RU_proc(gnb_id); oai_exit = 0; for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) { diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index b01d92e6edd5ef10cb0a766a09df74a1e42fb42a..96774aa78e711adfc24c658459fcf0e23907a322 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -123,34 +123,35 @@ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters common to eNodeB and UE */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_PARAMS_DESC { \ - {"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \ - {"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ - {"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ - {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ - {"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ - {"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \ - {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ - {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ - {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ - {"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:DEFAULT_DLF, TYPE_UINT, 0}, \ - {"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ - {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ - {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ - {"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ - {"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ - {"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ - {"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \ - {"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ - {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ - {"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ - {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \ - {"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ - {"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \ - {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ - {"nbiot-disable", CONFIG_HLP_DISABLNBIOT,PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \ + {"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)}, \ + {"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ + {"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ + {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ + {"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ + {"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \ + {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ + {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ + {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ + {"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:DEFAULT_DLF, TYPE_UINT, 0}, \ + {"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ + {"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ + {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ + {"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ + {"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ + {"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ + {"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \ + {"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ + {"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \ + {"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \ + {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ + {"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \ + {"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ + {"parallel-config", CONFIG_HLP_PARALLEL_CMD, 0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \ + {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ + {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \ } #define CONFIG_HLP_FLOG "Enable online log \n" @@ -162,10 +163,10 @@ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_LOGPARAMS_DESC { \ - {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ - {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ - {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ - {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ + {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ + {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ + {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ + {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ } #define CMDLINE_ONLINELOG_IDX 0 #define CMDLINE_GLOGLEVEL_IDX 1 @@ -220,10 +221,10 @@ extern void stop_gNB(int); extern void kill_gNB_proc(int inst); // In nr-ru.c -extern void init_RU(const char *); +extern void init_RU(char *); extern void init_RU_proc(RU_t *ru); extern void stop_RU(int nb_ru); -extern void kill_RU_proc(int inst); +extern void kill_NR_RU_proc(int inst); extern void set_function_spec_param(RU_t *ru); extern void reset_opp_meas(void); diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 5beb6e3ba0e524cfa39d232110b66bfa48ce26da..3873daad5dbe8d89568f9482f789cc5ca6caef12 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -105,9 +105,9 @@ /// Context data structure for RX/TX portion of subframe processing typedef struct { /// index of the current UE RX/TX proc - int proc_id; + int proc_id; /// Component Carrier index - uint8_t CC_id; + uint8_t CC_id; /// timestamp transmitted to HW openair0_timestamp timestamp_tx; /// subframe to act upon for transmission diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 8f463b59b54de0618dfd6d6493c585cad5094645..4c69c30daeadc014df6ff3b71c42ce51553ab988 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -53,7 +53,7 @@ #else #ifdef OPENAIR2 #if ENABLE_RAL - #include "collection/hashtable/hashtable.h" + #include "common/utils/hashtable/hashtable.h" #include "COMMON/ral_messages_types.h" #include "UTIL/queue.h" #endif diff --git a/openair1/SCHED_NR/phy_procedures_nr_common.c b/openair1/SCHED_NR/phy_procedures_nr_common.c index 030a3733c201be9d2a953f86a6b17740c66f930d..dd859852fd6c56a665878772eaaa9839e7205913 100755 --- a/openair1/SCHED_NR/phy_procedures_nr_common.c +++ b/openair1/SCHED_NR/phy_procedures_nr_common.c @@ -32,7 +32,8 @@ #include "sched_nr.h" -nr_subframe_t nr_slot_select(nfapi_nr_config_request_t *cfg,unsigned char slot) +nr_subframe_t nr_slot_select(nfapi_nr_config_request_t *cfg, + unsigned char slot) { if (cfg->subframe_config.duplex_mode.value == FDD) return(SF_DL); diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 7c5a5d0146301793a7e8ca4bc8d4297e6336ff2f..9fce7327e64918d86fcdad781cc8e089523bbe2a 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -52,9 +52,9 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* p nr_frequency_range_e freq_range, uint8_t rmsi_pdcch_config, uint8_t ssb_idx, - uint8_t k_ssb, - uint16_t sfn_ssb, - uint8_t n_ssb, + uint8_t k_ssb, + uint16_t sfn_ssb, + uint8_t n_ssb, uint16_t nb_slots_per_frame, uint16_t N_RB); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 7c7eb589fe51600f2945e338ab9f42909dcd7c96..81c67c85a93f10e48dc3ac3dc606094e21ff806e 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -293,7 +293,7 @@ fill_dlsch_config(nfapi_dl_config_request_body_t *dl_req, uint8_t transmission_scheme, uint8_t number_of_layers, uint8_t number_of_subbands, - // uint8_t codebook_index, + //uint8_t codebook_index, uint8_t ue_category_capacity, uint8_t pa, uint8_t delta_power_offset_index, @@ -628,7 +628,7 @@ int main(int argc, char **argv) { snr0 = 0; // num_layers = 1; perfect_ce = 0; - static paramdef_t options[] = { + /*static paramdef_t options[] = { { "awgn", "Use AWGN channel and not multipath", PARAMFLAG_BOOL, strptr:NULL, defintval:0, TYPE_INT, 0, NULL, NULL }, { "Abstx", "Turns on calibration mode for abstraction.", PARAMFLAG_BOOL, iptr:&abstx, defintval:0, TYPE_INT, 0 }, { "bTDD", "Set the tdd configuration mode",0, iptr:&tdd_config, defintval:3, TYPE_INT, 0 }, @@ -891,7 +891,371 @@ int main(int argc, char **argv) { exit(0); if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD) - set_worker_conf("WORKER_ENABLE"); + set_worker_conf("WORKER_ENABLE");*/ + + + + int c; + while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:q:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:Pl:WXYL:")) != -1) { + switch (c) { + case 'a': + awgn_flag = 1; + channel_model = AWGN; + break; + + case 'A': + abstx = 1; + break; + + case 'b': + tdd_config=atoi(optarg); + break; + + case 'B': + N_RB_DL=atoi(optarg); + break; + + case 'c': + num_pdcch_symbols=atoi(optarg); + break; + + case 'C': + Nid_cell = atoi(optarg); + break; + + case 'd': + dci_flag = 1; + break; + + case 'D': + frame_type=TDD; + break; + + case 'e': + num_rounds=1; + common_flag = 1; + TPC = atoi(optarg); + break; + + case 'E': + threequarter_fs=1; + break; + + case 'f': + input_snr_step= atof(optarg); + break; + + case 'F': + forgetting_factor = atof(optarg); + break; + + case 'i': + input_fd = fopen(optarg,"r"); + input_file=1; + dci_flag = 1; + break; + + case 'I': + input_trch_fd = fopen(optarg,"r"); + input_trch_file=1; + break; + + case 'W': + two_thread_flag = 1; + break; + case 'l': + offset_mumimo_llr_drange_fix=atoi(optarg); + break; + + case 'm': + mcs1 = atoi(optarg); + break; + + case 'M': + mcs2 = atoi(optarg); + break; + + case 'O': + test_perf=atoi(optarg); + //print_perf =1; + break; + + case 't': + mcs_i = atoi(optarg); + i_mod = get_Qm(mcs_i); + break; + + case 'n': + n_frames = atoi(optarg); + break; + + + case 'o': + rx_sample_offset = atoi(optarg); + break; + + case 'r': + DLSCH_RB_ALLOC = atoi(optarg); + rballocset = 1; + break; + + case 's': + snr0 = atof(optarg); + break; + + case 'w': + snr_int = atof(optarg); + break; + + + case 'N': + n_ch_rlz= atof(optarg); + break; + + case 'p': + extended_prefix_flag=1; + break; + + case 'g': + memcpy(channel_model_input,optarg,10); + + switch((char)*optarg) { + case 'A': + channel_model=SCM_A; + break; + + case 'B': + channel_model=SCM_B; + break; + + case 'C': + channel_model=SCM_C; + break; + + case 'D': + channel_model=SCM_D; + break; + + case 'E': + channel_model=EPA; + break; + + case 'F': + channel_model=EVA; + break; + + case 'G': + channel_model=ETU; + break; + + case 'H': + channel_model=Rayleigh8; + break; + + case 'I': + channel_model=Rayleigh1; + break; + + case 'J': + channel_model=Rayleigh1_corr; + break; + + case 'K': + channel_model=Rayleigh1_anticorr; + break; + + case 'L': + channel_model=Rice8; + break; + + case 'M': + channel_model=Rice1; + break; + + case 'N': + channel_model=AWGN; + break; + default: + printf("Unsupported channel model!\n"); + exit(-1); + } + + break; + case 'R': + num_rounds=atoi(optarg); + break; + + case 'S': + subframe=atoi(optarg); + break; + + case 'T': + n_rnti=atoi(optarg); + break; + + case 'u': + dual_stream_UE=1; + UE->use_ia_receiver = 1; + + if ((n_tx_port!=2) || (transmission_mode!=5)) { + printf("IA receiver only supported for TM5!"); + exit(-1); + } + + break; + + case 'v': + i_mod = atoi(optarg); + + if (i_mod!=2 && i_mod!=4 && i_mod!=6) { + printf("Wrong i_mod %d, should be 2,4 or 6\n",i_mod); + exit(-1); + } + + break; + + case 'P': + print_perf=1; + break; + + case 'q': + n_tx_port=atoi(optarg); + + if ((n_tx_port==0) || ((n_tx_port>2))) { + printf("Unsupported number of cell specific antennas ports %d\n",n_tx_port); + exit(-1); + } + + break; + + + case 'x': + transmission_mode=atoi(optarg); + + if ((transmission_mode!=1) && + (transmission_mode!=2) && + (transmission_mode!=3) && + (transmission_mode!=4) && + (transmission_mode!=5) && + (transmission_mode!=6) && + (transmission_mode!=7)) { + printf("Unsupported transmission mode %d\n",transmission_mode); + exit(-1); + } + + if (transmission_mode>1 && transmission_mode<7) { + n_tx_port = 2; + } + + break; + + case 'y': + n_tx_phy=atoi(optarg); + + if (n_tx_phy < n_tx_port) { + printf("n_tx_phy mush not be smaller than n_tx_port"); + exit(-1); + } + + if ((transmission_mode>1 && transmission_mode<7) && n_tx_port<2) { + printf("n_tx_port must be >1 for transmission_mode %d\n",transmission_mode); + exit(-1); + } + + if (transmission_mode==7 && (n_tx_phy!=1 && n_tx_phy!=2 && n_tx_phy!=4 && n_tx_phy!=8 && n_tx_phy!=16 && n_tx_phy!=64 && n_tx_phy!=128)) { + printf("Physical number of antennas not supported for TM7.\n"); + exit(-1); + } + + break; + break; + + case 'X': + xforms=1; + break; + + case 'Y': + perfect_ce=1; + break; + + case 'z': + n_rx=atoi(optarg); + + if ((n_rx==0) || (n_rx>2)) { + printf("Unsupported number of rx antennas %d\n",n_rx); + exit(-1); + } + + break; + + case 'Z': + dump_table=1; + break; + + case 'L': + loglvl = atoi(optarg); + break; + + case 'h': + default: + printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,5,6,7) -y TXant -z RXant -I trch_file\n",argv[0]); + printf("-h This message\n"); + printf("-a Use AWGN channel and not multipath\n"); + printf("-c Number of PDCCH symbols\n"); + printf("-m MCS1 for TB 1\n"); + printf("-M MCS2 for TB 2\n"); + printf("-d Transmit the DCI and compute its error statistics\n"); + printf("-p Use extended prefix mode\n"); + printf("-n Number of frames to simulate\n"); + printf("-o Sample offset for receiver\n"); + printf("-s Starting SNR, runs from SNR to SNR+%.1fdB in steps of %.1fdB. If n_frames is 1 then just SNR is simulated and MATLAB/OCTAVE output is generated\n", snr_int, snr_step); + printf("-f step size of SNR, default value is 1.\n"); + printf("-C cell id\n"); + printf("-S subframe\n"); + printf("-D use TDD mode\n"); + printf("-b TDD config\n"); + printf("-B bandwidth configuration (in number of ressource blocks): 6, 25, 50, 100\n"); + printf("-r ressource block allocation (see section 7.1.6.3 in 36.213\n"); + printf("-g [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M')\n"); + printf("-F forgetting factor (0 new channel every trial, 1 channel constant\n"); + printf("-x Transmission mode (1,2,6,7 for the moment)\n"); + printf("-q Number of TX antennas ports used in eNB\n"); + printf("-y Number of TX antennas used in eNB\n"); + printf("-z Number of RX antennas used in UE\n"); + printf("-t MCS of interfering UE\n"); + printf("-R Number of HARQ rounds (fixed)\n"); + printf("-A Turns on calibration mode for abstraction.\n"); + printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n"); + printf("-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n"); + printf("-I Input filename for TrCH data (binary)\n"); + printf("-u Enables the Interference Aware Receiver for TM5 (default is normal receiver)\n"); + exit(1); + break; + } + } + set_parallel_conf("PARALLEL_RU_L1_TRX_SPLIT"); + set_worker_conf("WORKER_ENABLE"); + + + + + + + + + + + + + + + + + + + + + if (transmission_mode>1) pa=dBm3; @@ -1481,7 +1845,7 @@ int main(int argc, char **argv) { } start_meas(&eNB->ofdm_mod_stats); - ru->proc.subframe_tx=subframe; + ru->proc.tti_tx=subframe; memcpy((void *)&ru->frame_parms,(void *)&eNB->frame_parms,sizeof(LTE_DL_FRAME_PARMS)); feptx_prec(ru); feptx_ofdm(ru); @@ -1494,7 +1858,7 @@ int main(int argc, char **argv) { sched_resp.subframe=subframe+1; schedule_response(&sched_resp); phy_procedures_eNB_TX(eNB,proc_eNB,0); - ru->proc.subframe_tx=(subframe+1)%10; + ru->proc.tti_tx=(subframe+1)%10; feptx_prec(ru); feptx_ofdm(ru); proc_eNB->frame_tx++; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index a4235d1e5b75156767d460e9b7b7b1821163c605..f2c35800757c67db3a7142dfd94dc7697e0fb2a2 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -52,7 +52,7 @@ //#include "UTIL/LISTS/list.h" //#include "common/ran_context.h" -//#define DEBUG_DLSCHSIM +//#define DEBUG_NR_DLSCHSIM PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; @@ -93,8 +93,8 @@ NR_IF_Module_init(int Mod_id) { return (NULL); } -void exit_function(const char *file, const char *function, const int line, - const char *s) { +void exit_function(const char *file, const char *function, const int line, const char *s) +{ const char *msg = s == NULL ? "no comment" : s; printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg); exit(-1); @@ -224,7 +224,7 @@ int main(int argc, char **argv) { break; default: - msg("Unsupported channel model!\n"); + printf("Unsupported channel model! Exiting.\n"); exit(-1); } @@ -244,13 +244,18 @@ int main(int argc, char **argv) { case 's': snr0 = atof(optarg); - msg("Setting SNR0 to %f\n", snr0); +#ifdef DEBUG_NR_DLSCHSIM + printf("Setting SNR0 to %f\n", snr0); +#endif break; case 'S': snr1 = atof(optarg); snr1set = 1; msg("Setting SNR1 to %f\n", snr1); +#ifdef DEBUG_NR_DLSCHSIM + printf("Setting SNR1 to %f\n", snr1); +#endif break; case 'p': @@ -271,7 +276,7 @@ int main(int argc, char **argv) { n_tx = atoi(optarg); if ((n_tx == 0) || (n_tx > 2)) { - msg("Unsupported number of tx antennas %d\n", n_tx); + printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); exit(-1); } @@ -281,7 +286,7 @@ int main(int argc, char **argv) { n_rx = atoi(optarg); if ((n_rx == 0) || (n_rx > 2)) { - msg("Unsupported number of rx antennas %d\n", n_rx); + printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); exit(-1); } @@ -303,7 +308,7 @@ int main(int argc, char **argv) { input_fd = fopen(optarg, "r"); if (input_fd == NULL) { - printf("Problem with filename %s\n", optarg); + printf("Problem with filename %s. Exiting.\n", optarg); exit(-1); } @@ -379,7 +384,7 @@ int main(int argc, char **argv) { 0, 0, 0); if (gNB2UE == NULL) { - msg("Problem generating channel model. Exiting.\n"); + printf("Problem generating channel model. Exiting.\n"); exit(-1); } @@ -518,7 +523,7 @@ int main(int argc, char **argv) { //estimated_output = harq_process->b; -#ifdef DEBUG_DLSCHSIM +#ifdef DEBUG_NR_DLSCHSIM for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]); #endif diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 4fb9ccfa8bffeaa0db3e1e99178c4fac3a2cac7c..e536c98e70453e736c749526bf94b02b976003f6 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -47,7 +47,7 @@ #include "SCHED_NR/sched_nr.h" - +//#define DEBUG_NR_PBCHSIM PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; @@ -199,7 +199,7 @@ int main(int argc, char **argv) break; default: - msg("Unsupported channel model!\n"); + printf("Unsupported channel model! Exiting.\n"); exit(-1); } @@ -219,18 +219,24 @@ int main(int argc, char **argv) case 'o': cfo = atof(optarg); - msg("Setting CFO to %f Hz\n",cfo); +#ifdef DEBUG_NR_PBCHSIM + printf("Setting CFO to %f Hz\n",cfo); +#endif break; case 's': snr0 = atof(optarg); - msg("Setting SNR0 to %f\n",snr0); +#ifdef DEBUG_NR_PBCHSIM + printf("Setting SNR0 to %f\n",snr0); +#endif break; case 'S': snr1 = atof(optarg); snr1set=1; - msg("Setting SNR1 to %f\n",snr1); +#ifdef DEBUG_NR_PBCHSIM + printf("Setting SNR1 to %f\n",snr1); +#endif break; /* @@ -254,10 +260,8 @@ int main(int argc, char **argv) case 'x': transmission_mode=atoi(optarg); - if ((transmission_mode!=1) && - (transmission_mode!=2) && - (transmission_mode!=6)) { - msg("Unsupported transmission mode %d\n",transmission_mode); + if ((transmission_mode!=1) && (transmission_mode!=2) && (transmission_mode!=6)) { + printf("Unsupported transmission mode %d. Exiting.\n",transmission_mode); exit(-1); } @@ -267,7 +271,7 @@ int main(int argc, char **argv) n_tx=atoi(optarg); if ((n_tx==0) || (n_tx>2)) { - msg("Unsupported number of tx antennas %d\n",n_tx); + printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); exit(-1); } @@ -277,7 +281,7 @@ int main(int argc, char **argv) n_rx=atoi(optarg); if ((n_rx==0) || (n_rx>2)) { - msg("Unsupported number of rx antennas %d\n",n_rx); + printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); exit(-1); } @@ -299,7 +303,7 @@ int main(int argc, char **argv) input_fd = fopen(optarg,"r"); if (input_fd==NULL) { - printf("Problem with filename %s\n",optarg); + printf("Problem with filename %s. Exiting.\n", optarg); exit(-1); } @@ -431,7 +435,7 @@ int main(int argc, char **argv) 0); if (gNB2UE==NULL) { - msg("Problem generating channel model. Exiting.\n"); + printf("Problem generating channel model. Exiting.\n"); exit(-1); } @@ -492,33 +496,32 @@ int main(int argc, char **argv) for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1; for (int slot=0;slot<frame_parms->slots_per_frame;slot++) { - for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) - memset(gNB->common_vars.txdataF[aa],0,frame_parms->samples_per_slot_wCP*sizeof(int32_t)); + for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) + memset(gNB->common_vars.txdataF[aa],0,frame_parms->samples_per_slot_wCP*sizeof(int32_t)); - nr_common_signal_procedures (gNB,frame,slot); + nr_common_signal_procedures (gNB,frame,slot); - for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) { - if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) { - PHY_ofdm_mod(gNB->common_vars.txdataF[aa], - &txdata[aa][slot*frame_parms->samples_per_slot], - frame_parms->ofdm_symbol_size, - 12, - frame_parms->nb_prefix_samples, - CYCLIC_PREFIX); - } else { - nr_normal_prefix_mod(gNB->common_vars.txdataF[aa], - &txdata[aa][slot*frame_parms->samples_per_slot], - 14, - frame_parms); - } - } + for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) { + if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) { + PHY_ofdm_mod(gNB->common_vars.txdataF[aa], + &txdata[aa][slot*frame_parms->samples_per_slot], + frame_parms->ofdm_symbol_size, + 12, + frame_parms->nb_prefix_samples, + CYCLIC_PREFIX); + } else { + nr_normal_prefix_mod(gNB->common_vars.txdataF[aa], + &txdata[aa][slot*frame_parms->samples_per_slot], + 14, + frame_parms); + } + } } LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1); if (gNB->frame_parms.nb_antennas_tx>1) LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1); - } else { printf("Reading %d samples from file to antenna buffer %d\n",frame_length_complex_samples,0); UE->UE_fo_compensation = 1; // perform fo compensation when samples from file are used diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index d6f950097e0fd51ca901c54514db705ae1e1edb2..502bc8eeb6eeb9d17bf47bd0bab3d713a8f48cef 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -54,7 +54,7 @@ //#include "UTIL/LISTS/list.h" //#include "common/ran_context.h" -//#define DEBUG_ULSCHSIM +//#define DEBUG_NR_ULSCHSIM PHY_VARS_gNB *gNB; PHY_VARS_NR_UE *UE; @@ -64,36 +64,14 @@ double cpuf; // dummy functions int nfapi_mode = 0; -int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { - return (0); -} -int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { - return (0); -} - -int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { - return (0); -} - -int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { - return (0); -} - -int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { - return (0); -} - -uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { - return (0); -} -int32_t get_uldl_offset(int eutra_bandP) { - return (0); -} - -NR_IF_Module_t * -NR_IF_Module_init(int Mod_id) { - return (NULL); -} +int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return (0); } +int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return (0); } +int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return (0); } +int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return (0); } +int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return (0); } +uint32_t from_nrarfcn(int nr_bandP, uint32_t dl_earfcn) { return (0); } +int32_t get_uldl_offset(int eutra_bandP) { return (0); } +NR_IF_Module_t * NR_IF_Module_init(int Mod_id) { return (NULL); } void exit_function(const char *file, const char *function, const int line, const char *s) { const char *msg = s == NULL ? "no comment" : s; @@ -150,7 +128,7 @@ int main(int argc, char **argv) { SCM_t channel_model = AWGN; //Rayleigh1_anticorr; uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1; //unsigned char frame_type = 0; - unsigned char pbch_phase = 0; + //unsigned char pbch_phase = 0; int frame = 0, subframe = 0; int frame_length_complex_samples; //int frame_length_complex_samples_no_prefix; @@ -178,7 +156,8 @@ int main(int argc, char **argv) { //logInit(); randominit(0); - while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) { + //while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) { + while ((c = getopt(argc, argv, "hg:n:s:S:py:z:M:N:R:F:m:l:r:")) != -1) { switch (c) { /*case 'f': write_output_file = 1; @@ -226,7 +205,7 @@ int main(int argc, char **argv) { break; default: - msg("Unsupported channel model!\n"); + printf("Unsupported channel model! Exiting.\n"); exit(-1); } @@ -242,17 +221,24 @@ int main(int argc, char **argv) { case 'n': n_trials = atoi(optarg); +#ifdef DEBUG_NR_ULSCHSIM + printf("n_trials (-n) = %d\n", n_trials); +#endif break; case 's': snr0 = atof(optarg); - msg("Setting SNR0 to %f\n", snr0); +#ifdef DEBUG_NR_ULSCHSIM + printf("Setting SNR0 to %f\n", snr0); +#endif break; case 'S': snr1 = atof(optarg); snr1set = 1; - msg("Setting SNR1 to %f\n", snr1); +#ifdef DEBUG_NR_ULSCHSIM + printf("Setting SNR1 to %f\n", snr1); +#endif break; case 'p': @@ -273,7 +259,7 @@ int main(int argc, char **argv) { n_tx = atoi(optarg); if ((n_tx == 0) || (n_tx > 2)) { - msg("Unsupported number of tx antennas %d\n", n_tx); + printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); exit(-1); } @@ -283,7 +269,7 @@ int main(int argc, char **argv) { n_rx = atoi(optarg); if ((n_rx == 0) || (n_rx > 2)) { - msg("Unsupported number of rx antennas %d\n", n_rx); + printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); exit(-1); } @@ -299,29 +285,32 @@ int main(int argc, char **argv) { case 'R': N_RB_DL = atoi(optarg); - N_RB_UL = N_RB_DL; +#ifdef DEBUG_NR_ULSCHSIM + printf("N_RB_DL (-R) = %d\n", N_RB_DL); +#endif break; case 'F': input_fd = fopen(optarg, "r"); if (input_fd == NULL) { - printf("Problem with filename %s\n", optarg); + printf("Problem with filename %s. Exiting.\n", optarg); exit(-1); } break; - case 'P': + /*case 'P': pbch_phase = atoi(optarg); - if (pbch_phase > 3) printf("Illegal PBCH phase (0-3) got %d\n", pbch_phase); - - break; + break;*/ case 'm': Imcs = atoi(optarg); +#ifdef DEBUG_NR_ULSCHSIM + printf("Imcs (-m) = %d\n", Imcs); +#endif break; case 'l': @@ -338,15 +327,16 @@ int main(int argc, char **argv) { default: case 'h': - printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]); + printf("%s -h(elp) -g channel_model -n n_frames -s snr0 -S snr1 -p(extended_prefix) -y TXant -z RXant -M -N cell_id -R -F input_filename -m -l -r\n", argv[0]); + //printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]); printf("-h This message\n"); - printf("-p Use extended prefix mode\n"); - //printf("-d Use TDD\n"); + printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n"); printf("-n Number of frames to simulate\n"); + //printf("-d Use TDD\n"); printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n"); printf("-S Ending SNR, runs from SNR0 to SNR1\n"); - printf("-t Delay spread for multipath channel\n"); - printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n"); + printf("-p Use extended prefix mode\n"); + //printf("-t Delay spread for multipath channel\n"); //printf("-x Transmission mode (1,2,6 for the moment)\n"); printf("-y Number of TX antennas used in eNB\n"); printf("-z Number of RX antennas used in UE\n"); @@ -355,11 +345,14 @@ int main(int argc, char **argv) { printf("-M Multiple SSB positions in burst\n"); printf("-N Nid_cell\n"); printf("-R N_RB_DL\n"); - printf("-O oversampling factor (1,2,4,8,16)\n"); - printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); + printf("-F Input filename (.txt format) for RX conformance testing\n"); + printf("-m\n"); + printf("-l\n"); + printf("-r\n"); + //printf("-O oversampling factor (1,2,4,8,16)\n"); + //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); //printf("-f Output filename (.txt format) for Pe/SNR results\n"); - printf("-F Input filename (.txt format) for RX conformance testing\n"); exit(-1); break; } @@ -372,13 +365,17 @@ int main(int argc, char **argv) { if (snr1set == 0) snr1 = snr0 + 10; - gNB2UE = new_channel_desc_scm(n_tx, n_rx, channel_model, + gNB2UE = new_channel_desc_scm(n_tx, + n_rx, + channel_model, 61.44e6, //N_RB2sampling_rate(N_RB_DL), 40e6, //N_RB2channel_bandwidth(N_RB_DL), - 0, 0, 0); + 0, + 0, + 0); if (gNB2UE == NULL) { - msg("Problem generating channel model. Exiting.\n"); + printf("Problem generating channel model. Exiting.\n"); exit(-1); } @@ -446,7 +443,7 @@ int main(int argc, char **argv) { //phy_init_nr_top(frame_parms); if (init_nr_ue_signal(UE, 1, 0) != 0) { - printf("Error at UE NR initialisation\n"); + printf("Error at UE NR initialisation.\n"); exit(-1); } @@ -458,7 +455,7 @@ int main(int argc, char **argv) { UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); if (!UE->ulsch[sf][0][i]) { - printf("Can't get ue ulsch structures\n"); + printf("Can't get ue ulsch structures.\n"); exit(-1); } @@ -540,7 +537,7 @@ int main(int argc, char **argv) { /////////// //////////////////////////////////////////////////////////////////////////////////////////// -#ifdef DEBUG_ULSCHSIM +#ifdef DEBUG_NR_ULSCHSIM for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]); #endif diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index 1cfc096a33b953a2047ae15533e984df8c464a4f..1d5c43232e94428fb13f151aeac8dc36c7ca5d05 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -231,7 +231,7 @@ typedef struct { channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, uint8_t nb_rx, SCM_t channel_model, - double sampling_rate, + double sampling_rate, double channel_bandwidth, double forgetting_factor, int32_t channel_offset, diff --git a/openair1/SIMULATION/TOOLS/taus.c b/openair1/SIMULATION/TOOLS/taus.c index e2409df5339f648c8deb9f1953c7367cc205b428..5fe0ce4d7887a36b6888629a3c97d985988803cc 100644 --- a/openair1/SIMULATION/TOOLS/taus.c +++ b/openair1/SIMULATION/TOOLS/taus.c @@ -21,6 +21,7 @@ #include <time.h> #include <stdlib.h> +#include "SIMULATION/TOOLS/sim.h" unsigned int s0, s1, s2, b; @@ -32,7 +33,6 @@ unsigned int s0, s1, s2, b; unsigned int taus(void) { - b = (((s0 << 13) ^ s0) >> 19); s0 = (((s0 & 0xFFFFFFFE) << 12)^ b); b = (((s1 << 2) ^ s1) >> 25); @@ -41,7 +41,7 @@ unsigned int taus(void) s2 = (((s2 & 0xFFFFFFF0) << 17)^ b); return s0 ^ s1 ^ s2; } -#if 1 + void set_taus_seed(unsigned int seed_init) { @@ -63,25 +63,18 @@ void set_taus_seed(unsigned int seed_init) s2 = result; } } -#endif #ifdef MAIN main() { - unsigned int i,rand; set_taus_seed(); for (i=0; i<10; i++) { - rand = taus(); printf("%u\n",rand); - } } #endif //MAIN - - - diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 7998f455dd403da3369029724ac8ebccac4bb1f3..effe8cc56a0357b3694b8a2ad0de42c97a682f7a 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -119,31 +119,31 @@ typedef enum { /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-----------------------------------------------------------------------------------------------------------------------------------------*/ #define RUPARAMS_DESC { \ -{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ -{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ -{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY, 1}, \ -{CONFIG_STRING_RU_ENB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ -{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ -{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_ENB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index f0e209e5aa19fe2595c851dd62ba88a790f920d2..ed931b575dd43837a06f4bb8342c48974cfc5abc 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -117,27 +117,27 @@ typedef enum { /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-----------------------------------------------------------------------------------------------------------------------------------------*/ #define GNBRUPARAMS_DESC { \ -{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ -{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ -{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY, 1}, \ -{CONFIG_STRING_RU_GNB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFGNBS, TYPE_INTARRAY, 1}, \ -{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFGNBS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \ +{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFNRBANDS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_GNB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFGNBS, TYPE_INTARRAY, 1}, \ +{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFGNBS, TYPE_INTARRAY, 1}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c index 6dd3846d886277979019a131f2758aeab4d8e217..0bf3d86bae4f0db6549207de73e9c65a812e0e34 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c @@ -53,6 +53,7 @@ #include "liblfds611.h" #include "common/utils/LOG/log.h" +#include "common/utils/system.h" #include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG_extern.h" #include "LAYER2/MAC/mac_extern.h" @@ -140,7 +141,7 @@ pdcp_netlink_init( * When the netlink fifo is full, packets are silently dropped, this behaviour * should be avoided if we want a reliable link. */ - threadCreate(&pdcp_netlink_thread, pdcp_netlink_thread_fct, "PDCP netlink", -1, OAI_PRIORITY_RT_LOW ); + threadCreate(&pdcp_netlink_thread, pdcp_netlink_thread_fct, (void*)NULL, "PDCP netlink", -1, OAI_PRIORITY_RT_LOW ); } return 0; diff --git a/openair2/UTIL/MATH/taus.c b/openair2/UTIL/MATH/taus.c index 6f1b2214e51b92ec07cbc21d9699664077f40633..6b5e03588dd2fc7cdb51edb49b659cef2969bea1 100644 --- a/openair2/UTIL/MATH/taus.c +++ b/openair2/UTIL/MATH/taus.c @@ -52,7 +52,7 @@ inline unsigned int taus(unsigned int comp) { return r[comp]; } -void set_taus_seed(unsigned int seed_type) { +/*void set_taus_seed(unsigned int seed_type) { unsigned int i; // i index of component for (i=MIN_NUM_COMPS; i < MAX_NUM_COMPS ; i ++) { @@ -79,7 +79,7 @@ void set_taus_seed(unsigned int seed_type) { break; } } -} +}*/ int get_rand (unsigned int comp) { if ((comp > MIN_NUM_COMPS) && (comp < MAX_NUM_COMPS)) diff --git a/openair2/UTIL/OPT/opt.h b/openair2/UTIL/OPT/opt.h index c1af973e4a8d971bcb2deedad88f5b8e79be34ad..5bd08a38985d2d4979ea8fbbfc78767f4413a4d1 100644 --- a/openair2/UTIL/OPT/opt.h +++ b/openair2/UTIL/OPT/opt.h @@ -105,15 +105,24 @@ typedef enum radio_type_e { RADIO_TYPE_MAX } radio_type_t; - +extern trace_mode_t opt_type; +extern char in_ip[40]; +extern char in_path[FILENAME_MAX]; /** * function def */ -void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, - int ueid, int rntiType, int rnti, uint16_t sysFrame, uint8_t subframe, - int oob_event, int oob_event_value); +void trace_pdu(int direction, + uint8_t *pdu_buffer, + unsigned int pdu_buffer_size, + int ueid, + int rntiType, + int rnti, + uint16_t sysFrame, + uint8_t subframe, + int oob_event, + int oob_event_value); int init_opt(void); diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index 0058d25b122286d7d207d2be354dd3288441ad15..a3675be2797f90af0a94d0b8e5fa00e89a1ee780 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -99,8 +99,8 @@ int opt_enabled=0; //static unsigned char g_PDUBuffer[1600]; //static unsigned int g_PDUOffset; -static char *in_ip; -static char *in_path; +char in_ip[40]; +char in_path[FILENAME_MAX]; FILE *file_fd = NULL; pcap_hdr_t file_header = { 0xa1b2c3d4, /* magic number */ @@ -439,9 +439,8 @@ int init_opt(void) { paramdef_t opt_params[] = OPT_PARAMS_DESC ; checkedparam_t opt_checkParams[] = OPTPARAMS_CHECK_DESC; uint16_t in_port; - config_set_checkfunctions(opt_params, opt_checkParams, - sizeof(opt_params)/sizeof(paramdef_t)); - config_get( opt_params,sizeof(opt_params)/sizeof(paramdef_t),OPT_CONFIGPREFIX); + config_set_checkfunctions(opt_params, opt_checkParams, sizeof(opt_params)/sizeof(paramdef_t)); + config_get(opt_params, sizeof(opt_params)/sizeof(paramdef_t), OPT_CONFIGPREFIX); subframesSinceCaptureStart = 0; int tmptype = config_get_processedint( &(opt_params[OPTTYPE_IDX])); diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c index 2cb0263234435641130b727d54fdda8c3275b31b..4aa339d0728880bd36f51e115a70f3c57da4ac13 100644 --- a/targets/RT/USER/nr-ru.c +++ b/targets/RT/USER/nr-ru.c @@ -87,11 +87,15 @@ unsigned short config_frames[4] = {2,9,11,13}; #endif -/* these variables have to be defined before including ENB_APP/enb_paramdef.h */ +/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */ static int DEFBANDS[] = {7}; static int DEFENBS[] = {0}; +static int DEFNRBANDS[] = {7}; +static int DEFGNBS[] = {0}; + #include "ENB_APP/enb_paramdef.h" +#include "GNB_APP/gnb_paramdef.h" #include "common/config/config_userapi.h" #ifndef OPENAIR2 @@ -1792,7 +1796,7 @@ void init_RU_proc(RU_t *ru) { } -void kill_RU_proc(int inst) +void kill_NR_RU_proc(int inst) { RU_t *ru = RC.ru[inst]; RU_proc_t *proc = &ru->proc; @@ -2294,7 +2298,7 @@ void stop_RU(int nb_ru) { for (int inst = 0; inst < nb_ru; inst++) { LOG_I(PHY, "Stopping RU %d processing threads\n", inst); - kill_RU_proc(inst); + kill_NR_RU_proc(inst); } } diff --git a/targets/RT/USER/nr-softmodem.c b/targets/RT/USER/nr-softmodem.c index b985803385ac1b0b45afea94ed5cceb30ebe975a..4417e2b79f694b817c665589ba8806c43e64d000 100644 --- a/targets/RT/USER/nr-softmodem.c +++ b/targets/RT/USER/nr-softmodem.c @@ -833,8 +833,8 @@ int stop_L1L2(module_id_t gnb_id) terminate_task(TASK_L2L1, gnb_id); LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id); kill_gNB_proc(gnb_id); - LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", gnb_id); - kill_RU_proc(gnb_id); + LOG_I(ENB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id); + kill_NR_RU_proc(gnb_id); oai_exit = 0; for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) { //free_transport(RC.gNB[gnb_id][cc_id]); diff --git a/targets/RT/USER/nr-softmodem.h b/targets/RT/USER/nr-softmodem.h index 5ee2880f3d6be096d1e6829f9040459ab55e2aad..876a8986a5d2b979c13b2b24537ba88f4b68530b 100644 --- a/targets/RT/USER/nr-softmodem.h +++ b/targets/RT/USER/nr-softmodem.h @@ -236,7 +236,7 @@ extern void kill_gNB_proc(int inst); extern void init_RU(const char*); extern void init_RU_proc(RU_t *ru); extern void stop_RU(int nb_ru); -extern void kill_RU_proc(int inst); +extern void kill_NR_RU_proc(int inst); extern void set_function_spec_param(RU_t *ru); extern void reset_opp_meas(void);