Merged latest develop to nfapi
This commit is contained in:
+140
-194
@@ -40,7 +40,7 @@
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
#include "openair1/PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/phy_vars_nr_ue.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
//#include "../../SIMU/USER/init_lte.h"
|
||||
@@ -85,7 +85,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
// Raphael : missing
|
||||
extern const char *duplex_mode[];
|
||||
|
||||
// Thread variables
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
@@ -95,30 +97,40 @@ pthread_cond_t sync_cond;
|
||||
pthread_mutex_t sync_mutex;
|
||||
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
int config_sync_var=-1;
|
||||
tpool_t *Tpool;
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
volatile int start_eNB = 0;
|
||||
volatile int start_UE = 0;
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
int single_thread_flag=1;
|
||||
static double snr_dB=20;
|
||||
// Command line options
|
||||
|
||||
int threequarter_fs=0;
|
||||
extern int16_t nr_dlsch_demod_shift;
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
//int32_t uplink_counter = 0;
|
||||
|
||||
|
||||
extern int16_t nr_dlsch_demod_shift;
|
||||
|
||||
int UE_scan = 0;
|
||||
int UE_scan_carrier = 0;
|
||||
int UE_fo_compensation = 0;
|
||||
int single_thread_flag = 1;
|
||||
int threequarter_fs = 0;
|
||||
int UE_scan_carrier = 0;
|
||||
int UE_fo_compensation = 0;
|
||||
int UE_no_timing_correction = 0;
|
||||
runmode_t mode = normal_txrx;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int N_RB_DL = 0;
|
||||
int tddflag = 0;
|
||||
int vcdflag = 0;
|
||||
uint8_t nb_antenna_tx = 1;
|
||||
uint8_t nb_antenna_rx = 1;
|
||||
double rx_gain_off = 0.0;
|
||||
uint32_t timing_advance = 0;
|
||||
char *usrp_args = NULL;
|
||||
char *rrc_config_path = NULL;
|
||||
int dumpframe = 0;
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[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}};
|
||||
@@ -130,27 +142,9 @@ double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0},{20,0,0,0}};
|
||||
double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}};
|
||||
#endif
|
||||
|
||||
double rx_gain_off = 0.0;
|
||||
|
||||
double sample_rate=30.72e6;
|
||||
double bw = 10.0e6;
|
||||
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
|
||||
int chain_offset=0;
|
||||
|
||||
|
||||
uint8_t dci_Format = 0;
|
||||
uint8_t agregation_Level =0xFF;
|
||||
|
||||
uint8_t nb_antenna_tx = 1;
|
||||
uint8_t nb_antenna_rx = 1;
|
||||
|
||||
char ref[128] = "internal";
|
||||
char channels[128] = "0";
|
||||
|
||||
// UE and OAI config variables
|
||||
|
||||
<<<<<<< HEAD
|
||||
int rx_input_level_dBm;
|
||||
|
||||
//static int online_log_messages=0;
|
||||
@@ -178,26 +172,25 @@ int usrp_tx_thread = 0;
|
||||
//eth_params_t *eth_params;
|
||||
|
||||
double cpuf;
|
||||
=======
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
int otg_enabled;
|
||||
double cpuf;
|
||||
|
||||
runmode_t mode = normal_txrx;
|
||||
int UE_scan = 0;
|
||||
int chain_offset = 0;
|
||||
uint64_t num_missed_slots = 0; // counter for the number of missed slots
|
||||
int transmission_mode = 1;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
int oaisim_flag = 0;
|
||||
int emulate_rf = 0;
|
||||
>>>>>>> fork_develop_new
|
||||
|
||||
char uecap_xer[1024],uecap_xer_in=0;
|
||||
|
||||
int oaisim_flag=0;
|
||||
int emulate_rf = 0;
|
||||
|
||||
tpool_t *Tpool;
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
|
||||
char *usrp_args=NULL;
|
||||
|
||||
char *rrc_config_path=NULL;
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
*/
|
||||
@@ -246,6 +239,7 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
exit(1);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
void reset_stats(long arg) {
|
||||
//int i,j,k;
|
||||
@@ -277,6 +271,8 @@ void reset_stats(long arg) {
|
||||
}*/
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> fork_develop_new
|
||||
void *l2l1_task(void *arg) {
|
||||
MessageDef *message_p = NULL;
|
||||
int result;
|
||||
@@ -317,21 +313,12 @@ void *l2l1_task(void *arg) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int16_t dlsch_demod_shift;
|
||||
|
||||
static void get_options(void) {
|
||||
int CC_id;
|
||||
int tddflag=0, nonbiotflag, vcdflag=0;
|
||||
|
||||
char *loopfile=NULL;
|
||||
int dumpframe=0;
|
||||
//uint32_t noS1;
|
||||
//uint32_t nokrnmod;
|
||||
//uint32_t nokrnmod;
|
||||
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
|
||||
|
||||
paramdef_t cmdline_uemodeparams[] = CMDLINE_UEMODEPARAMS_DESC;
|
||||
paramdef_t cmdline_ueparams[] = CMDLINE_NRUEPARAMS_DESC;
|
||||
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
|
||||
@@ -352,54 +339,12 @@ static void get_options(void) {
|
||||
if (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr)
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
||||
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
|
||||
UE_scan=0;
|
||||
|
||||
if (tddflag > 0) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
frame_parms[CC_id]->frame_type = TDD;
|
||||
}
|
||||
if ((cmdline_uemodeparams[CMDLINE_DUMPMEMORY_IDX].paramflags & PARAMFLAG_PARAMSET) != 0)
|
||||
mode = rx_dump_frame;
|
||||
|
||||
if (vcdflag > 0)
|
||||
ouput_vcd = 1;
|
||||
|
||||
/*if (frame_parms[0]->N_RB_DL !=0) {
|
||||
if ( frame_parms[0]->N_RB_DL < 6 ) {
|
||||
frame_parms[0]->N_RB_DL = 6;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 100;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 50;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||
frame_parms[0]->N_RB_DL = 25;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
UE_scan = 0;
|
||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
||||
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
||||
}
|
||||
}*/
|
||||
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
}
|
||||
|
||||
|
||||
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) {
|
||||
// Here the configuration file is the XER encoded UE capabilities
|
||||
// Read it in and store in asn1c data structures
|
||||
@@ -409,44 +354,56 @@ static void get_options(void) {
|
||||
} /* UE with config file */
|
||||
}
|
||||
|
||||
// set PHY vars from command line
|
||||
void set_options(int CC_id, PHY_VARS_NR_UE *UE){
|
||||
|
||||
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||
int CC_id;
|
||||
// Init power variables
|
||||
tx_max_power[CC_id] = tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
/* Set some default values that may be overwritten while reading options */
|
||||
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) calloc(sizeof(NR_DL_FRAME_PARMS),1);
|
||||
frame_parms[CC_id]->nr_band = 78;
|
||||
frame_parms[CC_id]->frame_type = FDD;
|
||||
frame_parms[CC_id]->tdd_config = 3;
|
||||
//frame_parms[CC_id]->tdd_config_S = 0;
|
||||
frame_parms[CC_id]->N_RB_DL = 106;
|
||||
frame_parms[CC_id]->N_RB_UL = 106;
|
||||
frame_parms[CC_id]->Ncp = NORMAL;
|
||||
//frame_parms[CC_id]->Ncp_UL = NORMAL;
|
||||
frame_parms[CC_id]->Nid_cell = 0;
|
||||
//frame_parms[CC_id]->num_MBSFN_config = 0;
|
||||
frame_parms[CC_id]->nb_antenna_ports_gNB = 1;
|
||||
frame_parms[CC_id]->nb_antennas_tx = 1;
|
||||
frame_parms[CC_id]->nb_antennas_rx = 1;
|
||||
//frame_parms[CC_id]->nushift = 0;
|
||||
// NR: Init to legacy LTE 20Mhz params
|
||||
frame_parms[CC_id]->numerology_index = 0;
|
||||
frame_parms[CC_id]->ttis_per_subframe = 1;
|
||||
frame_parms[CC_id]->slots_per_tti = 2;
|
||||
// Set UE variables
|
||||
UE->UE_scan = UE_scan;
|
||||
UE->UE_scan_carrier = UE_scan_carrier;
|
||||
UE->UE_fo_compensation = UE_fo_compensation;
|
||||
UE->no_timing_correction = UE_no_timing_correction;
|
||||
UE->mode = mode;
|
||||
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];
|
||||
|
||||
LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan %d, UE_scan_carrier %d, UE_no_timing_correction %d \n", mode, UE_fo_compensation, UE_scan, UE_scan_carrier, UE_no_timing_correction);
|
||||
|
||||
// Set FP variables
|
||||
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
|
||||
fp->nb_antennas_tx = nb_antenna_tx;
|
||||
fp->nb_antennas_rx = nb_antenna_rx;
|
||||
fp->threequarter_fs = threequarter_fs;
|
||||
if (tddflag){
|
||||
fp->frame_type = TDD;
|
||||
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
|
||||
}
|
||||
if (N_RB_DL){
|
||||
fp->N_RB_DL = N_RB_DL;
|
||||
LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", nb_antenna_rx, nb_antenna_tx, threequarter_fs);
|
||||
|
||||
}
|
||||
|
||||
void init_openair0(void) {
|
||||
int card;
|
||||
int i;
|
||||
int freq_off = 0;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[0][0]->frame_parms;
|
||||
|
||||
for (card=0; card<MAX_CARDS; card++) {
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
openair0_cfg[card].configFilename = NULL;
|
||||
openair0_cfg[card].threequarter_fs = frame_parms[0]->threequarter_fs;
|
||||
numerology = frame_parms[0]->numerology_index;
|
||||
openair0_cfg[card].threequarter_fs = frame_parms->threequarter_fs;
|
||||
numerology = frame_parms->numerology_index;
|
||||
|
||||
if(frame_parms[0]->N_RB_DL == 66) {
|
||||
if(frame_parms->N_RB_DL == 66) {
|
||||
if (numerology==3) {
|
||||
openair0_cfg[card].sample_rate=122.88e6;
|
||||
openair0_cfg[card].samples_per_frame = 1228800;
|
||||
@@ -454,7 +411,7 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}else if(frame_parms[0]->N_RB_DL == 32) {
|
||||
}else if(frame_parms->N_RB_DL == 32) {
|
||||
if (numerology==3) {
|
||||
openair0_cfg[card].sample_rate=61.44e6;
|
||||
openair0_cfg[card].samples_per_frame = 614400;
|
||||
@@ -462,9 +419,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}else if(frame_parms[0]->N_RB_DL == 217) {
|
||||
}else if(frame_parms->N_RB_DL == 217) {
|
||||
if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=92.16e6;
|
||||
openair0_cfg[card].samples_per_frame = 921600;
|
||||
}
|
||||
@@ -476,9 +433,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 273) {
|
||||
} else if(frame_parms->N_RB_DL == 273) {
|
||||
if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n");
|
||||
}
|
||||
else {
|
||||
@@ -489,9 +446,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 106) {
|
||||
} else if(frame_parms->N_RB_DL == 106) {
|
||||
if (numerology==0) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=23.04e6;
|
||||
openair0_cfg[card].samples_per_frame = 230400;
|
||||
} else {
|
||||
@@ -499,7 +456,7 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].samples_per_frame = 307200;
|
||||
}
|
||||
} else if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=46.08e6;
|
||||
openair0_cfg[card].samples_per_frame = 460800;
|
||||
}
|
||||
@@ -514,57 +471,44 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 50) {
|
||||
} else if(frame_parms->N_RB_DL == 50) {
|
||||
openair0_cfg[card].sample_rate=15.36e6;
|
||||
openair0_cfg[card].samples_per_frame = 153600;
|
||||
} else if (frame_parms[0]->N_RB_DL == 25) {
|
||||
} else if (frame_parms->N_RB_DL == 25) {
|
||||
openair0_cfg[card].sample_rate=7.68e6;
|
||||
openair0_cfg[card].samples_per_frame = 76800;
|
||||
} else if (frame_parms[0]->N_RB_DL == 6) {
|
||||
} else if (frame_parms->N_RB_DL == 6) {
|
||||
openair0_cfg[card].sample_rate=1.92e6;
|
||||
openair0_cfg[card].samples_per_frame = 19200;
|
||||
}
|
||||
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->N_RB_DL);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (frame_parms[0]->frame_type==TDD)
|
||||
if (frame_parms->frame_type==TDD)
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
|
||||
else //FDD
|
||||
else
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
||||
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %hhu/%hhu\n",card,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].Mod_id = 0;
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL;
|
||||
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
|
||||
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
|
||||
openair0_cfg[card].tx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].tx_num_channels = min(2, frame_parms->nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels = min(2, frame_parms->nb_antennas_rx);
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
if (i<openair0_cfg[card].tx_num_channels)
|
||||
openair0_cfg[card].tx_freq[i] = frame_parms[0]->ul_CarrierFreq;
|
||||
else
|
||||
openair0_cfg[card].tx_freq[i]=0.0;
|
||||
LOG_I(PHY, "HW: Configuring card %d, tx/rx num_channels %d/%d, duplex_mode %s\n",
|
||||
card,
|
||||
openair0_cfg[card].tx_num_channels,
|
||||
openair0_cfg[card].rx_num_channels,
|
||||
duplex_mode[openair0_cfg[card].duplex_mode]);
|
||||
|
||||
if (i<openair0_cfg[card].rx_num_channels)
|
||||
openair0_cfg[card].rx_freq[i] = frame_parms[0]->dl_CarrierFreq;
|
||||
else
|
||||
openair0_cfg[card].rx_freq[i]=0.0;
|
||||
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
openair0_cfg[card].autocal[i] = 1;
|
||||
openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
|
||||
openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB - rx_gain_off;
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
|
||||
card,i, openair0_cfg[card].tx_gain[i],
|
||||
openair0_cfg[card].rx_gain[i],
|
||||
openair0_cfg[card].tx_freq[i],
|
||||
openair0_cfg[card].rx_freq[i]);
|
||||
}
|
||||
nr_rf_card_config(&openair0_cfg[card], rx_gain_off, ul_carrier, dl_carrier, freq_off);
|
||||
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
|
||||
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
|
||||
|
||||
@@ -608,14 +552,12 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
set_softmodem_sighandler();
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
set_default_frame_parms(frame_parms);
|
||||
mode = normal_txrx;
|
||||
memset(openair0_cfg,0,sizeof(openair0_config_t)*MAX_CARDS);
|
||||
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
|
||||
// initialize logging
|
||||
logInit();
|
||||
// get options and fill parameters from configuration file
|
||||
get_options (); //Command-line options, enb_properties
|
||||
get_options(); //Command-line options
|
||||
get_common_options(SOFTMODEM_5GUE_BIT );
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
@@ -650,14 +592,6 @@ int main( int argc, char **argv ) {
|
||||
init_NR_UE(1,rrc_config_path);
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
init_pdcp();
|
||||
/*
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
NB_UE_INST=1;
|
||||
NB_INST=1;
|
||||
@@ -668,23 +602,19 @@ int main( int argc, char **argv ) {
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
|
||||
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
|
||||
frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
|
||||
frame_parms[CC_id]->nb_antenna_ports_gNB = 1; //initial value overwritten by initial sync later
|
||||
frame_parms[CC_id]->threequarter_fs = threequarter_fs;
|
||||
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx);
|
||||
|
||||
PHY_vars_UE_g[0][CC_id] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
|
||||
|
||||
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
|
||||
memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE));
|
||||
|
||||
set_options(CC_id, UE[CC_id]);
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL)
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
<<<<<<< HEAD
|
||||
nr_init_frame_parms_ue(frame_parms[CC_id],nrUE_config,NORMAL);
|
||||
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
@@ -751,10 +681,23 @@ int main( int argc, char **argv ) {
|
||||
if (UE[CC_id]->frame_parms.threequarter_fs == 1) factor = factor*.75;
|
||||
UE[CC_id]->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d)\n", UE[CC_id]->Mod_id, UE[CC_id]->N_TA_offset, factor, UE[CC_id]->frame_parms.ul_CarrierFreq, N_RB);
|
||||
=======
|
||||
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
init_symbol_rotation(&UE[CC_id]->frame_parms, UE[CC_id]->frame_parms.dl_CarrierFreq);
|
||||
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
|
||||
|
||||
#ifdef FR2_TEST
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0){
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
if (frame_parms[CC_id]->frame_type == TDD)
|
||||
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
|
||||
>>>>>>> fork_develop_new
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// printf("tx_max_power = %d -> amp %d\n",tx_max_power[0],get_tx_amp(tx_max_poHwer,tx_max_power));
|
||||
init_openair0();
|
||||
// init UE_PF_PO and mutex lock
|
||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||
@@ -765,7 +708,10 @@ int main( int argc, char **argv ) {
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
load_softscope("nr",PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
number_of_cards = 1;
|
||||
=======
|
||||
>>>>>>> fork_develop_new
|
||||
|
||||
for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
|
||||
Reference in New Issue
Block a user