Commit 79fc7447 authored by frtabu's avatar frtabu

fix usrp problem, and some cppcheck errors

parent 10a3565d
...@@ -187,7 +187,6 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t ...@@ -187,7 +187,6 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
if (nfapi_mode == 0 || nfapi_mode == 1) */ if (nfapi_mode == 0 || nfapi_mode == 1) */
pthread_mutex_lock(&gNB->UL_INFO_mutex); pthread_mutex_lock(&gNB->UL_INFO_mutex);
gNB->UL_INFO.frame = frame_rx; gNB->UL_INFO.frame = frame_rx;
gNB->UL_INFO.slot = slot_rx; gNB->UL_INFO.slot = slot_rx;
...@@ -206,8 +205,8 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t ...@@ -206,8 +205,8 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
if (oai_exit) return(-1); if (oai_exit) return(-1);
//if (slot_rx == NR_UPLINK_SLOT || gNB->frame_parms.frame_type == FDD) //if (slot_rx == NR_UPLINK_SLOT || gNB->frame_parms.frame_type == FDD)
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx); phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) { if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) {
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1); phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
...@@ -907,7 +906,6 @@ void init_gNB(int single_thread_flag,int wait_for_sync) { ...@@ -907,7 +906,6 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
gNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = gNB->harq_pdu_list; gNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = gNB->harq_pdu_list;
gNB->UL_INFO.cqi_ind.cqi_pdu_list = gNB->cqi_pdu_list; gNB->UL_INFO.cqi_ind.cqi_pdu_list = gNB->cqi_pdu_list;
gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list; gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list;
gNB->prach_energy_counter = 0; gNB->prach_energy_counter = 0;
} }
} }
......
...@@ -525,8 +525,9 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) { ...@@ -525,8 +525,9 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
dummy_rx, dummy_rx,
UE->frame_parms.samples_per_subframe, UE->frame_parms.samples_per_subframe,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
if (IS_SOFTMODEM_RFSIM ) { if (IS_SOFTMODEM_RFSIM ) {
usleep(1000); // slow down, as would do actuall rf to let cpu for the synchro thread usleep(1000); // slow down, as would do actuall rf to let cpu for the synchro thread
} }
} }
...@@ -681,14 +682,12 @@ void *UE_thread(void *arg) { ...@@ -681,14 +682,12 @@ void *UE_thread(void *arg) {
curMsg->proc.decoded_frame_rx=-1; curMsg->proc.decoded_frame_rx=-1;
//LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB); //LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB);
#ifdef OAI_ADRV9371_ZC706 #ifdef OAI_ADRV9371_ZC706
/*uint32_t total_gain_dB_prev = 0; /*uint32_t total_gain_dB_prev = 0;
if (total_gain_dB_prev != UE->rx_total_gain_dB) { if (total_gain_dB_prev != UE->rx_total_gain_dB) {
total_gain_dB_prev = UE->rx_total_gain_dB; total_gain_dB_prev = UE->rx_total_gain_dB;
openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB; openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB;
UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]); UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]);
}*/ }*/
#endif #endif
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
...@@ -721,17 +720,17 @@ void *UE_thread(void *arg) { ...@@ -721,17 +720,17 @@ void *UE_thread(void *arg) {
readBlockSize, readBlockSize,
UE->frame_parms.nb_antennas_rx),""); UE->frame_parms.nb_antennas_rx),"");
if (slot_nr==18) if (slot_nr==18)
AssertFatal( writeBlockSize == AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice, UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+ timestamp+
(DURATION_RX_TO_TX*UE->frame_parms.samples_per_slot) - (DURATION_RX_TO_TX*UE->frame_parms.samples_per_slot) -
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 - UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 -
openair0_cfg[0].tx_sample_advance, openair0_cfg[0].tx_sample_advance,
txp, txp,
writeBlockSize, writeBlockSize,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
4),""); 4),"");
if( slot_nr==(nb_slot_frame-1)) { if( slot_nr==(nb_slot_frame-1)) {
// read in first symbol of next frame and adjust for timing drift // read in first symbol of next frame and adjust for timing drift
......
...@@ -478,24 +478,22 @@ void init_openair0(void) { ...@@ -478,24 +478,22 @@ void init_openair0(void) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=92.16e6; openair0_cfg[card].sample_rate=92.16e6;
openair0_cfg[card].samples_per_frame = 921600; openair0_cfg[card].samples_per_frame = 921600;
} } else {
else {
openair0_cfg[card].sample_rate=122.88e6; openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800; openair0_cfg[card].samples_per_frame = 1228800;
} }
} else { } else {
LOG_E(PHY,"Unsupported numerology!\n"); LOG_E(PHY,"Unsupported numerology!\n");
exit(-1); exit(-1);
} }
}else if(frame_parms[0]->N_RB_DL == 273) { } else if(frame_parms[0]->N_RB_DL == 273) {
if (numerology==1) { if (numerology==1) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n"); AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n");
} } else {
else {
openair0_cfg[card].sample_rate=122.88e6; openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800; openair0_cfg[card].samples_per_frame = 1228800;
} }
} else { } else {
LOG_E(PHY,"Unsupported numerology!\n"); LOG_E(PHY,"Unsupported numerology!\n");
exit(-1); exit(-1);
...@@ -511,13 +509,12 @@ void init_openair0(void) { ...@@ -511,13 +509,12 @@ void init_openair0(void) {
} }
} else if (numerology==1) { } else if (numerology==1) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=46.08e6; openair0_cfg[card].sample_rate=46.08e6;
openair0_cfg[card].samples_per_frame = 480800; openair0_cfg[card].samples_per_frame = 480800;
} } else {
else { openair0_cfg[card].sample_rate=61.44e6;
openair0_cfg[card].sample_rate=61.44e6; openair0_cfg[card].samples_per_frame = 614400;
openair0_cfg[card].samples_per_frame = 614400; }
}
} else if (numerology==2) { } else if (numerology==2) {
openair0_cfg[card].sample_rate=122.88e6; openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800; openair0_cfg[card].samples_per_frame = 1228800;
...@@ -534,8 +531,7 @@ void init_openair0(void) { ...@@ -534,8 +531,7 @@ void init_openair0(void) {
} else if (frame_parms[0]->N_RB_DL == 6) { } else if (frame_parms[0]->N_RB_DL == 6) {
openair0_cfg[card].sample_rate=1.92e6; openair0_cfg[card].sample_rate=1.92e6;
openair0_cfg[card].samples_per_frame = 19200; openair0_cfg[card].samples_per_frame = 19200;
} } else {
else {
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL); LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL);
exit(-1); exit(-1);
} }
...@@ -620,10 +616,7 @@ int main( int argc, char **argv ) { ...@@ -620,10 +616,7 @@ int main( int argc, char **argv ) {
logInit(); logInit();
// get options and fill parameters from configuration file // get options and fill parameters from configuration file
get_options (); //Command-line options, enb_properties get_options (); //Command-line options, enb_properties
set_softmodem_optmask(SOFTMODEM_NRUE_BIT); set_softmodem_optmask(SOFTMODEM_NRUE_BIT);
#if T_TRACER #if T_TRACER
T_Config_Init(); T_Config_Init();
#endif #endif
......
...@@ -94,7 +94,7 @@ void get_common_options(void) { ...@@ -94,7 +94,7 @@ void get_common_options(void) {
} }
if (nokrnmod) { if (nokrnmod) {
printf("nokrnmod bit enabled \n"); printf("nokrnmod bit enabled \n");
set_softmodem_optmask(SOFTMODEM_NOKRNMOD_BIT); set_softmodem_optmask(SOFTMODEM_NOKRNMOD_BIT);
} }
...@@ -114,7 +114,6 @@ void get_common_options(void) { ...@@ -114,7 +114,6 @@ void get_common_options(void) {
set_softmodem_optmask(SOFTMODEM_DOFORMS_BIT); set_softmodem_optmask(SOFTMODEM_DOFORMS_BIT);
} }
if(parallel_config != NULL) set_parallel_conf(parallel_config); if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config); if(worker_config != NULL) set_worker_conf(worker_config);
......
...@@ -56,8 +56,7 @@ ...@@ -56,8 +56,7 @@
int16_t *base_sequence_less_than_36(unsigned int M_ZC, int16_t *base_sequence_less_than_36(unsigned int M_ZC,
unsigned int u, unsigned int u,
unsigned int scaling) unsigned int scaling) {
{
char *phi_table; char *phi_table;
int16_t *rv_overbar; int16_t *rv_overbar;
double x; double x;
...@@ -67,17 +66,22 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, ...@@ -67,17 +66,22 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC,
case 6: case 6:
phi_table = (char *)phi_M_ZC_6; phi_table = (char *)phi_M_ZC_6;
break; break;
case 12: case 12:
phi_table = (char *)phi_M_ZC_12; phi_table = (char *)phi_M_ZC_12;
break; break;
case 18: case 18:
phi_table = (char *)phi_M_ZC_18; phi_table = (char *)phi_M_ZC_18;
break; break;
case 24: case 24:
phi_table = (char *)phi_M_ZC_24; phi_table = (char *)phi_M_ZC_24;
break; break;
case 30: case 30:
break; break;
default: default:
printf("function base_sequence_less_than 36_: unsupported base sequence size : %u \n", M_ZC); printf("function base_sequence_less_than 36_: unsupported base sequence size : %u \n", M_ZC);
abort(); abort();
...@@ -97,14 +101,14 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, ...@@ -97,14 +101,14 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC,
rv_overbar[2*n] =(int16_t)(floor(scaling*cos(x))); rv_overbar[2*n] =(int16_t)(floor(scaling*cos(x)));
rv_overbar[2*n+1] =(int16_t)(floor(scaling*sin(x))); rv_overbar[2*n+1] =(int16_t)(floor(scaling*sin(x)));
} }
} } else {
else {
for (n=0; n<M_ZC; n++) { for (n=0; n<M_ZC; n++) {
x = (double)phi_table[n + u*M_ZC] * (M_PI/4); x = (double)phi_table[n + u*M_ZC] * (M_PI/4);
rv_overbar[2*n] = (int16_t)(floor(scaling*cos(x))); rv_overbar[2*n] = (int16_t)(floor(scaling*cos(x)));
rv_overbar[2*n+1] = (int16_t)(floor(scaling*sin(x))); rv_overbar[2*n+1] = (int16_t)(floor(scaling*sin(x)));
} }
} }
return rv_overbar; return rv_overbar;
} }
...@@ -126,22 +130,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, ...@@ -126,22 +130,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC,
int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, int16_t *base_sequence_36_or_larger(unsigned int Msc_RS,
unsigned int u, unsigned int u,
unsigned int v, unsigned int v,
unsigned int scaling) unsigned int scaling) {
{
int16_t *rv_overbar; int16_t *rv_overbar;
unsigned int N_ZC; unsigned int N_ZC;
double q_overbar, x; double q_overbar, x;
unsigned int q,m,n; unsigned int q,m,n;
unsigned int M_ZC = ul_allocated_re[Msc_RS]; unsigned int M_ZC = ul_allocated_re[Msc_RS];
rv_overbar = malloc16(IQ_SIZE*M_ZC); rv_overbar = malloc16(IQ_SIZE*M_ZC);
if (rv_overbar == NULL) { if (rv_overbar == NULL) {
msg("Fatal memory allocation problem \n"); msg("Fatal memory allocation problem \n");
assert(0); assert(0);
} }
N_ZC = ref_ul_primes[Msc_RS]; /* The length N_ZC is given by the largest prime number such that N_ZC < M_ZC */ N_ZC = ref_ul_primes[Msc_RS]; /* The length N_ZC is given by the largest prime number such that N_ZC < M_ZC */
q_overbar = N_ZC * (u+1)/(double)31; q_overbar = N_ZC * (u+1)/(double)31;
/* q = (q_overbar + 1/2) + v.(-1)^(2q_overbar) */ /* q = (q_overbar + 1/2) + v.(-1)^(2q_overbar) */
...@@ -156,6 +158,7 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, ...@@ -156,6 +158,7 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS,
rv_overbar[2*n] = (int16_t)(floor(scaling*cos(M_PI*x))); /* cos(-x) = cos(x) */ rv_overbar[2*n] = (int16_t)(floor(scaling*cos(M_PI*x))); /* cos(-x) = cos(x) */
rv_overbar[2*n+1] = -(int16_t)(floor(scaling*sin(M_PI*x))); /* sin(-x) = -sin(x) */ rv_overbar[2*n+1] = -(int16_t)(floor(scaling*sin(M_PI*x))); /* sin(-x) = -sin(x) */
} }
return rv_overbar; return rv_overbar;
} }
...@@ -173,19 +176,16 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, ...@@ -173,19 +176,16 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS,
* *
*********************************************************************/ *********************************************************************/
void generate_ul_reference_signal_sequences(unsigned int scaling) void generate_ul_reference_signal_sequences(unsigned int scaling) {
{ unsigned int u,v,Msc_RS;
unsigned int u,v,Msc_RS;
#if 0 #if 0
char output_file[255];
char output_file[255]; char sequence_name[255];
char sequence_name[255];
#endif #endif
for (Msc_RS=0; Msc_RS <= INDEX_SB_LESS_32; Msc_RS++) { for (Msc_RS=0; Msc_RS <= INDEX_SB_LESS_32; Msc_RS++) {
v = 0; v = 0;
for (u=0; u < U_GROUP_NUMBER; u++) { for (u=0; u < U_GROUP_NUMBER; u++) {
rv_ul_ref_sig[u][v][Msc_RS] = base_sequence_less_than_36(ul_allocated_re[Msc_RS], u, scaling); rv_ul_ref_sig[u][v][Msc_RS] = base_sequence_less_than_36(ul_allocated_re[Msc_RS], u, scaling);
#if 0 #if 0
...@@ -193,7 +193,6 @@ void generate_ul_reference_signal_sequences(unsigned int scaling) ...@@ -193,7 +193,6 @@ void generate_ul_reference_signal_sequences(unsigned int scaling)
sprintf(sequence_name, "rv_seq_%d_%d_%d.m", u, v, ul_allocated_re[Msc_RS]); sprintf(sequence_name, "rv_seq_%d_%d_%d.m", u, v, ul_allocated_re[Msc_RS]);
printf("u %d Msc_RS %d allocate memory %x of size %d \n", u, Msc_RS, rv_ul_ref_sig[u][v][Msc_RS], (IQ_SIZE* ul_allocated_re[Msc_RS])); printf("u %d Msc_RS %d allocate memory %x of size %d \n", u, Msc_RS, rv_ul_ref_sig[u][v][Msc_RS], (IQ_SIZE* ul_allocated_re[Msc_RS]));
write_output(output_file, sequence_name, rv_ul_ref_sig[u][v][Msc_RS], ul_allocated_re[Msc_RS], 1, 1); write_output(output_file, sequence_name, rv_ul_ref_sig[u][v][Msc_RS], ul_allocated_re[Msc_RS], 1, 1);
#endif #endif
} }
} }
...@@ -207,7 +206,6 @@ void generate_ul_reference_signal_sequences(unsigned int scaling) ...@@ -207,7 +206,6 @@ void generate_ul_reference_signal_sequences(unsigned int scaling)
sprintf(sequence_name, "rv_seq_%d_%d_%d.m", u, v, ul_allocated_re[Msc_RS]); sprintf(sequence_name, "rv_seq_%d_%d_%d.m", u, v, ul_allocated_re[Msc_RS]);
printf("u %d Msc_RS %d allocate memory %x of size %d \n", u, Msc_RS, rv_ul_ref_sig[u][v][Msc_RS], (IQ_SIZE* ul_allocated_re[Msc_RS])); printf("u %d Msc_RS %d allocate memory %x of size %d \n", u, Msc_RS, rv_ul_ref_sig[u][v][Msc_RS], (IQ_SIZE* ul_allocated_re[Msc_RS]));
write_output(output_file, sequence_name, rv_ul_ref_sig[u][v][Msc_RS], ul_allocated_re[Msc_RS], 1, 1); write_output(output_file, sequence_name, rv_ul_ref_sig[u][v][Msc_RS], ul_allocated_re[Msc_RS], 1, 1);
#endif #endif
} }
} }
...@@ -225,9 +223,9 @@ void generate_ul_reference_signal_sequences(unsigned int scaling) ...@@ -225,9 +223,9 @@ void generate_ul_reference_signal_sequences(unsigned int scaling)
* DESCRIPTION : free of uplink reference signal sequences * DESCRIPTION : free of uplink reference signal sequences
* *
*********************************************************************/ *********************************************************************/
void free_ul_reference_signal_sequences(void) void free_ul_reference_signal_sequences(void) {
{
unsigned int u,v,Msc_RS; unsigned int u,v,Msc_RS;
for (Msc_RS=0; Msc_RS < SRS_SB_CONF; Msc_RS++) { for (Msc_RS=0; Msc_RS < SRS_SB_CONF; Msc_RS++) {
for (u=0; u < U_GROUP_NUMBER; u++) { for (u=0; u < U_GROUP_NUMBER; u++) {
for (v=0; v < V_BASE_SEQUENCE_NUMBER; v++) { for (v=0; v < V_BASE_SEQUENCE_NUMBER; v++) {
......
...@@ -80,7 +80,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch, ...@@ -80,7 +80,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
time_stats_t *dlsch_modulation_stats); time_stats_t *dlsch_modulation_stats);
void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch); void free_gNB_dlsch(NR_gNB_DLSCH_t **dlsch);
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch); void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "PHY/defs_gNB.h" #include "PHY/defs_gNB.h"
void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch); void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch);
NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag); NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
...@@ -67,11 +67,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -67,11 +67,11 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
@param n_RNTI, CRNTI @param n_RNTI, CRNTI
*/ */
void nr_ulsch_unscrambling(int16_t* llr, void nr_ulsch_unscrambling(int16_t *llr,
uint32_t size, uint32_t size,
uint8_t q, uint8_t q,
uint32_t Nid, uint32_t Nid,
uint32_t n_RNTI); uint32_t n_RNTI);
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -737,7 +737,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ...@@ -737,7 +737,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
NRRRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL; NRRRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL;
if ((N_RB_DL != 273) && (N_RB_DL != 217) && (N_RB_DL != 106)) if ((N_RB_DL != 273) && (N_RB_DL != 217) && (N_RB_DL != 106))
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for N_RB_DL choice: 106, 217 !\n", RC.config_file_name, i, N_RB_DL); AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for N_RB_DL choice: 106, 217 !\n", RC.config_file_name, i, N_RB_DL);
/* /*
if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) { if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) {
......
...@@ -540,9 +540,6 @@ rrc_pdcp_config_security( ...@@ -540,9 +540,6 @@ rrc_pdcp_config_security(
derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm, derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm,
ue_context_pP->ue_context.kenb, ue_context_pP->ue_context.kenb,
&kRRCint); &kRRCint);
#if !defined(USRP_REC_PLAY)
SET_LOG_DUMP(DEBUG_SECURITY) ;
#endif
if ( LOG_DUMPFLAG( DEBUG_SECURITY ) ) { if ( LOG_DUMPFLAG( DEBUG_SECURITY ) ) {
if (print_keys ==1 ) { if (print_keys ==1 ) {
......
...@@ -115,7 +115,6 @@ typedef struct { ...@@ -115,7 +115,6 @@ typedef struct {
size_t mapsize; size_t mapsize;
iqrec_t *ms_sample; // memory for all subframes iqrec_t *ms_sample; // memory for all subframes
unsigned int nb_samples; unsigned int nb_samples;
unsigned int u_sf_mode; // 1=record, 2=replay
char u_sf_filename[1024]; // subframes file path char u_sf_filename[1024]; // subframes file path
unsigned int u_sf_max ; // max number of recorded subframes unsigned int u_sf_max ; // max number of recorded subframes
unsigned int u_sf_loops ; // number of loops in replay mode unsigned int u_sf_loops ; // number of loops in replay mode
......
...@@ -80,7 +80,7 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -80,7 +80,7 @@ unsigned short config_frames[4] = {2,9,11,13};
//#include "PHY/TOOLS/time_meas.h" //#include "PHY/TOOLS/time_meas.h"
#ifndef OPENAIR2 #ifndef OPENAIR2
#include "UTIL/OTG/otg_vars.h" #include "UTIL/OTG/otg_vars.h"
#endif #endif
...@@ -256,6 +256,7 @@ void exit_function(const char *file, const char *function, const int line, const ...@@ -256,6 +256,7 @@ void exit_function(const char *file, const char *function, const int line, const
if (s != NULL) { if (s != NULL) {
printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s); printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
} }
close_log_mem(); close_log_mem();
oai_exit = 1; oai_exit = 1;
...@@ -515,8 +516,7 @@ static void wait_nfapi_init(char *thread_name) { ...@@ -515,8 +516,7 @@ static void wait_nfapi_init(char *thread_name) {
printf( "NFAPI: got sync (%s)\n", thread_name); printf( "NFAPI: got sync (%s)\n", thread_name);
} }
int main ( int argc, char **argv ) int main ( int argc, char **argv ) {
{
int i; int i;
int CC_id = 0; int CC_id = 0;
int ru_id; int ru_id;
...@@ -531,14 +531,14 @@ int main ( int argc, char **argv ) ...@@ -531,14 +531,14 @@ int main ( int argc, char **argv )
logInit(); logInit();
printf("Reading in command-line options\n"); printf("Reading in command-line options\n");
get_options (); get_options ();
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) { if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
fprintf(stderr,"Getting configuration failed\n"); fprintf(stderr,"Getting configuration failed\n");
exit(-1); exit(-1);
} }
set_softmodem_optmask(SOFTMODEM_ENB_BIT);
set_softmodem_optmask(SOFTMODEM_ENB_BIT);
#if T_TRACER #if T_TRACER
T_Config_Init(); T_Config_Init();
#endif #endif
...@@ -598,6 +598,7 @@ int main ( int argc, char **argv ) ...@@ -598,6 +598,7 @@ int main ( int argc, char **argv )
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration; RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
} }
node_type = RC.rrc[0]->node_type; node_type = RC.rrc[0]->node_type;
} else { } else {
printf("RC.nb_inst = 0, Initializing L1\n"); printf("RC.nb_inst = 0, Initializing L1\n");
...@@ -614,7 +615,7 @@ int main ( int argc, char **argv ) ...@@ -614,7 +615,7 @@ int main ( int argc, char **argv )
ctxt.subframe = 0; ctxt.subframe = 0;
pdcp_run(&ctxt); pdcp_run(&ctxt);
} }
/* start threads if only L1 or not a CU */ /* start threads if only L1 or not a CU */
if (RC.nb_inst == 0 || !NODE_IS_CU(node_type) || NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) { if (RC.nb_inst == 0 || !NODE_IS_CU(node_type) || NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) {
// init UE_PF_PO and mutex lock // init UE_PF_PO and mutex lock
...@@ -623,27 +624,26 @@ int main ( int argc, char **argv ) ...@@ -623,27 +624,26 @@ int main ( int argc, char **argv )
mlockall(MCL_CURRENT | MCL_FUTURE); mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
rt_sleep_ns(10*100000000ULL); rt_sleep_ns(10*100000000ULL);
if (NFAPI_MODE!=NFAPI_MONOLITHIC) { if (NFAPI_MODE!=NFAPI_MONOLITHIC) {
LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n"); LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
} }
if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF if (NFAPI_MODE==NFAPI_MODE_VNF) {// VNF
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
init_ru_vnf(); // ru pointer is necessary for pre_scd. init_ru_vnf(); // ru pointer is necessary for pre_scd.
#endif #endif
wait_nfapi_init("main?"); wait_nfapi_init("main?");
} }
LOG_I(ENB_APP,"START MAIN THREADS\n"); LOG_I(ENB_APP,"START MAIN THREADS\n");
// start the main threads // start the main threads
number_of_cards = 1; number_of_cards = 1;
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst); printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
if (RC.nb_L1_inst > 0) { 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); 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); init_eNB(get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
...@@ -655,25 +655,25 @@ int main ( int argc, char **argv ) ...@@ -655,25 +655,25 @@ int main ( int argc, char **argv )
printf("wait_eNBs()\n"); printf("wait_eNBs()\n");
wait_eNBs(); wait_eNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU); printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator. // RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
// but RU thread deals with pre_scd and this is necessary in VNF and simulator. // but RU thread deals with pre_scd and this is necessary in VNF and simulator.
// some initialization is necessary and init_ru_vnf do this. // some initialization is necessary and init_ru_vnf do this.
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) { if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
printf("Initializing RU threads\n"); printf("Initializing RU threads\n");
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync); init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->clock_source,get_softmodem_params()->timing_source,get_softmodem_params()->send_dmrs_sync);
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.card=0;
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset); RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
} }
config_sync_var=0; config_sync_var=0;
if (NFAPI_MODE==NFAPI_MODE_PNF) { // PNF if (NFAPI_MODE==NFAPI_MODE_PNF) { // PNF
wait_nfapi_init("main?"); wait_nfapi_init("main?");
} }
printf("wait RUs\n"); printf("wait RUs\n");
// CI -- Flushing the std outputs for the previous marker to show on the eNB / RRU log file // CI -- Flushing the std outputs for the previous marker to show on the eNB / RRU log file
fflush(stdout); fflush(stdout);
...@@ -701,15 +701,18 @@ int main ( int argc, char **argv ) ...@@ -701,15 +701,18 @@ int main ( int argc, char **argv )
pthread_mutex_unlock(&sync_mutex); pthread_mutex_unlock(&sync_mutex);
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS); config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
} }
// wait for end of program // wait for end of program
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n"); LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
// CI -- Flushing the std outputs for the previous marker to show on the eNB / DU / CU log file // CI -- Flushing the std outputs for the previous marker to show on the eNB / DU / CU log file
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
// end of CI modifications // end of CI modifications
//getchar(); //getchar();
if(IS_SOFTMODEM_DOFORMS) if(IS_SOFTMODEM_DOFORMS)
load_softscope("enb"); load_softscope("enb");
itti_wait_tasks_end(); itti_wait_tasks_end();
oai_exit=1; oai_exit=1;
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit); LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
...@@ -727,8 +730,8 @@ int main ( int argc, char **argv ) ...@@ -727,8 +730,8 @@ int main ( int argc, char **argv )
* threads have been stopped (they partially use the same memory) */ * threads have been stopped (they partially use the same memory) */
for (int inst = 0; inst < NB_eNB_INST; inst++) { for (int inst = 0; inst < NB_eNB_INST; inst++) {
for (int cc_id = 0; cc_id < RC.nb_CC[inst]; cc_id++) { for (int cc_id = 0; cc_id < RC.nb_CC[inst]; cc_id++) {
free_transport(RC.eNB[inst][cc_id]); free_transport(RC.eNB[inst][cc_id]);
phy_free_lte_eNB(RC.eNB[inst][cc_id]); phy_free_lte_eNB(RC.eNB[inst][cc_id]);
} }
} }
...@@ -746,17 +749,17 @@ int main ( int argc, char **argv ) ...@@ -746,17 +749,17 @@ int main ( int argc, char **argv )
for(ru_id=0; ru_id<RC.nb_RU; ru_id++) { for(ru_id=0; ru_id<RC.nb_RU; ru_id++) {
if (RC.ru[ru_id]->rfdevice.trx_end_func) { if (RC.ru[ru_id]->rfdevice.trx_end_func) {
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice); RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
RC.ru[ru_id]->rfdevice.trx_end_func = NULL; RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
} }
if (RC.ru[ru_id]->ifdevice.trx_end_func) { if (RC.ru[ru_id]->ifdevice.trx_end_func) {
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice); RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
RC.ru[ru_id]->ifdevice.trx_end_func = NULL; RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
} }
} }
} }
terminate_opt(); terminate_opt();
logClean(); logClean();
printf("Bye.\n"); printf("Bye.\n");
......
...@@ -314,7 +314,6 @@ static void get_options(void) { ...@@ -314,7 +314,6 @@ static void get_options(void) {
int timingadv = 0; int timingadv = 0;
uint8_t nfapi_mode = NFAPI_MONOLITHIC; uint8_t nfapi_mode = NFAPI_MONOLITHIC;
int simL1flag = 0; int simL1flag = 0;
set_default_frame_parms(frame_parms); set_default_frame_parms(frame_parms);
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP); CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
/* unknown parameters on command line will be checked in main /* unknown parameters on command line will be checked in main
...@@ -593,7 +592,7 @@ int main( int argc, char **argv ) { ...@@ -593,7 +592,7 @@ int main( int argc, char **argv ) {
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23; for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
get_options (); get_options ();
set_softmodem_optmask(SOFTMODEM_LTEUE_BIT); set_softmodem_optmask(SOFTMODEM_LTEUE_BIT);
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
printf("Running with %d UE instances\n",NB_UE_INST); printf("Running with %d UE instances\n",NB_UE_INST);
...@@ -622,7 +621,6 @@ int main( int argc, char **argv ) { ...@@ -622,7 +621,6 @@ int main( int argc, char **argv ) {
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
printf("ITTI init\n"); printf("ITTI init\n");
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
...@@ -680,10 +678,7 @@ int main( int argc, char **argv ) { ...@@ -680,10 +678,7 @@ int main( int argc, char **argv ) {
} }
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
#if 0 // #ifndef DEADLINE_SCHEDULER #if 0 // #ifndef DEADLINE_SCHEDULER
printf("NO deadline scheduler\n"); printf("NO deadline scheduler\n");
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */ /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
cpu_set_t cpuset; cpu_set_t cpuset;
...@@ -692,16 +687,18 @@ int main( int argc, char **argv ) { ...@@ -692,16 +687,18 @@ int main( int argc, char **argv ) {
CPU_ZERO(&cpuset); CPU_ZERO(&cpuset);
#ifdef CPU_AFFINITY #ifdef CPU_AFFINITY
int j; int j;
if (get_nprocs() > 2) { if (get_nprocs() > 2) {
for (j = 2; j < get_nprocs(); j++) for (j = 2; j < get_nprocs(); j++)
CPU_SET(j, &cpuset); CPU_SET(j, &cpuset);
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0) { if (s != 0) {
perror( "pthread_setaffinity_np"); perror( "pthread_setaffinity_np");
exit_fun("Error setting processor affinity"); exit_fun("Error setting processor affinity");
} }
LOG_I(HW, "Setting the affinity of main function to all CPUs, for device library to use CPU 0 only!\n"); LOG_I(HW, "Setting the affinity of main function to all CPUs, for device library to use CPU 0 only!\n");
} }
......
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