Commit 561119a2 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/cleanup-nr-ue-executable' into integration_2024_w29

parents 84568102 93280a3e
......@@ -58,7 +58,6 @@ To get help on supported parameters you can use specific options:
--emulate-rf: Emulated RF enabled(disable by defult)
--clock: tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)
--wait-for-sync: Help string not specified
--single-thread-enable: Disables single-thread mode in lte-softmodem
-C: Set the downlink frequency for all component carriers
-a: Channel id offset
-d: Enable soft scope and L1 and L2 stats (Xforms)
......
......@@ -107,8 +107,6 @@ extern int oai_exit;
extern int transmission_mode;
extern int oaisim_flag;
#include "executables/thread-common.h"
//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
//extern WORKER_CONF_t get_thread_worker_conf(void);
......@@ -134,7 +132,7 @@ static struct {
extern double cpuf;
void init_eNB(int,int);
void init_eNB(int);
void stop_eNB(int nb_inst);
int wakeup_tx(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, int frame_tx, int subframe_tx, uint64_t timestamp_tx);
......@@ -899,8 +897,6 @@ void init_eNB_proc(int inst) {
pthread_cond_init( &proc->cond_prach_br, NULL);
pthread_attr_init( &proc->attr_prach_br);
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
pthread_create( &L1_proc->pthread, attr0, L1_thread, proc );
} else if ((get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && NFAPI_MODE!=NFAPI_MODE_VNF) {
......@@ -1224,8 +1220,7 @@ void init_eNB_afterRU(void) {
}
void init_eNB(int single_thread_flag,
int wait_for_sync) {
void init_eNB(int wait_for_sync) {
int CC_id;
int inst;
PHY_VARS_eNB *eNB;
......@@ -1244,8 +1239,7 @@ void init_eNB(int single_thread_flag,
eNB = RC.eNB[inst][CC_id];
eNB->abstraction_flag = 0;
eNB->single_thread_flag = single_thread_flag;
LOG_I(PHY,"Initializing eNB %d CC_id %d single_thread_flag:%d\n",inst,CC_id,single_thread_flag);
LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id);
LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id);
LOG_I(PHY,"Registering with MAC interface module\n");
AssertFatal((eNB->if_inst = IF_Module_init(inst))!=NULL,"Cannot register interface");
......
......@@ -143,8 +143,6 @@ char channels[128] = "0";
int rx_input_level_dBm;
int otg_enabled;
uint64_t num_missed_slots=0; // counter for the number of missed slots
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
......@@ -159,7 +157,6 @@ eth_params_t *eth_params;
double cpuf;
int oaisim_flag=0;
/* hardcoded into gtp_itf.cpp */
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
......@@ -542,8 +539,8 @@ int main ( int argc, char **argv )
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
if (RC.nb_L1_inst > 0) {
printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
init_eNB(get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
printf("Initializing eNB threads wait_for_sync:%d\n", get_softmodem_params()->wait_for_sync);
init_eNB(get_softmodem_params()->wait_for_sync);
}
for (int x=0; x < RC.nb_L1_inst; x++)
for (int CC_id=0; CC_id<RC.nb_L1_CC[x]; CC_id++) {
......
......@@ -122,9 +122,7 @@ extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int rx_input_level_dBm;
extern uint64_t num_missed_slots; // counter for the number of missed slots
extern int oaisim_flag;
extern int oai_exit;
extern openair0_config_t openair0_cfg[MAX_CARDS];
......@@ -141,7 +139,7 @@ extern int usrp_tx_thread;
// In lte-enb.c
extern void stop_eNB(int);
extern void kill_eNB_proc(int inst);
extern void init_eNB(int single_thread_flag, int wait_for_sync);
extern void init_eNB(int wait_for_sync);
// In lte-ru.c
extern void stop_ru(RU_t *ru);
......
......@@ -143,8 +143,6 @@ int rx_input_level_dBm;
static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
uint64_t num_missed_slots=0; // counter for the number of missed slots
// prototypes from function implemented in lte-ue.c, probably should be elsewhere in a include file.
extern void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_iface);
extern PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
......@@ -167,7 +165,6 @@ double cpuf;
extern char uecap_xer[1024];
char uecap_xer_in=0;
int oaisim_flag=0;
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
......
......@@ -482,7 +482,7 @@ void init_eNB_afterRU(void) {
}
void init_gNB(int single_thread_flag,int wait_for_sync) {
void init_gNB(int wait_for_sync) {
int inst;
PHY_VARS_gNB *gNB;
......@@ -500,12 +500,11 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
}
gNB = RC.gNB[inst];
gNB->abstraction_flag = 0;
gNB->single_thread_flag = single_thread_flag;
/*nr_polar_init(&gNB->nrPolar_params,
NR_POLAR_PBCH_MESSAGE_TYPE,
NR_POLAR_PBCH_PAYLOAD_BITS,
NR_POLAR_PBCH_AGGREGATION_LEVEL);*/
LOG_I(PHY,"Initializing gNB %d single_thread_flag:%d\n",inst,gNB->single_thread_flag);
LOG_I(PHY,"Initializing gNB %d\n",inst);
LOG_I(PHY,"Initializing gNB %d\n",inst);
LOG_I(PHY,"Registering with MAC interface module (before %p)\n",gNB->if_inst);
......
......@@ -49,13 +49,11 @@
#define CONFIG_HLP_UESCAN "set UE to scan all possible GSCN in current bandwidth\n"
#define CONFIG_HLP_UEFO "set UE to enable estimation and compensation of frequency offset\n"
#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n"
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
#define CONFIG_HLP_DMAMAP "use DMA memory mapping\n"
#define CONFIG_HLP_EXCCLK "tells hardware to use a clock reference (0:internal(default), 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
#define CONFIG_HLP_ULOFF "Set the uplink frequnecy offset for all component carriers\n"
#define CONFIG_HLP_CHOFF "Channel id offset\n"
......@@ -134,10 +132,6 @@ extern int sync_var;
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int rx_input_level_dBm;
extern uint64_t num_missed_slots; // counter for the number of missed slots
extern int oaisim_flag;
extern int oai_exit;
extern openair0_config_t openair0_cfg[MAX_CARDS];
......
......@@ -107,7 +107,6 @@ int NB_UE_INST = 0;
static int wait_for_sync = 0;
unsigned int mmapped_dma=0;
int single_thread_flag=1;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
......@@ -139,12 +138,8 @@ uint8_t dci_Format = 0;
uint8_t nb_antenna_tx = 1;
uint8_t nb_antenna_rx = 1;
int rx_input_level_dBm;
int otg_enabled;
uint64_t num_missed_slots=0; // counter for the number of missed slots
#include <SIMULATION/ETH_TRANSPORT/proto.h>
extern void reset_opp_meas(void);
......@@ -698,8 +693,8 @@ int main( int argc, char **argv ) {
printf("RC.nb_nr_L1_inst:%d\n", RC.nb_nr_L1_inst);
if (RC.nb_nr_L1_inst > 0) {
printf("Initializing gNB threads single_thread_flag:%d wait_for_sync:%d\n", single_thread_flag,wait_for_sync);
init_gNB(single_thread_flag,wait_for_sync);
printf("Initializing gNB threads wait_for_sync:%d\n", wait_for_sync);
init_gNB(wait_for_sync);
}
printf("wait_gNBs()\n");
......
......@@ -17,7 +17,6 @@
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
// clang-format off
#define CMDLINE_PARAMS_DESC_GNB { \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, .iptr=&single_thread_flag, .defintval=1, TYPE_INT, 0}, \
{"m" , CONFIG_HLP_DLMCS_PHYTEST, 0, .uptr=&target_dl_mcs, .defintval=0, TYPE_UINT, 0}, \
{"l" , CONFIG_HLP_DLNL_PHYTEST, 0, .uptr=&target_dl_Nl, .defintval=0, TYPE_UINT, 0}, \
{"L" , CONFIG_HLP_ULNL_PHYTEST, 0, .uptr=&target_ul_Nl, .defintval=0, TYPE_UINT, 0}, \
......@@ -42,7 +41,7 @@ extern uint64_t ulsch_slot_bitmap;
extern char *uecap_file;
// In nr-gnb.c
extern void init_gNB(int single_thread_flag,int wait_for_sync);
extern void init_gNB(int wait_for_sync);
extern void stop_gNB(int);
// In nr-ru.c
......
......@@ -138,11 +138,8 @@ static void *nrL1_UE_stats_thread(void *param)
return NULL;
}
void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
uint8_t UE_id,
uint8_t abstraction_flag)
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id)
{
int nb_connected_gNB = 1;
ue->Mod_id = UE_id;
......
......@@ -111,11 +111,8 @@ RAN_CONTEXT_t RC;
int oai_exit = 0;
extern int16_t nr_dlsch_demod_shift;
static int tx_max_power[MAX_NUM_CCs] = {0};
int single_thread_flag = 1;
int tddflag = 0;
int vcdflag = 0;
double rx_gain_off = 0.0;
......@@ -126,12 +123,10 @@ char *rrc_config_path = NULL;
char *reconfig_file = NULL;
char *rbconfig_file = NULL;
char *uecap_file = NULL;
int dumpframe = 0;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint64_t sidelink_frequency[MAX_NUM_CCs][4];
int rx_input_level_dBm;
#if MAX_NUM_CCs == 1
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
......@@ -149,51 +144,11 @@ openair0_config_t openair0_cfg[MAX_CARDS];
int16_t node_synch_ref[MAX_NUM_CCs];
int otg_enabled;
double cpuf;
int chain_offset = 0;
int card_offset = 0;
uint64_t num_missed_slots = 0; // counter for the number of missed slots
int numerology = 0;
int oaisim_flag = 0;
int emulate_rf = 0;
uint32_t N_RB_DL = 106;
// NTN cellSpecificKoffset-r17, but in slots for DL SCS
unsigned int NTN_UE_Koffset = 0;
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
*/
uint8_t abstraction_flag=0;
nr_bler_struct nr_bler_data[NR_NUM_MCS];
static void init_bler_table(char*);
/*---------------------BMC: timespec helpers -----------------------------*/
struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
struct timespec clock_difftime(struct timespec start, struct timespec end) {
struct timespec temp;
if ((end.tv_nsec-start.tv_nsec)<0) {
temp.tv_sec = end.tv_sec-start.tv_sec-1;
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
} else {
temp.tv_sec = end.tv_sec-start.tv_sec;
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
}
return temp;
}
void print_difftimes(void) {
LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
}
int create_tasks_nrue(uint32_t ue_nb) {
LOG_D(NR_RRC, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1);
......@@ -286,8 +241,8 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
UE->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
UE->tx_total_gain_dB = (int)tx_gain[CC_id][0];
UE->tx_power_max_dBm = tx_max_power[CC_id];
UE->rf_map.card = card_offset;
UE->rf_map.chain = CC_id + chain_offset;
UE->rf_map.card = 0;
UE->rf_map.chain = CC_id + 0;
UE->max_ldpc_iterations = nrUE_params.max_ldpc_iterations;
UE->ldpc_offload_enable = nrUE_params.ldpc_offload_flag;
UE->UE_scan_carrier = nrUE_params.UE_scan_carrier;
......@@ -303,11 +258,6 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
// Set FP variables
if (tddflag){
fp->frame_type = TDD;
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
}
fp->nb_antennas_rx = nrUE_params.nb_antennas_rx;
fp->nb_antennas_tx = nrUE_params.nb_antennas_tx;
fp->threequarter_fs = get_softmodem_params()->threequarter_fs;
......@@ -428,9 +378,9 @@ static void get_channel_model_mode(configmodule_interface_t *cfg)
int num_xp_antennas = *GNBParams[GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
if (num_xp_antennas == 2)
init_bler_table("NR_MIMO2x2_AWGN_RESULTS_DIR");
init_nr_bler_table("NR_MIMO2x2_AWGN_RESULTS_DIR");
else
init_bler_table("NR_AWGN_RESULTS_DIR");
init_nr_bler_table("NR_AWGN_RESULTS_DIR");
}
void start_oai_nrue_threads()
......@@ -574,7 +524,7 @@ int main(int argc, char **argv)
}
UE[CC_id]->sl_mode = get_softmodem_params()->sl_mode;
init_nr_ue_vars(UE[CC_id], inst, abstraction_flag);
init_nr_ue_vars(UE[CC_id], inst);
if (UE[CC_id]->sl_mode) {
AssertFatal(UE[CC_id]->sl_mode == 2, "Only Sidelink mode 2 supported. Mode 1 not yet supported\n");
......@@ -646,55 +596,3 @@ int main(int argc, char **argv)
return 0;
}
// Read in each MCS file and build BLER-SINR-TB table
static void init_bler_table(char *env_string) {
memset(nr_bler_data, 0, sizeof(nr_bler_data));
const char *awgn_results_dir = getenv(env_string);
if (!awgn_results_dir) {
LOG_W(NR_MAC, "No %s\n", env_string);
return;
}
for (unsigned int i = 0; i < NR_NUM_MCS; i++) {
char fName[1024];
snprintf(fName, sizeof(fName), "%s/mcs%u_awgn_5G.csv", awgn_results_dir, i);
FILE *pFile = fopen(fName, "r");
if (!pFile) {
LOG_E(NR_MAC, "%s: open %s: %s\n", __func__, fName, strerror(errno));
continue;
}
size_t bufSize = 1024;
char * line = NULL;
char * token;
char * temp = NULL;
int nlines = 0;
while (getline(&line, &bufSize, pFile) > 0) {
if (!strncmp(line, "SNR", 3)) {
continue;
}
if (nlines > NR_NUM_SINR) {
LOG_E(NR_MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName);
abort();
}
token = strtok_r(line, ";", &temp);
int ncols = 0;
while (token != NULL) {
if (ncols > NUM_BLER_COL) {
LOG_E(NR_MAC, "BLER FILE ERROR - num of cols greater than expected\n");
abort();
}
nr_bler_data[i].bler_table[nlines][ncols] = strtof(token, NULL);
ncols++;
token = strtok_r(NULL, ";", &temp);
}
nlines++;
}
nr_bler_data[i].length = nlines;
fclose(pFile);
}
}
......@@ -36,12 +36,10 @@
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, .strptr=&usrp_args, .defstrval="type=b200", TYPE_STRING, 0}, \
{"tx_subdev", CONFIG_HLP_TX_SUBDEV, 0, .strptr=&tx_subdev, .defstrval=NULL, TYPE_STRING, 0}, \
{"rx_subdev", CONFIG_HLP_RX_SUBDEV, 0, .strptr=&rx_subdev, .defstrval=NULL, TYPE_STRING, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, .iptr=&single_thread_flag, .defintval=1, TYPE_INT, 0}, \
{"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, .u8ptr=NULL, .defintval=0, TYPE_UINT8, 0}, \
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, .uptr=&nrUE_params.ofdm_offset_divisor, .defuintval=8, TYPE_UINT32, 0}, \
{"max-ldpc-iterations", CONFIG_HLP_MAX_LDPC_ITERATIONS, 0, .iptr=&nrUE_params.max_ldpc_iterations, .defuintval=8, TYPE_UINT8, 0}, \
{"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, PARAMFLAG_BOOL, .iptr=&(nrUE_params.ldpc_offload_flag), .defintval=0, TYPE_INT, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, .iptr=(int32_t *)&nr_dlsch_demod_shift, .defintval=0, TYPE_INT, 0}, \
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, .iptr=&vcdflag, .defintval=0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, .strptr=&uecap_file, .defstrval="./uecap_ports1.xml", TYPE_STRING, 0}, \
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH, 0, .strptr=&rrc_config_path, .defstrval=NULL, TYPE_STRING, 0}, \
......@@ -58,7 +56,6 @@
{"ue-max-power", NULL, 0, .iptr=&(tx_max_power[0]), .defintval=90, TYPE_INT, 0}, \
{"r" , CONFIG_HLP_PRB_SA, 0, .iptr=&(nrUE_params.N_RB_DL), .defintval=106, TYPE_UINT, 0}, \
{"ssb", CONFIG_HLP_SSC, 0, .iptr=&(nrUE_params.ssb_start_subcarrier), .defintval=516, TYPE_UINT16, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, .iptr=&tddflag, .defintval=0, TYPE_INT, 0}, \
{"if_freq" , CONFIG_HLP_IF_FREQ, 0, .u64ptr=&(nrUE_params.if_freq), .defuintval=0, TYPE_UINT64, 0}, \
{"if_freq_off" , CONFIG_HLP_IF_FREQ_OFF, 0, .iptr=&(nrUE_params.if_freq_off), .defuintval=0, TYPE_INT, 0}, \
{"chest-freq", CONFIG_HLP_CHESTFREQ, 0, .iptr=&(nrUE_params.chest_freq), .defintval=0, TYPE_INT, 0}, \
......@@ -105,6 +102,6 @@ extern void reset_opp_meas(void);
extern void print_opp_meas(void);
void start_oai_nrue_threads(void);
void *UE_thread(void *arg);
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id, uint8_t abstraction_flag);
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id);
void init_nrUE_standalone_thread(int ue_idx);
#endif
......@@ -125,7 +125,6 @@ extern "C"
#define SA softmodem_params.sa
#define SL_MODE softmodem_params.sl_mode
#define WAIT_FOR_SYNC softmodem_params.wait_for_sync
#define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag
#define CHAIN_OFFSET softmodem_params.chain_offset
#define NUMEROLOGY softmodem_params.numerology
#define BAND softmodem_params.band
......@@ -162,7 +161,6 @@ extern int usrp_tx_thread;
{"time-source", CONFIG_HLP_TME, 0, .uptr=&TIMING_SOURCE, .defintval=0, TYPE_UINT, 0}, \
{"tune-offset", CONFIG_HLP_TUNE_OFFSET, 0, .dblptr=&TUNE_OFFSET, .defintval=0, TYPE_DOUBLE, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, .iptr=&WAIT_FOR_SYNC, .defintval=0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, .iptr=&SINGLE_THREAD_FLAG, .defintval=0, TYPE_INT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, .u64ptr=&(downlink_frequency[0][0]), .defuintval=0, TYPE_UINT64, 0}, \
{"CO" , CONFIG_HLP_ULF, 0, .iptr=&(uplink_frequency_offset[0][0]), .defintval=0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, .iptr=&CHAIN_OFFSET, .defintval=0, TYPE_INT, 0}, \
......@@ -227,7 +225,6 @@ extern int usrp_tx_thread;
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s3a = { config_checkstr_assign_integer, \
{"MONOLITHIC", "PNF", "VNF", "AERIAL","UE_STUB_PNF","UE_STUB_OFFNET","STANDALONE_PNF"}, \
{NFAPI_MONOLITHIC, NFAPI_MODE_PNF, NFAPI_MODE_VNF, NFAPI_MODE_AERIAL,NFAPI_UE_STUB_PNF,NFAPI_UE_STUB_OFFNET,NFAPI_MODE_STANDALONE_PNF}, \
......@@ -328,7 +325,6 @@ typedef struct {
uint8_t usim_test;
int emulate_rf;
int wait_for_sync; //eNodeB only
int single_thread_flag; //eNodeB only
int chain_offset;
int numerology;
int band;
......
......@@ -38,7 +38,6 @@
extern RAN_CONTEXT_t RC;
extern UL_RCC_IND_t UL_RCC_INFO;
extern int single_thread_flag;
extern uint16_t sf_ahead;
extern uint16_t slot_ahead;
......
......@@ -35,7 +35,6 @@
extern RAN_CONTEXT_t RC;
extern UL_RCC_IND_t UL_RCC_INFO;
extern int single_thread_flag;
extern uint16_t sf_ahead;
int aerial_wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot)
......
......@@ -200,18 +200,21 @@ int vnf_unpack_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMessag
}
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst);
void install_schedule_handlers(IF_Module_t *if_inst);
extern int single_thread_flag;
extern uint16_t sf_ahead;
void oai_create_enb(void) {
int bodge_counter=0;
PHY_VARS_eNB *eNB = RC.eNB[0][0];
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag,
eNB->single_thread_flag, eNB->if_inst);
NFAPI_TRACE(NFAPI_TRACE_INFO,
"[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d if_inst:%p\n",
eNB->Mod_id,
eNB->CC_id,
RC.nb_CC[0],
eNB->abstraction_flag,
eNB->if_inst);
eNB->Mod_id = bodge_counter;
eNB->CC_id = bodge_counter;
eNB->abstraction_flag = 0;
eNB->single_thread_flag = 0;//single_thread_flag;
RC.nb_CC[bodge_counter] = 1;
if (eNB->if_inst==0) {
......@@ -260,7 +263,6 @@ void oai_create_gnb(void) {
gNB->Mod_id = bodge_counter;
gNB->CC_id = bodge_counter;
gNB->abstraction_flag = 0;
gNB->single_thread_flag = 0;//single_thread_flag;
RC.nb_nr_CC[bodge_counter] = 1;
if (gNB->if_inst==0) {
......
......@@ -42,13 +42,6 @@
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
/* dynamic shift for LLR computation for TM3/4
* set as command line argument, see lte-softmodem.c
* default value: 0
*/
int32_t nr_dlsch_demod_shift = 0;
//int16_t interf_unaw_shift = 13;
// #define DEBUG_HARQ(a...) printf(a)
#define DEBUG_HARQ(...)
//#define DEBUG_DLSCH_DEMOD
......
......@@ -8,7 +8,6 @@
int oai_exit=false;
unsigned int mmapped_dma=0;
int single_thread_flag;
uint32_t timing_advance;
int8_t threequarter_fs;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
......
......@@ -488,7 +488,6 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
eth_params_t eth_params_n;
/// Ethernet parameters for fronthaul interface (upper L1 to Radio head)
eth_params_t eth_params;
int single_thread_flag;
openair0_rf_map rf_map;
int abstraction_flag;
openair0_timestamp ts_offset;
......
......@@ -519,7 +519,6 @@ typedef struct PHY_VARS_eNB_s {
uint8_t CC_id;
uint8_t configured;
L1_proc_t proc;
int single_thread_flag;
int abstraction_flag;
int num_RU;
RU_t *RU_list[MAX_NUM_RU_PER_eNB];
......
......@@ -545,7 +545,6 @@ typedef struct PHY_VARS_gNB_s {
uint8_t CC_id;
uint8_t configured;
gNB_L1_proc_t proc;
int single_thread_flag;
int abstraction_flag;
int num_RU;
RU_t *RU_list[MAX_NUM_RU_PER_gNB];
......
......@@ -119,8 +119,6 @@ void nr_derive_key(int alg_type, uint8_t alg_id, const uint8_t key[32], uint8_t
void processSlotTX(void *arg) {}
nr_bler_struct nr_bler_data[NR_NUM_MCS];
// needed for some functions
openair0_config_t openair0_cfg[MAX_CARDS];
void update_ptrs_config(NR_CellGroupConfig_t *secondaryCellGroup, uint16_t *rbSize, uint8_t *mcsIndex,int8_t *ptrs_arg);
......
......@@ -114,8 +114,6 @@ nrUE_params_t *get_nrUE_params(void) {
return &nrUE_params;
}
nr_bler_struct nr_bler_data[NR_NUM_MCS];
void processSlotTX(void *arg) {}
int NB_UE_INST = 1;
configmodule_interface_t *uniqCfg = NULL;
......
......@@ -80,7 +80,6 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
return 0;
}
nr_bler_struct nr_bler_data[NR_NUM_MCS];
void get_nrUE_params(void)
{
return;
......
......@@ -121,8 +121,6 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
return 0;
}
nr_bler_struct nr_bler_data[NR_NUM_MCS];
void nr_derive_key(int alg_type, uint8_t alg_id, const uint8_t key[32], uint8_t out[16])
{
(void)alg_type;
......
......@@ -23,6 +23,8 @@
#include "executables/softmodem-common.h"
#include "NR_MAC_UE/mac_proto.h"
nr_bler_struct nr_bler_data[NR_NUM_MCS];
slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT];
void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int slot, int index)
{
......@@ -204,3 +206,57 @@ int get_mcs_from_sinr(nr_bler_struct *nr_bler_data, float sinr)
LOG_E(NR_MAC, "Unable to get an MCS value.\n");
abort();
}
// Read in each MCS file and build BLER-SINR-TB table
void init_nr_bler_table(const char *env_string)
{
memset(nr_bler_data, 0, sizeof(nr_bler_data));
const char *awgn_results_dir = getenv(env_string);
if (!awgn_results_dir) {
LOG_W(NR_MAC, "No %s\n", env_string);
return;
}
for (unsigned int i = 0; i < NR_NUM_MCS; i++) {
char fName[1024];
snprintf(fName, sizeof(fName), "%s/mcs%u_awgn_5G.csv", awgn_results_dir, i);
FILE *pFile = fopen(fName, "r");
if (!pFile) {
LOG_E(NR_MAC, "%s: open %s: %s\n", __func__, fName, strerror(errno));
continue;
}
size_t bufSize = 1024;
char *line = NULL;
char *token;
char *temp = NULL;
int nlines = 0;
while (getline(&line, &bufSize, pFile) > 0) {
if (!strncmp(line, "SNR", 3)) {
continue;
}
if (nlines > NR_NUM_SINR) {
LOG_E(NR_MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName);
abort();
}
token = strtok_r(line, ";", &temp);
int ncols = 0;
while (token != NULL) {
if (ncols > NUM_BLER_COL) {
LOG_E(NR_MAC, "BLER FILE ERROR - num of cols greater than expected\n");
abort();
}
nr_bler_data[i].bler_table[nlines][ncols] = strtof(token, NULL);
ncols++;
token = strtok_r(NULL, ";", &temp);
}
nlines++;
}
nr_bler_data[i].length = nlines;
fclose(pFile);
}
}
......@@ -77,5 +77,6 @@ float get_bler_val(uint8_t mcs, int sinr);
bool should_drop_transport_block(int slot, uint16_t rnti);
bool is_channel_modeling(void);
int get_mcs_from_sinr(nr_bler_struct *nr_bler_data, float sinr);
void init_nr_bler_table(const char *env_string);
#endif
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