Commit 3c1d1bff authored by yilmazt's avatar yilmazt

Pushing changes before incorporating new merges into develop and develop-nr

parent f6a4a6b9
...@@ -87,11 +87,15 @@ ...@@ -87,11 +87,15 @@
unsigned short config_frames[4] = {2,9,11,13}; unsigned short config_frames[4] = {2,9,11,13};
#endif #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 DEFBANDS[] = {7};
static int DEFENBS[] = {0}; static int DEFENBS[] = {0};
static int DEFNRBANDS[] = {7};
static int DEFGNBS[] = {0};
#include "ENB_APP/enb_paramdef.h" #include "ENB_APP/enb_paramdef.h"
#include "GNB_APP/gnb_paramdef.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#ifndef OPENAIR2 #ifndef OPENAIR2
...@@ -1660,7 +1664,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -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); 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_t *ru = RC.ru[inst];
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
pthread_mutex_lock(&proc->mutex_FH); pthread_mutex_lock(&proc->mutex_FH);
...@@ -2136,7 +2140,7 @@ void init_RU(char *rf_config_file) { ...@@ -2136,7 +2140,7 @@ void init_RU(char *rf_config_file) {
void stop_RU(int nb_ru) { void stop_RU(int nb_ru) {
for (int inst = 0; inst < nb_ru; inst++) { for (int inst = 0; inst < nb_ru; inst++) {
LOG_I(PHY, "Stopping RU %d processing threads\n", 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) { ...@@ -2144,11 +2148,10 @@ void stop_RU(int nb_ru) {
/* --------------------------------------------------------*/ /* --------------------------------------------------------*/
/* from here function to use configuration module */ /* from here function to use configuration module */
void RCconfig_RU(void) { void RCconfig_RU(void) {
int j = 0; int i = 0, j = 0;
int i = 0;
paramdef_t RUParams[] = GNBRUPARAMS_DESC; paramdef_t RUParams[] = GNBRUPARAMS_DESC;
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; 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) { if ( RUParamList.numelt > 0) {
RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *)); RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *));
......
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
#include "PHY/phy_vars.h" #include "PHY/phy_vars.h"
#include "SCHED/sched_common_vars.h" #include "SCHED/sched_common_vars.h"
#include "LAYER2/MAC/mac_vars.h" #include "LAYER2/MAC/mac_vars.h"
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h" #include "LAYER2/MAC/mac_proto.h"
#include "RRC/LTE/rrc_vars.h" #include "RRC/LTE/rrc_vars.h"
#include "PHY_INTERFACE/phy_interface_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h"
#include "gnb_config.h" #include "gnb_config.h"
#include "SIMULATION/TOOLS/sim.h"
#ifdef SMBV #ifdef SMBV
#include "PHY/TOOLS/smbv.h" #include "PHY/TOOLS/smbv.h"
...@@ -574,8 +574,8 @@ static void get_options(void) { ...@@ -574,8 +574,8 @@ static void get_options(void) {
uint32_t online_log_messages; uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity; uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv; uint32_t start_telnetsrv;
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
if (strlen(in_path) > 0) { if (strlen(in_path) > 0) {
...@@ -858,8 +858,8 @@ int stop_L1L2(module_id_t gnb_id) { ...@@ -858,8 +858,8 @@ int stop_L1L2(module_id_t gnb_id) {
terminate_task(TASK_L2L1, gnb_id); terminate_task(TASK_L2L1, gnb_id);
LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id); LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id);
kill_gNB_proc(gnb_id); kill_gNB_proc(gnb_id);
LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", gnb_id); LOG_I(ENB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
kill_RU_proc(gnb_id); kill_NR_RU_proc(gnb_id);
oai_exit = 0; oai_exit = 0;
for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) { for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) {
......
...@@ -146,11 +146,12 @@ ...@@ -146,11 +146,12 @@
{"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)}, \ {"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}, \ {"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}, \ {"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}, \ {"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}, \ {"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 **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \ {"parallel-config", CONFIG_HLP_PARALLEL_CMD, 0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_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} \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
} }
#define CONFIG_HLP_FLOG "Enable online log \n" #define CONFIG_HLP_FLOG "Enable online log \n"
...@@ -220,10 +221,10 @@ extern void stop_gNB(int); ...@@ -220,10 +221,10 @@ extern void stop_gNB(int);
extern void kill_gNB_proc(int inst); extern void kill_gNB_proc(int inst);
// In nr-ru.c // 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 init_RU_proc(RU_t *ru);
extern void stop_RU(int nb_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 set_function_spec_param(RU_t *ru);
extern void reset_opp_meas(void); extern void reset_opp_meas(void);
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#else #else
#ifdef OPENAIR2 #ifdef OPENAIR2
#if ENABLE_RAL #if ENABLE_RAL
#include "collection/hashtable/hashtable.h" #include "common/utils/hashtable/hashtable.h"
#include "COMMON/ral_messages_types.h" #include "COMMON/ral_messages_types.h"
#include "UTIL/queue.h" #include "UTIL/queue.h"
#endif #endif
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include "sched_nr.h" #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) if (cfg->subframe_config.duplex_mode.value == FDD)
return(SF_DL); return(SF_DL);
......
...@@ -293,7 +293,7 @@ fill_dlsch_config(nfapi_dl_config_request_body_t *dl_req, ...@@ -293,7 +293,7 @@ fill_dlsch_config(nfapi_dl_config_request_body_t *dl_req,
uint8_t transmission_scheme, uint8_t transmission_scheme,
uint8_t number_of_layers, uint8_t number_of_layers,
uint8_t number_of_subbands, uint8_t number_of_subbands,
// uint8_t codebook_index, //uint8_t codebook_index,
uint8_t ue_category_capacity, uint8_t ue_category_capacity,
uint8_t pa, uint8_t pa,
uint8_t delta_power_offset_index, uint8_t delta_power_offset_index,
...@@ -628,7 +628,7 @@ int main(int argc, char **argv) { ...@@ -628,7 +628,7 @@ int main(int argc, char **argv) {
snr0 = 0; snr0 = 0;
// num_layers = 1; // num_layers = 1;
perfect_ce = 0; 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 }, { "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 }, { "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 }, { "bTDD", "Set the tdd configuration mode",0, iptr:&tdd_config, defintval:3, TYPE_INT, 0 },
...@@ -891,8 +891,372 @@ int main(int argc, char **argv) { ...@@ -891,8 +891,372 @@ int main(int argc, char **argv) {
exit(0); exit(0);
if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD) if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD)
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"); set_worker_conf("WORKER_ENABLE");
if (transmission_mode>1) pa=dBm3; if (transmission_mode>1) pa=dBm3;
printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa); printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa);
...@@ -1481,7 +1845,7 @@ int main(int argc, char **argv) { ...@@ -1481,7 +1845,7 @@ int main(int argc, char **argv) {
} }
start_meas(&eNB->ofdm_mod_stats); 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)); memcpy((void *)&ru->frame_parms,(void *)&eNB->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
feptx_prec(ru); feptx_prec(ru);
feptx_ofdm(ru); feptx_ofdm(ru);
...@@ -1494,7 +1858,7 @@ int main(int argc, char **argv) { ...@@ -1494,7 +1858,7 @@ int main(int argc, char **argv) {
sched_resp.subframe=subframe+1; sched_resp.subframe=subframe+1;
schedule_response(&sched_resp); schedule_response(&sched_resp);
phy_procedures_eNB_TX(eNB,proc_eNB,0); 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_prec(ru);
feptx_ofdm(ru); feptx_ofdm(ru);
proc_eNB->frame_tx++; proc_eNB->frame_tx++;
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
//#include "UTIL/LISTS/list.h" //#include "UTIL/LISTS/list.h"
//#include "common/ran_context.h" //#include "common/ran_context.h"
//#define DEBUG_DLSCHSIM //#define DEBUG_NR_DLSCHSIM
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
...@@ -93,8 +93,8 @@ NR_IF_Module_init(int Mod_id) { ...@@ -93,8 +93,8 @@ NR_IF_Module_init(int Mod_id) {
return (NULL); return (NULL);
} }
void exit_function(const char *file, const char *function, const int line, void exit_function(const char *file, const char *function, const int line, const char *s)
const char *s) { {
const char *msg = s == NULL ? "no comment" : s; const char *msg = s == NULL ? "no comment" : s;
printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg); printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg);
exit(-1); exit(-1);
...@@ -224,7 +224,7 @@ int main(int argc, char **argv) { ...@@ -224,7 +224,7 @@ int main(int argc, char **argv) {
break; break;
default: default:
msg("Unsupported channel model!\n"); printf("Unsupported channel model! Exiting.\n");
exit(-1); exit(-1);
} }
...@@ -244,13 +244,18 @@ int main(int argc, char **argv) { ...@@ -244,13 +244,18 @@ int main(int argc, char **argv) {
case 's': case 's':
snr0 = atof(optarg); snr0 = atof(optarg);
msg("Setting SNR0 to %f\n", snr0); #ifdef DEBUG_NR_DLSCHSIM
printf("Setting SNR0 to %f\n", snr0);
#endif
break; break;
case 'S': case 'S':
snr1 = atof(optarg); snr1 = atof(optarg);
snr1set = 1; snr1set = 1;
msg("Setting SNR1 to %f\n", snr1); msg("Setting SNR1 to %f\n", snr1);
#ifdef DEBUG_NR_DLSCHSIM
printf("Setting SNR1 to %f\n", snr1);
#endif
break; break;
case 'p': case 'p':
...@@ -271,7 +276,7 @@ int main(int argc, char **argv) { ...@@ -271,7 +276,7 @@ int main(int argc, char **argv) {
n_tx = atoi(optarg); n_tx = atoi(optarg);
if ((n_tx == 0) || (n_tx > 2)) { 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); exit(-1);
} }
...@@ -281,7 +286,7 @@ int main(int argc, char **argv) { ...@@ -281,7 +286,7 @@ int main(int argc, char **argv) {
n_rx = atoi(optarg); n_rx = atoi(optarg);
if ((n_rx == 0) || (n_rx > 2)) { 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); exit(-1);
} }
...@@ -303,7 +308,7 @@ int main(int argc, char **argv) { ...@@ -303,7 +308,7 @@ int main(int argc, char **argv) {
input_fd = fopen(optarg, "r"); input_fd = fopen(optarg, "r");
if (input_fd == NULL) { if (input_fd == NULL) {
printf("Problem with filename %s\n", optarg); printf("Problem with filename %s. Exiting.\n", optarg);
exit(-1); exit(-1);
} }
...@@ -379,7 +384,7 @@ int main(int argc, char **argv) { ...@@ -379,7 +384,7 @@ int main(int argc, char **argv) {
0, 0, 0); 0, 0, 0);
if (gNB2UE == NULL) { if (gNB2UE == NULL) {
msg("Problem generating channel model. Exiting.\n"); printf("Problem generating channel model. Exiting.\n");
exit(-1); exit(-1);
} }
...@@ -518,7 +523,7 @@ int main(int argc, char **argv) { ...@@ -518,7 +523,7 @@ int main(int argc, char **argv) {
//estimated_output = harq_process->b; //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]); for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]);
#endif #endif
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include "SCHED_NR/sched_nr.h" #include "SCHED_NR/sched_nr.h"
//#define DEBUG_NR_PBCHSIM
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
...@@ -199,7 +199,7 @@ int main(int argc, char **argv) ...@@ -199,7 +199,7 @@ int main(int argc, char **argv)
break; break;
default: default:
msg("Unsupported channel model!\n"); printf("Unsupported channel model! Exiting.\n");
exit(-1); exit(-1);
} }
...@@ -219,18 +219,24 @@ int main(int argc, char **argv) ...@@ -219,18 +219,24 @@ int main(int argc, char **argv)
case 'o': case 'o':
cfo = atof(optarg); 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; break;
case 's': case 's':
snr0 = atof(optarg); snr0 = atof(optarg);
msg("Setting SNR0 to %f\n",snr0); #ifdef DEBUG_NR_PBCHSIM
printf("Setting SNR0 to %f\n",snr0);
#endif
break; break;
case 'S': case 'S':
snr1 = atof(optarg); snr1 = atof(optarg);
snr1set=1; snr1set=1;
msg("Setting SNR1 to %f\n",snr1); #ifdef DEBUG_NR_PBCHSIM
printf("Setting SNR1 to %f\n",snr1);
#endif
break; break;
/* /*
...@@ -254,10 +260,8 @@ int main(int argc, char **argv) ...@@ -254,10 +260,8 @@ int main(int argc, char **argv)
case 'x': case 'x':
transmission_mode=atoi(optarg); transmission_mode=atoi(optarg);
if ((transmission_mode!=1) && if ((transmission_mode!=1) && (transmission_mode!=2) && (transmission_mode!=6)) {
(transmission_mode!=2) && printf("Unsupported transmission mode %d. Exiting.\n",transmission_mode);
(transmission_mode!=6)) {
msg("Unsupported transmission mode %d\n",transmission_mode);
exit(-1); exit(-1);
} }
...@@ -267,7 +271,7 @@ int main(int argc, char **argv) ...@@ -267,7 +271,7 @@ int main(int argc, char **argv)
n_tx=atoi(optarg); n_tx=atoi(optarg);
if ((n_tx==0) || (n_tx>2)) { 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); exit(-1);
} }
...@@ -277,7 +281,7 @@ int main(int argc, char **argv) ...@@ -277,7 +281,7 @@ int main(int argc, char **argv)
n_rx=atoi(optarg); n_rx=atoi(optarg);
if ((n_rx==0) || (n_rx>2)) { 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); exit(-1);
} }
...@@ -299,7 +303,7 @@ int main(int argc, char **argv) ...@@ -299,7 +303,7 @@ int main(int argc, char **argv)
input_fd = fopen(optarg,"r"); input_fd = fopen(optarg,"r");
if (input_fd==NULL) { if (input_fd==NULL) {
printf("Problem with filename %s\n",optarg); printf("Problem with filename %s. Exiting.\n", optarg);
exit(-1); exit(-1);
} }
...@@ -431,7 +435,7 @@ int main(int argc, char **argv) ...@@ -431,7 +435,7 @@ int main(int argc, char **argv)
0); 0);
if (gNB2UE==NULL) { if (gNB2UE==NULL) {
msg("Problem generating channel model. Exiting.\n"); printf("Problem generating channel model. Exiting.\n");
exit(-1); exit(-1);
} }
...@@ -518,7 +522,6 @@ int main(int argc, char **argv) ...@@ -518,7 +522,6 @@ int main(int argc, char **argv)
if (gNB->frame_parms.nb_antennas_tx>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); LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1);
} else { } else {
printf("Reading %d samples from file to antenna buffer %d\n",frame_length_complex_samples,0); 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 UE->UE_fo_compensation = 1; // perform fo compensation when samples from file are used
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
//#include "UTIL/LISTS/list.h" //#include "UTIL/LISTS/list.h"
//#include "common/ran_context.h" //#include "common/ran_context.h"
//#define DEBUG_ULSCHSIM //#define DEBUG_NR_ULSCHSIM
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE; PHY_VARS_NR_UE *UE;
...@@ -64,36 +64,14 @@ double cpuf; ...@@ -64,36 +64,14 @@ double cpuf;
// dummy functions // dummy functions
int nfapi_mode = 0; int nfapi_mode = 0;
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return (0); }
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_tx_req(nfapi_tx_request_t *tx_req) { int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return (0); }
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); }
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { NR_IF_Module_t * NR_IF_Module_init(int Mod_id) { return (NULL); }
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) { void exit_function(const char *file, const char *function, const int line, const char *s) {
const char *msg = s == NULL ? "no comment" : s; const char *msg = s == NULL ? "no comment" : s;
...@@ -150,7 +128,7 @@ int main(int argc, char **argv) { ...@@ -150,7 +128,7 @@ int main(int argc, char **argv) {
SCM_t channel_model = AWGN; //Rayleigh1_anticorr; SCM_t channel_model = AWGN; //Rayleigh1_anticorr;
uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1; uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1;
//unsigned char frame_type = 0; //unsigned char frame_type = 0;
unsigned char pbch_phase = 0; //unsigned char pbch_phase = 0;
int frame = 0, subframe = 0; int frame = 0, subframe = 0;
int frame_length_complex_samples; int frame_length_complex_samples;
//int frame_length_complex_samples_no_prefix; //int frame_length_complex_samples_no_prefix;
...@@ -178,7 +156,8 @@ int main(int argc, char **argv) { ...@@ -178,7 +156,8 @@ int main(int argc, char **argv) {
//logInit(); //logInit();
randominit(0); 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) { switch (c) {
/*case 'f': /*case 'f':
write_output_file = 1; write_output_file = 1;
...@@ -226,7 +205,7 @@ int main(int argc, char **argv) { ...@@ -226,7 +205,7 @@ int main(int argc, char **argv) {
break; break;
default: default:
msg("Unsupported channel model!\n"); printf("Unsupported channel model! Exiting.\n");
exit(-1); exit(-1);
} }
...@@ -242,17 +221,24 @@ int main(int argc, char **argv) { ...@@ -242,17 +221,24 @@ int main(int argc, char **argv) {
case 'n': case 'n':
n_trials = atoi(optarg); n_trials = atoi(optarg);
#ifdef DEBUG_NR_ULSCHSIM
printf("n_trials (-n) = %d\n", n_trials);
#endif
break; break;
case 's': case 's':
snr0 = atof(optarg); snr0 = atof(optarg);
msg("Setting SNR0 to %f\n", snr0); #ifdef DEBUG_NR_ULSCHSIM
printf("Setting SNR0 to %f\n", snr0);
#endif
break; break;
case 'S': case 'S':
snr1 = atof(optarg); snr1 = atof(optarg);
snr1set = 1; snr1set = 1;
msg("Setting SNR1 to %f\n", snr1); #ifdef DEBUG_NR_ULSCHSIM
printf("Setting SNR1 to %f\n", snr1);
#endif
break; break;
case 'p': case 'p':
...@@ -273,7 +259,7 @@ int main(int argc, char **argv) { ...@@ -273,7 +259,7 @@ int main(int argc, char **argv) {
n_tx = atoi(optarg); n_tx = atoi(optarg);
if ((n_tx == 0) || (n_tx > 2)) { 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); exit(-1);
} }
...@@ -283,7 +269,7 @@ int main(int argc, char **argv) { ...@@ -283,7 +269,7 @@ int main(int argc, char **argv) {
n_rx = atoi(optarg); n_rx = atoi(optarg);
if ((n_rx == 0) || (n_rx > 2)) { 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); exit(-1);
} }
...@@ -299,29 +285,32 @@ int main(int argc, char **argv) { ...@@ -299,29 +285,32 @@ int main(int argc, char **argv) {
case 'R': case 'R':
N_RB_DL = atoi(optarg); 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; break;
case 'F': case 'F':
input_fd = fopen(optarg, "r"); input_fd = fopen(optarg, "r");
if (input_fd == NULL) { if (input_fd == NULL) {
printf("Problem with filename %s\n", optarg); printf("Problem with filename %s. Exiting.\n", optarg);
exit(-1); exit(-1);
} }
break; break;
case 'P': /*case 'P':
pbch_phase = atoi(optarg); pbch_phase = atoi(optarg);
if (pbch_phase > 3) if (pbch_phase > 3)
printf("Illegal PBCH phase (0-3) got %d\n", pbch_phase); printf("Illegal PBCH phase (0-3) got %d\n", pbch_phase);
break;*/
break;
case 'm': case 'm':
Imcs = atoi(optarg); Imcs = atoi(optarg);
#ifdef DEBUG_NR_ULSCHSIM
printf("Imcs (-m) = %d\n", Imcs);
#endif
break; break;
case 'l': case 'l':
...@@ -338,15 +327,16 @@ int main(int argc, char **argv) { ...@@ -338,15 +327,16 @@ int main(int argc, char **argv) {
default: default:
case 'h': 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("-h This message\n");
printf("-p Use extended prefix mode\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("-d Use TDD\n");
printf("-n Number of frames to simulate\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 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("-S Ending SNR, runs from SNR0 to SNR1\n");
printf("-t Delay spread for multipath channel\n"); printf("-p Use extended prefix mode\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("-t Delay spread for multipath channel\n");
//printf("-x Transmission mode (1,2,6 for the moment)\n"); //printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas 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("-z Number of RX antennas used in UE\n");
...@@ -355,11 +345,14 @@ int main(int argc, char **argv) { ...@@ -355,11 +345,14 @@ int main(int argc, char **argv) {
printf("-M Multiple SSB positions in burst\n"); printf("-M Multiple SSB positions in burst\n");
printf("-N Nid_cell\n"); printf("-N Nid_cell\n");
printf("-R N_RB_DL\n"); printf("-R N_RB_DL\n");
printf("-O oversampling factor (1,2,4,8,16)\n"); printf("-F Input filename (.txt format) for RX conformance testing\n");
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\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("-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 Output filename (.txt format) for Pe/SNR results\n");
printf("-F Input filename (.txt format) for RX conformance testing\n");
exit(-1); exit(-1);
break; break;
} }
...@@ -372,13 +365,17 @@ int main(int argc, char **argv) { ...@@ -372,13 +365,17 @@ int main(int argc, char **argv) {
if (snr1set == 0) if (snr1set == 0)
snr1 = snr0 + 10; 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), 61.44e6, //N_RB2sampling_rate(N_RB_DL),
40e6, //N_RB2channel_bandwidth(N_RB_DL), 40e6, //N_RB2channel_bandwidth(N_RB_DL),
0, 0, 0); 0,
0,
0);
if (gNB2UE == NULL) { if (gNB2UE == NULL) {
msg("Problem generating channel model. Exiting.\n"); printf("Problem generating channel model. Exiting.\n");
exit(-1); exit(-1);
} }
...@@ -446,7 +443,7 @@ int main(int argc, char **argv) { ...@@ -446,7 +443,7 @@ int main(int argc, char **argv) {
//phy_init_nr_top(frame_parms); //phy_init_nr_top(frame_parms);
if (init_nr_ue_signal(UE, 1, 0) != 0) { 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); exit(-1);
} }
...@@ -458,7 +455,7 @@ int main(int argc, char **argv) { ...@@ -458,7 +455,7 @@ int main(int argc, char **argv) {
UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0);
if (!UE->ulsch[sf][0][i]) { if (!UE->ulsch[sf][0][i]) {
printf("Can't get ue ulsch structures\n"); printf("Can't get ue ulsch structures.\n");
exit(-1); exit(-1);
} }
...@@ -540,7 +537,7 @@ int main(int argc, char **argv) { ...@@ -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]); for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%d \n",test_input[i]);
#endif #endif
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
#include "SIMULATION/TOOLS/sim.h"
unsigned int s0, s1, s2, b; unsigned int s0, s1, s2, b;
...@@ -32,7 +33,6 @@ unsigned int s0, s1, s2, b; ...@@ -32,7 +33,6 @@ unsigned int s0, s1, s2, b;
unsigned int taus(void) unsigned int taus(void)
{ {
b = (((s0 << 13) ^ s0) >> 19); b = (((s0 << 13) ^ s0) >> 19);
s0 = (((s0 & 0xFFFFFFFE) << 12)^ b); s0 = (((s0 & 0xFFFFFFFE) << 12)^ b);
b = (((s1 << 2) ^ s1) >> 25); b = (((s1 << 2) ^ s1) >> 25);
...@@ -41,7 +41,7 @@ unsigned int taus(void) ...@@ -41,7 +41,7 @@ unsigned int taus(void)
s2 = (((s2 & 0xFFFFFFF0) << 17)^ b); s2 = (((s2 & 0xFFFFFFF0) << 17)^ b);
return s0 ^ s1 ^ s2; return s0 ^ s1 ^ s2;
} }
#if 1
void set_taus_seed(unsigned int seed_init) void set_taus_seed(unsigned int seed_init)
{ {
...@@ -63,25 +63,18 @@ void set_taus_seed(unsigned int seed_init) ...@@ -63,25 +63,18 @@ void set_taus_seed(unsigned int seed_init)
s2 = result; s2 = result;
} }
} }
#endif
#ifdef MAIN #ifdef MAIN
main() main()
{ {
unsigned int i,rand; unsigned int i,rand;
set_taus_seed(); set_taus_seed();
for (i=0; i<10; i++) { for (i=0; i<10; i++) {
rand = taus(); rand = taus();
printf("%u\n",rand); printf("%u\n",rand);
} }
} }
#endif //MAIN #endif //MAIN
...@@ -133,7 +133,7 @@ typedef enum { ...@@ -133,7 +133,7 @@ typedef enum {
{CONFIG_STRING_RU_NB_RX, 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_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_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_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_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_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_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "liblfds611.h" #include "liblfds611.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/system.h"
#include "UTIL/OCG/OCG.h" #include "UTIL/OCG/OCG.h"
#include "UTIL/OCG/OCG_extern.h" #include "UTIL/OCG/OCG_extern.h"
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
...@@ -140,7 +141,7 @@ pdcp_netlink_init( ...@@ -140,7 +141,7 @@ pdcp_netlink_init(
* When the netlink fifo is full, packets are silently dropped, this behaviour * When the netlink fifo is full, packets are silently dropped, this behaviour
* should be avoided if we want a reliable link. * 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; return 0;
......
...@@ -52,7 +52,7 @@ inline unsigned int taus(unsigned int comp) { ...@@ -52,7 +52,7 @@ inline unsigned int taus(unsigned int comp) {
return r[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 unsigned int i; // i index of component
for (i=MIN_NUM_COMPS; i < MAX_NUM_COMPS ; i ++) { for (i=MIN_NUM_COMPS; i < MAX_NUM_COMPS ; i ++) {
...@@ -79,7 +79,7 @@ void set_taus_seed(unsigned int seed_type) { ...@@ -79,7 +79,7 @@ void set_taus_seed(unsigned int seed_type) {
break; break;
} }
} }
} }*/
int get_rand (unsigned int comp) { int get_rand (unsigned int comp) {
if ((comp > MIN_NUM_COMPS) && (comp < MAX_NUM_COMPS)) if ((comp > MIN_NUM_COMPS) && (comp < MAX_NUM_COMPS))
......
...@@ -105,15 +105,24 @@ typedef enum radio_type_e { ...@@ -105,15 +105,24 @@ typedef enum radio_type_e {
RADIO_TYPE_MAX RADIO_TYPE_MAX
} radio_type_t; } radio_type_t;
extern trace_mode_t opt_type;
extern char in_ip[40];
extern char in_path[FILENAME_MAX];
/** /**
* function def * function def
*/ */
void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size, void trace_pdu(int direction,
int ueid, int rntiType, int rnti, uint16_t sysFrame, uint8_t subframe, uint8_t *pdu_buffer,
int oob_event, int oob_event_value); 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); int init_opt(void);
......
...@@ -99,8 +99,8 @@ int opt_enabled=0; ...@@ -99,8 +99,8 @@ int opt_enabled=0;
//static unsigned char g_PDUBuffer[1600]; //static unsigned char g_PDUBuffer[1600];
//static unsigned int g_PDUOffset; //static unsigned int g_PDUOffset;
static char *in_ip; char in_ip[40];
static char *in_path; char in_path[FILENAME_MAX];
FILE *file_fd = NULL; FILE *file_fd = NULL;
pcap_hdr_t file_header = { pcap_hdr_t file_header = {
0xa1b2c3d4, /* magic number */ 0xa1b2c3d4, /* magic number */
...@@ -439,9 +439,8 @@ int init_opt(void) { ...@@ -439,9 +439,8 @@ int init_opt(void) {
paramdef_t opt_params[] = OPT_PARAMS_DESC ; paramdef_t opt_params[] = OPT_PARAMS_DESC ;
checkedparam_t opt_checkParams[] = OPTPARAMS_CHECK_DESC; checkedparam_t opt_checkParams[] = OPTPARAMS_CHECK_DESC;
uint16_t in_port; uint16_t in_port;
config_set_checkfunctions(opt_params, opt_checkParams, config_set_checkfunctions(opt_params, opt_checkParams, sizeof(opt_params)/sizeof(paramdef_t));
sizeof(opt_params)/sizeof(paramdef_t)); config_get(opt_params, sizeof(opt_params)/sizeof(paramdef_t), OPT_CONFIGPREFIX);
config_get( opt_params,sizeof(opt_params)/sizeof(paramdef_t),OPT_CONFIGPREFIX);
subframesSinceCaptureStart = 0; subframesSinceCaptureStart = 0;
int tmptype = config_get_processedint( &(opt_params[OPTTYPE_IDX])); int tmptype = config_get_processedint( &(opt_params[OPTTYPE_IDX]));
......
...@@ -87,11 +87,15 @@ ...@@ -87,11 +87,15 @@
unsigned short config_frames[4] = {2,9,11,13}; unsigned short config_frames[4] = {2,9,11,13};
#endif #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 DEFBANDS[] = {7};
static int DEFENBS[] = {0}; static int DEFENBS[] = {0};
static int DEFNRBANDS[] = {7};
static int DEFGNBS[] = {0};
#include "ENB_APP/enb_paramdef.h" #include "ENB_APP/enb_paramdef.h"
#include "GNB_APP/gnb_paramdef.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#ifndef OPENAIR2 #ifndef OPENAIR2
...@@ -1792,7 +1796,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -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_t *ru = RC.ru[inst];
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
...@@ -2294,7 +2298,7 @@ void stop_RU(int nb_ru) ...@@ -2294,7 +2298,7 @@ void stop_RU(int nb_ru)
{ {
for (int inst = 0; inst < nb_ru; inst++) { for (int inst = 0; inst < nb_ru; inst++) {
LOG_I(PHY, "Stopping RU %d processing threads\n", inst); LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
kill_RU_proc(inst); kill_NR_RU_proc(inst);
} }
} }
......
...@@ -833,8 +833,8 @@ int stop_L1L2(module_id_t gnb_id) ...@@ -833,8 +833,8 @@ int stop_L1L2(module_id_t gnb_id)
terminate_task(TASK_L2L1, gnb_id); terminate_task(TASK_L2L1, gnb_id);
LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id); LOG_I(ENB_APP, "calling kill_gNB_proc() for instance %d\n", gnb_id);
kill_gNB_proc(gnb_id); kill_gNB_proc(gnb_id);
LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", gnb_id); LOG_I(ENB_APP, "calling kill_NR_RU_proc() for instance %d\n", gnb_id);
kill_RU_proc(gnb_id); kill_NR_RU_proc(gnb_id);
oai_exit = 0; oai_exit = 0;
for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) { for (int cc_id = 0; cc_id < RC.nb_nr_CC[gnb_id]; cc_id++) {
//free_transport(RC.gNB[gnb_id][cc_id]); //free_transport(RC.gNB[gnb_id][cc_id]);
......
...@@ -236,7 +236,7 @@ extern void kill_gNB_proc(int inst); ...@@ -236,7 +236,7 @@ extern void kill_gNB_proc(int inst);
extern void init_RU(const char*); extern void init_RU(const char*);
extern void init_RU_proc(RU_t *ru); extern void init_RU_proc(RU_t *ru);
extern void stop_RU(int nb_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 set_function_spec_param(RU_t *ru);
extern void reset_opp_meas(void); extern void reset_opp_meas(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment