All 4 nr<e-(ue)softmodems are compiling
This commit is contained in:
+27
-17
@@ -74,7 +74,7 @@
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "enb_config.h"
|
||||
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
#ifndef OPENAIR2
|
||||
#include "UTIL/OTG/otg_extern.h"
|
||||
@@ -98,7 +98,7 @@ struct timing_info_t {
|
||||
// Fix per CC openair rf/if device update
|
||||
// extern openair0_device openair0;
|
||||
|
||||
extern volatile int oai_exit;
|
||||
extern volatile int oai_exit;
|
||||
|
||||
extern int transmission_mode;
|
||||
|
||||
@@ -107,6 +107,8 @@ extern int oaisim_flag;
|
||||
//uint16_t sf_ahead=4;
|
||||
extern uint16_t sf_ahead;
|
||||
|
||||
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
|
||||
//pthread_t main_eNB_thread;
|
||||
|
||||
@@ -147,7 +149,10 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
|
||||
|
||||
|
||||
static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) {
|
||||
static inline int rxtx(PHY_VARS_eNB *eNB,
|
||||
L1_rxtx_proc_t *proc,
|
||||
char *thread_name)
|
||||
{
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
//L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx;
|
||||
// *******************************************************************
|
||||
@@ -421,20 +426,21 @@ static void *L1_thread( void *param ) {
|
||||
void eNB_top(PHY_VARS_eNB *eNB,
|
||||
int frame_rx,
|
||||
int subframe_rx,
|
||||
char *string,RU_t *ru)
|
||||
char *string,
|
||||
RU_t *ru)
|
||||
{
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
proc->frame_rx = frame_rx;
|
||||
proc->subframe_rx = subframe_rx;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
L1_rxtx_proc_t *L1_proc= &proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
RU_proc_t *ru_proc = &ru->proc;
|
||||
proc->frame_rx = frame_rx;
|
||||
proc->subframe_rx = subframe_rx;
|
||||
|
||||
if (!oai_exit) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
L1_proc->frame_rx = ru_proc->frame_rx;
|
||||
L1_proc->subframe_rx = ru_proc->subframe_rx;
|
||||
L1_proc->subframe_rx = ru_proc->tti_rx;
|
||||
L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx;
|
||||
L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10;
|
||||
|
||||
@@ -442,7 +448,7 @@ void eNB_top(PHY_VARS_eNB *eNB,
|
||||
LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
|
||||
|
||||
ru_proc->timestamp_tx = L1_proc->timestamp_tx;
|
||||
ru_proc->subframe_tx = L1_proc->subframe_tx;
|
||||
ru_proc->tti_tx = L1_proc->subframe_tx;
|
||||
ru_proc->frame_tx = L1_proc->frame_tx;
|
||||
}
|
||||
}
|
||||
@@ -472,12 +478,12 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,
|
||||
ru_proc = &ru->proc;
|
||||
|
||||
if (ru_proc->instance_cnt_eNBs == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx);
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->tti_tx, proc->frame_rx, proc->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs );
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->tti_rx&1,ru_proc->instance_cnt_eNBs );
|
||||
exit_fun( "error locking mutex_eNB" );
|
||||
return(-1);
|
||||
}
|
||||
@@ -540,7 +546,7 @@ int wakeup_tx(PHY_VARS_eNB *eNB)
|
||||
int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
RU_t *ru)
|
||||
{
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
L1_proc_t *proc =&eNB->proc;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
@@ -592,7 +598,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
// and proc->subframe_tx = proc->subframe_rx+sf_ahead
|
||||
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
L1_proc->frame_rx = ru_proc->frame_rx;
|
||||
L1_proc->subframe_rx = ru_proc->subframe_rx;
|
||||
L1_proc->subframe_rx = ru_proc->tti_rx;
|
||||
L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx;
|
||||
L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10;
|
||||
|
||||
@@ -607,7 +613,11 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
return(0);
|
||||
}
|
||||
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,
|
||||
RU_t *ru,
|
||||
int frame,
|
||||
int subframe)
|
||||
{
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
|
||||
+66
-72
@@ -100,26 +100,21 @@ static int DEFENBS[] = {0};
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "pdcp.h"
|
||||
|
||||
extern volatile int oai_exit;
|
||||
extern volatile int oai_exit;
|
||||
extern int emulate_rf;
|
||||
extern int numerology;
|
||||
extern clock_source_t clock_source;
|
||||
extern uint8_t dlsch_ue_select_tbl_in_use;
|
||||
|
||||
|
||||
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
extern void phy_init_RU(RU_t *);
|
||||
extern void phy_free_RU(RU_t *);
|
||||
|
||||
extern void phy_init_RU(RU_t *);
|
||||
|
||||
void stop_RU(int nb_ru);
|
||||
void do_ru_sync(RU_t *ru);
|
||||
void do_ru_synch(RU_t *ru);
|
||||
|
||||
void configure_ru(int idx,
|
||||
void *arg);
|
||||
@@ -134,6 +129,7 @@ int connect_rau(RU_t *ru);
|
||||
extern uint16_t sf_ahead;
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
extern uint8_t dlsch_ue_select_tbl_in_use;
|
||||
void init_ru_vnf(void);
|
||||
#endif
|
||||
|
||||
@@ -548,7 +544,7 @@ void fh_if4p5_north_in(RU_t *ru,
|
||||
/// **** incoming IF4p5 from remote RCC/RAU **** ///
|
||||
symbol_number = 0;
|
||||
symbol_mask = 0;
|
||||
symbol_mask_full = (1<<ru->frame_parms.symbols_per_tti)-1;
|
||||
symbol_mask_full = (1<<ru->frame_parms->symbols_per_tti)-1;
|
||||
|
||||
do {
|
||||
recv_IF4p5(ru, frame, subframe, &packet_type, &symbol_number);
|
||||
@@ -700,6 +696,7 @@ static void *emulatedRF_thread(void *param) {
|
||||
req.tv_sec = 0;
|
||||
req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2;
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
CPU_SET(1,&cpuset);
|
||||
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
int policy;
|
||||
@@ -848,7 +845,7 @@ void tx_rf(RU_t *ru,int frame,int subframe,uint64_t timestamp) {
|
||||
|
||||
lte_subframe_t SF_type = subframe_select(fp,subframe%10);
|
||||
lte_subframe_t prevSF_type = subframe_select(fp,(subframe+9)%10);
|
||||
lte_subframe_t nextSF_type = subframe_select(fp,(subframe+1)%10);
|
||||
//lte_subframe_t nextSF_type = subframe_select(fp,(subframe+1)%10);
|
||||
int sf_extension = 0;
|
||||
|
||||
if ((SF_type == SF_DL) ||
|
||||
@@ -982,7 +979,7 @@ static void *ru_thread_asynch_rxtx( void *param )
|
||||
if (ru->fh_south_asynch_in) ru->fh_south_asynch_in(ru,&frame,&subframe);
|
||||
// asynchronous receive from north (RRU IF4/IF5)
|
||||
else if (ru->fh_north_asynch_in) {
|
||||
if (subframe_select(&ru->frame_parms,subframe)!=SF_UL)
|
||||
if (subframe_select(ru->frame_parms,subframe)!=SF_UL)
|
||||
ru->fh_north_asynch_in(ru,&frame,&subframe);
|
||||
} else AssertFatal(1==0,"Unknown function in ru_thread_asynch_rxtx\n");
|
||||
}
|
||||
@@ -1227,9 +1224,8 @@ void do_ru_synch(RU_t *ru)
|
||||
|
||||
void wakeup_L1s(RU_t *ru)
|
||||
{
|
||||
int i;
|
||||
PHY_VARS_eNB **eNB_list = ru->eNB_list;
|
||||
LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
|
||||
LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB, ru->idx, ru->eNB_top);
|
||||
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) {
|
||||
// call eNB function directly
|
||||
@@ -1241,12 +1237,11 @@ void wakeup_L1s(RU_t *ru)
|
||||
} else {
|
||||
LOG_D(PHY,"ru->num_eNB:%d\n", ru->num_eNB);
|
||||
|
||||
for (i=0; i<ru->num_eNB; i++) {
|
||||
for (int i=0; i<ru->num_eNB; i++) {
|
||||
LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
|
||||
eNB_list[i]->proc.ru_proc = &ru->proc;
|
||||
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
|
||||
{
|
||||
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.tti_rx);
|
||||
|
||||
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0) {
|
||||
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.tti_rx);
|
||||
}
|
||||
|
||||
ru->proc.emulate_rf_busy = 0;
|
||||
@@ -1631,7 +1626,7 @@ static void *ru_thread( void *param )
|
||||
pthread_setname_np( pthread_self(),"ru thread");
|
||||
LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid));
|
||||
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]);
|
||||
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx, NB_functions[ru->function], NB_timing[ru->if_timing]);
|
||||
|
||||
if(get_softmodem_params()->emulate_rf) {
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
@@ -1656,7 +1651,7 @@ static void *ru_thread( void *param )
|
||||
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
init_frame_parms(ru->frame_parms,1);
|
||||
phy_init_RU(ru);
|
||||
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
|
||||
}
|
||||
@@ -2115,8 +2110,8 @@ extern void ru_fep_full_2thread(RU_t *ru,int subframe);
|
||||
extern void feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
|
||||
extern void feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
|
||||
extern void feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
|
||||
extern void init_fep_thread(RU_t *ru);
|
||||
extern void init_feptx_thread(RU_t *ru);
|
||||
extern void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep);
|
||||
extern void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx);
|
||||
extern void kill_fep_thread(RU_t *ru);
|
||||
extern void kill_feptx_thread(RU_t *ru);
|
||||
|
||||
@@ -2238,8 +2233,8 @@ void init_RU_proc(RU_t *ru) {
|
||||
}
|
||||
|
||||
if (get_thread_worker_conf() == WORKER_ENABLE) {
|
||||
init_fep_thread(ru,NULL);
|
||||
init_feptx_thread(ru,NULL);
|
||||
init_fep_thread(ru, NULL);
|
||||
init_feptx_thread(ru, NULL);
|
||||
}
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&ru->ru_stats_thread,NULL,ru_stats_thread,(void *)ru);
|
||||
@@ -2377,12 +2372,12 @@ int check_capabilities(RU_t *ru,
|
||||
FH_fmt_options_t fmt = cap->FH_fmt;
|
||||
int i;
|
||||
int found_band=0;
|
||||
LOG_I(PHY,"RRU %d, num_bands %d, looking for band %d\n",ru->idx,cap->num_bands,ru->frame_parms.eutra_band);
|
||||
LOG_I(PHY,"RRU %d, num_bands %d, looking for band %d\n",ru->idx,cap->num_bands,ru->frame_parms->eutra_band);
|
||||
|
||||
for (i=0; i<cap->num_bands; i++) {
|
||||
LOG_I(PHY,"band %d on RRU %d\n",cap->band_list[i],ru->idx);
|
||||
|
||||
if (ru->frame_parms.eutra_band == cap->band_list[i]) {
|
||||
if (ru->frame_parms->eutra_band == cap->band_list[i]) {
|
||||
found_band=1;
|
||||
break;
|
||||
}
|
||||
@@ -2447,20 +2442,20 @@ void configure_ru(int idx,
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
// Pass configuration to RRU
|
||||
|
||||
LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms.eutra_band);
|
||||
LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms->eutra_band);
|
||||
// wait for configuration
|
||||
config->FH_fmt = ru->if_south;
|
||||
config->num_bands = 1;
|
||||
config->band_list[0] = ru->frame_parms.eutra_band;
|
||||
config->tx_freq[0] = ru->frame_parms.dl_CarrierFreq;
|
||||
config->rx_freq[0] = ru->frame_parms.ul_CarrierFreq;
|
||||
config->tdd_config[0] = ru->frame_parms.tdd_config;
|
||||
config->tdd_config_S[0] = ru->frame_parms.tdd_config_S;
|
||||
config->band_list[0] = ru->frame_parms->eutra_band;
|
||||
config->tx_freq[0] = ru->frame_parms->dl_CarrierFreq;
|
||||
config->rx_freq[0] = ru->frame_parms->ul_CarrierFreq;
|
||||
config->tdd_config[0] = ru->frame_parms->tdd_config;
|
||||
config->tdd_config_S[0] = ru->frame_parms->tdd_config_S;
|
||||
config->att_tx[0] = ru->att_tx;
|
||||
config->att_rx[0] = ru->att_rx;
|
||||
config->N_RB_DL[0] = ru->frame_parms.N_RB_DL;
|
||||
config->N_RB_UL[0] = ru->frame_parms.N_RB_UL;
|
||||
config->threequarter_fs[0] = ru->frame_parms.threequarter_fs;
|
||||
config->N_RB_DL[0] = ru->frame_parms->N_RB_DL;
|
||||
config->N_RB_UL[0] = ru->frame_parms->N_RB_UL;
|
||||
config->threequarter_fs[0] = ru->frame_parms->threequarter_fs;
|
||||
|
||||
if (ru->if_south==REMOTE_IF4p5) {
|
||||
config->prach_FreqOffset[0] = ru->frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset;
|
||||
@@ -2471,9 +2466,9 @@ void configure_ru(int idx,
|
||||
int i;
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i];
|
||||
config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i];
|
||||
config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i];
|
||||
config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i];
|
||||
config->emtc_prach_FreqOffset[0][i] = ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i];
|
||||
config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i];
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2487,44 +2482,44 @@ void configure_rru(int idx,
|
||||
void *arg)
|
||||
{
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RU_t *ru = RC.ru[idx];
|
||||
RU_t *ru = RC.ru[idx];
|
||||
|
||||
ru->frame_parms.eutra_band = config->band_list[0];
|
||||
ru->frame_parms.dl_CarrierFreq = config->tx_freq[0];
|
||||
ru->frame_parms.ul_CarrierFreq = config->rx_freq[0];
|
||||
ru->frame_parms->eutra_band = config->band_list[0];
|
||||
ru->frame_parms->dl_CarrierFreq = config->tx_freq[0];
|
||||
ru->frame_parms->ul_CarrierFreq = config->rx_freq[0];
|
||||
|
||||
if (ru->frame_parms.dl_CarrierFreq == ru->frame_parms.ul_CarrierFreq) {
|
||||
if (ru->frame_parms->dl_CarrierFreq == ru->frame_parms->ul_CarrierFreq) {
|
||||
LOG_I(PHY,"Setting RRU to TDD frame type\n");
|
||||
ru->frame_parms.frame_type = TDD;
|
||||
ru->frame_parms.tdd_config = config->tdd_config[0];
|
||||
ru->frame_parms.tdd_config_S = config->tdd_config_S[0];
|
||||
} else ru->frame_parms.frame_type = FDD;
|
||||
ru->frame_parms->frame_type = TDD;
|
||||
ru->frame_parms->tdd_config = config->tdd_config[0];
|
||||
ru->frame_parms->tdd_config_S = config->tdd_config_S[0];
|
||||
} else ru->frame_parms->frame_type = FDD;
|
||||
|
||||
ru->att_tx = config->att_tx[0];
|
||||
ru->att_rx = config->att_rx[0];
|
||||
ru->frame_parms.N_RB_DL = config->N_RB_DL[0];
|
||||
ru->frame_parms.N_RB_UL = config->N_RB_UL[0];
|
||||
ru->frame_parms.threequarter_fs = config->threequarter_fs[0];
|
||||
ru->frame_parms.pdsch_config_common.referenceSignalPower = ru->max_pdschReferenceSignalPower-config->att_tx[0];
|
||||
ru->att_tx = config->att_tx[0];
|
||||
ru->att_rx = config->att_rx[0];
|
||||
ru->frame_parms->N_RB_DL = config->N_RB_DL[0];
|
||||
ru->frame_parms->N_RB_UL = config->N_RB_UL[0];
|
||||
ru->frame_parms->threequarter_fs = config->threequarter_fs[0];
|
||||
ru->frame_parms->pdsch_config_common.referenceSignalPower = ru->max_pdschReferenceSignalPower-config->att_tx[0];
|
||||
|
||||
if (ru->function==NGFI_RRU_IF4p5) {
|
||||
ru->frame_parms.att_rx = ru->att_rx;
|
||||
ru->frame_parms.att_tx = ru->att_tx;
|
||||
ru->frame_parms->att_rx = ru->att_rx;
|
||||
ru->frame_parms->att_tx = ru->att_tx;
|
||||
LOG_I(PHY,"Setting ru->function to NGFI_RRU_IF4p5, prach_FrequOffset %d, prach_ConfigIndex %d, att (%d,%d)\n",
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0],ru->att_tx,ru->att_rx);
|
||||
ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = config->prach_FreqOffset[0];
|
||||
ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = config->prach_ConfigIndex[0];
|
||||
ru->frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset = config->prach_FreqOffset[0];
|
||||
ru->frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex = config->prach_ConfigIndex[0];
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
for (int i=0; i<4; i++) {
|
||||
ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] = config->emtc_prach_CElevel_enable[0][i];
|
||||
ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i] = config->emtc_prach_FreqOffset[0][i];
|
||||
ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i] = config->emtc_prach_ConfigIndex[0][i];
|
||||
ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] = config->emtc_prach_CElevel_enable[0][i];
|
||||
ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i] = config->emtc_prach_FreqOffset[0][i];
|
||||
ru->frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i] = config->emtc_prach_ConfigIndex[0][i];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
init_frame_parms(ru->frame_parms,1);
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
phy_init_RU(ru);
|
||||
}
|
||||
@@ -2638,7 +2633,7 @@ void set_function_spec_param(RU_t *ru)
|
||||
/*
|
||||
if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise
|
||||
fill_rf_config(ru,rf_config_file);
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
init_frame_parms(ru->frame_parms,1);
|
||||
phy_init_RU(ru);
|
||||
}
|
||||
|
||||
@@ -2720,7 +2715,7 @@ void init_RU(char *rf_config_file)
|
||||
{
|
||||
int ru_id;
|
||||
RU_t *ru;
|
||||
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
|
||||
PHY_VARS_eNB *eNB0 = (PHY_VARS_eNB *)NULL;
|
||||
LTE_DL_FRAME_PARMS *fp = (LTE_DL_FRAME_PARMS *)NULL;
|
||||
int i;
|
||||
int CC_id;
|
||||
@@ -2784,7 +2779,7 @@ void init_RU(char *rf_config_file)
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
|
||||
LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],NB_timing[ru->if_timing],ru->function);
|
||||
set_function_spec_param(ru);
|
||||
LOG_I(PHY,"Starting ru_thread %d\n",ru_id);
|
||||
init_RU_proc(ru);
|
||||
@@ -2874,7 +2869,7 @@ void init_ru_vnf(void) {
|
||||
}
|
||||
}
|
||||
*/
|
||||
LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
|
||||
LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],NB_timing[ru->if_timing],ru->function);
|
||||
// set_function_spec_param(ru);
|
||||
LOG_I(PHY,"Starting ru_thread %d\n",ru_id);
|
||||
// init_RU_proc(ru);
|
||||
@@ -2897,8 +2892,7 @@ void init_ru_vnf(void) {
|
||||
/* from here function to use configuration module */
|
||||
void RCconfig_RU(void)
|
||||
{
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
int i = 0;
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
|
||||
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
|
||||
@@ -2908,7 +2902,7 @@ void RCconfig_RU(void)
|
||||
RC.ru_mask=(1<<RC.nb_RU) - 1;
|
||||
printf("Set RU mask to %lx\n",RC.ru_mask);
|
||||
|
||||
for (j = 0; j < RC.nb_RU; j++) {
|
||||
for (int j = 0; j < RC.nb_RU; j++) {
|
||||
RC.ru[j] = (RU_t *)malloc(sizeof(RU_t));
|
||||
memset((void *)RC.ru[j],0,sizeof(RU_t));
|
||||
RC.ru[j]->idx = j;
|
||||
@@ -2989,12 +2983,12 @@ void RCconfig_RU(void)
|
||||
} //strcmp(local_rf, "yes") == 0
|
||||
else {
|
||||
printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
|
||||
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
|
||||
|
||||
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
|
||||
|
||||
@@ -60,6 +60,7 @@ void get_common_options(void) {
|
||||
uint32_t nonbiot;
|
||||
uint32_t rfsim;
|
||||
uint32_t basicsim;
|
||||
uint32_t do_forms;
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
|
||||
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
|
||||
checkedparam_t cmdline_log_CheckParams[] = CMDLINE_LOGPARAMS_CHECK_DESC;
|
||||
@@ -100,6 +101,10 @@ void get_common_options(void) {
|
||||
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT);
|
||||
}
|
||||
|
||||
if (do_forms) {
|
||||
set_softmodem_optmask(SOFTMODEM_DOFORMS_BIT);
|
||||
}
|
||||
|
||||
#if BASIC_SIMULATOR
|
||||
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT);
|
||||
#endif
|
||||
|
||||
+16
-154
@@ -64,6 +64,7 @@
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
#include "PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#ifdef SMBV
|
||||
#include "PHY/TOOLS/smbv.h"
|
||||
@@ -90,22 +91,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifdef XFORMS
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#include "stats.h"
|
||||
#endif
|
||||
|
||||
#include "lte-softmodem.h"
|
||||
#include "NB_IoT_interface.h"
|
||||
#ifdef XFORMS
|
||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||
// at eNB 0, an UL scope for every UE
|
||||
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
|
||||
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||
char title[255];
|
||||
unsigned char scope_enb_num_ue = 2;
|
||||
static pthread_t forms_thread; //xforms
|
||||
#endif //XFORMS
|
||||
|
||||
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
@@ -137,7 +125,7 @@ FILE *input_fd=NULL;
|
||||
|
||||
|
||||
#if MAX_NUM_CCs == 1
|
||||
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
|
||||
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
|
||||
double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0}};
|
||||
double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0}};
|
||||
#else
|
||||
@@ -151,7 +139,6 @@ double rx_gain_off = 0.0;
|
||||
double sample_rate=30.72e6;
|
||||
double bw = 10.0e6;
|
||||
|
||||
|
||||
uint8_t dci_Format = 0;
|
||||
uint8_t agregation_Level =0xFF;
|
||||
|
||||
@@ -161,14 +148,8 @@ uint8_t nb_antenna_rx = 1;
|
||||
char ref[128] = "internal";
|
||||
char channels[128] = "0";
|
||||
|
||||
int rx_input_level_dBm;
|
||||
|
||||
#ifdef XFORMS
|
||||
extern int otg_enabled;
|
||||
#else
|
||||
int otg_enabled;
|
||||
#endif
|
||||
//int number_of_cards = 1;
|
||||
int rx_input_level_dBm;
|
||||
int otg_enabled;
|
||||
|
||||
|
||||
uint8_t exit_missed_slots=1;
|
||||
@@ -192,7 +173,7 @@ eth_params_t *eth_params;
|
||||
double cpuf;
|
||||
|
||||
int oaisim_flag=0;
|
||||
threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
//threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
@@ -302,75 +283,6 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef XFORMS
|
||||
|
||||
|
||||
void reset_stats(FL_OBJECT *button, long arg) {
|
||||
int i,j,k;
|
||||
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
for (k=0; k<8; k++) { //harq_processes
|
||||
for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) {
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0;
|
||||
}
|
||||
|
||||
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void *scope_thread(void *arg) {
|
||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||
FILE *eNB_stats;
|
||||
# endif
|
||||
struct sched_param sched_param;
|
||||
int UE_id, CC_id;
|
||||
int ue_cnt=0;
|
||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
|
||||
sched_setscheduler(0, SCHED_FIFO,&sched_param);
|
||||
printf("Scope thread has priority %d\n",sched_param.sched_priority);
|
||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||
eNB_stats = fopen("eNB_stats.txt", "w");
|
||||
#endif
|
||||
|
||||
while (!oai_exit) {
|
||||
ue_cnt=0;
|
||||
|
||||
for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
if ((ue_cnt<scope_enb_num_ue)) {
|
||||
phy_scope_eNB(form_enb[CC_id][ue_cnt],
|
||||
RC.eNB[0][CC_id],
|
||||
UE_id);
|
||||
ue_cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
// printf("%s",stats_buffer);
|
||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||
|
||||
if (eNB_stats) {
|
||||
rewind (eNB_stats);
|
||||
fwrite (stats_buffer, 1, len, eNB_stats);
|
||||
fclose (eNB_stats);
|
||||
}
|
||||
|
||||
# endif
|
||||
pthread_exit((void *)arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void get_options(void) {
|
||||
@@ -580,9 +492,11 @@ void init_pdcp(void) {
|
||||
if (!NODE_IS_DU(RC.rrc[0]->node_type)) {
|
||||
pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
|
||||
if (IS_SOFTMODEM_NOS1)
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
|
||||
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
|
||||
if (NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
@@ -609,14 +523,8 @@ static void wait_nfapi_init(char *thread_name) {
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
int i;
|
||||
#if defined (XFORMS)
|
||||
void *status;
|
||||
#endif
|
||||
int CC_id = 0;
|
||||
int ru_id;
|
||||
#if defined (XFORMS)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
if ( load_configmodule(argc,argv,0) == NULL) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
@@ -676,9 +584,9 @@ int main( int argc, char **argv ) {
|
||||
/* Read configuration */
|
||||
if (RC.nb_inst > 0) {
|
||||
read_config_and_init();
|
||||
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
RCconfig_flexran();
|
||||
|
||||
for (i = 0; i < RC.nb_inst; i++) {
|
||||
flexran_agent_start(i);
|
||||
}
|
||||
@@ -708,6 +616,8 @@ int main( int argc, char **argv ) {
|
||||
ctxt.instance = 0;
|
||||
ctxt.rnti = 0;
|
||||
ctxt.enb_flag = 1;
|
||||
ctxt.frame = 0;
|
||||
ctxt.subframe = 0;
|
||||
pdcp_run(&ctxt);
|
||||
}
|
||||
|
||||
@@ -719,42 +629,9 @@ int main( int argc, char **argv ) {
|
||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
pthread_cond_init(&sync_cond,NULL);
|
||||
pthread_mutex_init(&sync_mutex, NULL);
|
||||
#ifdef XFORMS
|
||||
int UE_id;
|
||||
printf("XFORMS\n");
|
||||
|
||||
if (get_softmodem_params()->do_forms==1) {
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_stats_l2 = create_form_stats_form();
|
||||
fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats");
|
||||
form_stats = create_form_stats_form();
|
||||
fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats");
|
||||
|
||||
for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) {
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
form_enb[CC_id][UE_id] = create_lte_phy_scope_enb();
|
||||
sprintf (title, "LTE UL SCOPE eNB for CC_id %d, UE %d",CC_id,UE_id);
|
||||
fl_show_form (form_enb[CC_id][UE_id]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
|
||||
if (otg_enabled) {
|
||||
fl_set_button(form_enb[CC_id][UE_id]->button_0,1);
|
||||
fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic ON");
|
||||
} else {
|
||||
fl_set_button(form_enb[CC_id][UE_id]->button_0,0);
|
||||
fl_set_object_label(form_enb[CC_id][UE_id]->button_0,"DL Traffic OFF");
|
||||
}
|
||||
} // CC_id
|
||||
} // UE_id
|
||||
|
||||
ret = pthread_create(&forms_thread, NULL, scope_thread, NULL);
|
||||
|
||||
if (ret == 0)
|
||||
pthread_setname_np( forms_thread, "xforms" );
|
||||
|
||||
printf("Scope thread created, ret=%d\n",ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
rt_sleep_ns(10*100000000ULL);
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MONOLITHIC) {
|
||||
@@ -840,32 +717,17 @@ int main( int argc, char **argv ) {
|
||||
fflush(stderr);
|
||||
// end of CI modifications
|
||||
//getchar();
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
load_softscope("enb");
|
||||
itti_wait_tasks_end();
|
||||
oai_exit=1;
|
||||
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
|
||||
// stop threads
|
||||
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
int UE_id;
|
||||
#ifdef XFORMS
|
||||
printf("waiting for XFORMS thread\n");
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
end_forms();
|
||||
|
||||
if (get_softmodem_params()->do_forms==1) {
|
||||
pthread_join(forms_thread,&status);
|
||||
fl_hide_form(form_stats->stats_form);
|
||||
fl_free_form(form_stats->stats_form);
|
||||
fl_hide_form(form_stats_l2->stats_form);
|
||||
fl_free_form(form_stats_l2->stats_form);
|
||||
|
||||
for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) {
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
fl_hide_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb);
|
||||
fl_free_form(form_enb[CC_id][UE_id]->lte_phy_scope_enb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
LOG_I(ENB_APP,"stopping MODEM threads\n");
|
||||
stop_eNB(NB_eNB_INST);
|
||||
stop_RU(RC.nb_RU);
|
||||
|
||||
@@ -127,46 +127,46 @@
|
||||
#define START_MSC softmodem_params.start_msc
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters specific to UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#define CMDLINE_UEPARAMS_DESC { \
|
||||
{"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \
|
||||
{"U", CONFIG_HLP_NUMUE, 0, u16ptr:&NB_UE_INST, defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \
|
||||
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \
|
||||
{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \
|
||||
{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \
|
||||
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:23, TYPE_INT, 0}, \
|
||||
{"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \
|
||||
{"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \
|
||||
{"num-ues", NULL, 0, u16ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"nums_ue_thread", NULL, 0, u16ptr:&(NB_THREAD_INST), defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
|
||||
{"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \
|
||||
{"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \
|
||||
{"U", CONFIG_HLP_NUMUE, 0, u16ptr:&NB_UE_INST, defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:130, TYPE_DOUBLE, 0}, \
|
||||
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \
|
||||
{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \
|
||||
{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&nb_antenna_rx, defuintval:1, TYPE_UINT8, 0}, \
|
||||
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:23, TYPE_INT, 0}, \
|
||||
{"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \
|
||||
{"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \
|
||||
{"num-ues", NULL, 0, u16ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"nums_ue_thread", NULL, 0, u16ptr:&(NB_THREAD_INST), defuintval:1, TYPE_UINT16, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
|
||||
{"usrp-clksrc", CONFIG_HLP_USRP_CLK_SRC,0, strptr:(char **)&usrp_clksrc, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters specific to UE threads */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters specific to UE threads */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_UETHREADSPARAMS_DESC { \
|
||||
{"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadThreeSubframe", NULL, 0, iptr:&(threads.three), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcOne", NULL, 0, iptr:&(threads.slot1_proc_one), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSlot1ProcTwo", NULL, 0, iptr:&(threads.slot1_proc_two), defintval:1, TYPE_INT, 0}, \
|
||||
}
|
||||
// {"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \
|
||||
|
||||
#define DEFAULT_DLF 2680000000
|
||||
|
||||
@@ -179,7 +179,6 @@
|
||||
#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 DO_FORMS softmodem_params.do_forms
|
||||
#define NUMEROLOGY softmodem_params.numerology
|
||||
#define EMULATE_RF softmodem_params.emulate_rf
|
||||
#define CLOCK_SOURCE softmodem_params.clock_source
|
||||
@@ -193,11 +192,9 @@
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 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}, \
|
||||
{"threadMain", NULL, 0, iptr:&(threads.main), defintval:1, TYPE_INT, 0}, \
|
||||
{"threadSync", NULL, 0, iptr:&(threads.sync), defintval:1, TYPE_INT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&DO_FORMS, defintval:0, TYPE_INT8, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 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}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \
|
||||
@@ -211,7 +208,7 @@
|
||||
}
|
||||
|
||||
#define CONFIG_HLP_FLOG "Enable online log \n"
|
||||
#define CONFIG_HLP_LOGL "Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
|
||||
#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
|
||||
#define CONFIG_HLP_TELN "Start embedded telnet server \n"
|
||||
#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n"
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
@@ -220,14 +217,15 @@
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define START_MSC softmodem_params.start_msc
|
||||
#define CMDLINE_LOGPARAMS_DESC { \
|
||||
{"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \
|
||||
{"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \
|
||||
{"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
|
||||
{"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \
|
||||
{"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \
|
||||
{"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \
|
||||
{"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
|
||||
{"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \
|
||||
}
|
||||
#define CMDLINE_ONLINELOG_IDX 0
|
||||
#define CMDLINE_GLOGLEVEL_IDX 1
|
||||
#define CMDLINE_STARTTELN_IDX 2
|
||||
#define CMDLINE_GLOGVERBO_IDX 2
|
||||
#define CMDLINE_STARTTELN_IDX 3
|
||||
|
||||
/* check function for global log level */
|
||||
#define CMDLINE_LOGPARAMS_CHECK_DESC { \
|
||||
@@ -240,6 +238,51 @@
|
||||
/***************************************************************************************************************************************/
|
||||
/* */
|
||||
#include "threads_t.h"
|
||||
//extern threads_t threads;
|
||||
|
||||
//extern THREAD_STRUCT thread_struct;
|
||||
THREAD_STRUCT thread_struct;
|
||||
|
||||
static inline void set_parallel_conf(char *parallel_conf) {
|
||||
mapping config[]= {
|
||||
FOREACH_PARALLEL(GENERATE_ENUMTXT)
|
||||
{NULL,-1}
|
||||
};
|
||||
thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
|
||||
if (thread_struct.parallel_conf == -1 ) {
|
||||
LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
|
||||
thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void set_worker_conf(char *worker_conf) {
|
||||
mapping config[]={
|
||||
FOREACH_WORKER(GENERATE_ENUMTXT)
|
||||
{NULL, -1}
|
||||
};
|
||||
thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
|
||||
if (thread_struct.worker_conf == -1 ) {
|
||||
LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
|
||||
thread_struct.worker_conf = WORKER_DISABLE ;
|
||||
}
|
||||
}
|
||||
|
||||
static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
|
||||
static inline WORKER_CONF_t get_thread_worker_conf(void) {
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
/*PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
WORKER_CONF_t get_thread_worker_conf(void);
|
||||
void set_parallel_conf(char *parallel_conf);
|
||||
void set_worker_conf(char *worker_conf);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#define SOFTMODEM_NOS1_BIT (1<<0)
|
||||
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
|
||||
@@ -247,6 +290,7 @@
|
||||
#define SOFTMODEM_RFSIM_BIT (1<<10)
|
||||
#define SOFTMODEM_BASICSIM_BIT (1<<11)
|
||||
#define SOFTMODEM_SIML1_BIT (1<<12)
|
||||
#define SOFTMODEM_DOFORMS_BIT (1<<15)
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
@@ -257,7 +301,6 @@ typedef struct {
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
uint32_t do_forms;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
@@ -270,6 +313,7 @@ typedef struct {
|
||||
#define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT)
|
||||
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
|
||||
#define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT)
|
||||
#define IS_SOFTMODEM_DOFORMS ( get_softmodem_optmask() & SOFTMODEM_DOFORMS_BIT)
|
||||
extern uint64_t get_softmodem_optmask(void);
|
||||
extern uint64_t set_softmodem_optmask(uint64_t bitmask);
|
||||
extern void get_common_options(void);
|
||||
@@ -316,7 +360,16 @@ extern void set_function_spec_param(RU_t *ru);
|
||||
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
extern void fill_ue_band_info(void);
|
||||
|
||||
extern void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction, int phy_test, int UE_scan, int UE_scan_carrier, runmode_t mode,int rxgain,int txpowermax,
|
||||
extern void init_UE(int nb_inst,
|
||||
int eMBMS_active,
|
||||
int uecap_xer_in,
|
||||
int timing_correction,
|
||||
int phy_test,
|
||||
int UE_scan,
|
||||
int UE_scan_carrier,
|
||||
runmode_t mode,
|
||||
int rxgain,
|
||||
int txpowermax,
|
||||
LTE_DL_FRAME_PARMS *fp);
|
||||
extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char *name);
|
||||
|
||||
@@ -337,11 +390,6 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
uint8_t abstraction_flag);
|
||||
void init_eNB_afterRU(void);
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
WORKER_CONF_t get_thread_worker_conf(void);
|
||||
void set_parallel_conf(char *parallel_conf);
|
||||
void set_worker_conf(char *worker_conf);
|
||||
|
||||
extern int stop_L1L2(module_id_t enb_id);
|
||||
extern int restart_L1L2(module_id_t enb_id);
|
||||
|
||||
|
||||
+23
-10
@@ -161,7 +161,7 @@ static const eutra_band_t eutra_bands[] = {
|
||||
};
|
||||
|
||||
|
||||
threads_t threads= {-1,-1,-1,-1,-1,-1,-1};
|
||||
threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
|
||||
pthread_t main_ue_thread;
|
||||
pthread_attr_t attr_UE_thread;
|
||||
@@ -286,8 +286,8 @@ void init_UE(int nb_inst,
|
||||
if ( !IS_SOFTMODEM_SIML1 ) PHY_vars_UE_g[inst][0] = init_ue_vars(fp0,inst,0);
|
||||
else {
|
||||
// needed for memcopy below. these are not used in the RU, but needed for UE
|
||||
RC.ru[0]->frame_parms.nb_antennas_rx = fp0->nb_antennas_rx;
|
||||
RC.ru[0]->frame_parms.nb_antennas_tx = fp0->nb_antennas_tx;
|
||||
RC.ru[0]->frame_parms->nb_antennas_rx = fp0->nb_antennas_rx;
|
||||
RC.ru[0]->frame_parms->nb_antennas_tx = fp0->nb_antennas_tx;
|
||||
PHY_vars_UE_g[inst][0] = init_ue_vars(&RC.ru[0]->frame_parms,inst,0);
|
||||
}
|
||||
|
||||
@@ -1524,6 +1524,7 @@ void *UE_thread(void *arg)
|
||||
int i;
|
||||
int th_id;
|
||||
static uint8_t thread_idx = 0;
|
||||
int ret;
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
if ( threads.main != -1 )
|
||||
@@ -1743,15 +1744,27 @@ void *UE_thread(void *arg)
|
||||
}
|
||||
|
||||
pickTime(gotIQs);
|
||||
struct timespec tv= {0};
|
||||
tv.tv_nsec=10*1000;
|
||||
|
||||
if( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM)
|
||||
tv.tv_sec=INT_MAX;
|
||||
/* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */
|
||||
if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) {
|
||||
ret = pthread_mutex_lock(&proc->mutex_rxtx);
|
||||
} else {
|
||||
struct timespec tv;
|
||||
if (clock_gettime(CLOCK_REALTIME, &tv) != 0) {
|
||||
perror("clock_gettime");
|
||||
exit(1);
|
||||
}
|
||||
tv.tv_nsec += 10*1000;
|
||||
if (tv.tv_nsec >= 1000 * 1000 * 1000) {
|
||||
tv.tv_sec++;
|
||||
tv.tv_nsec -= 1000 * 1000 * 1000;
|
||||
}
|
||||
ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv);
|
||||
}
|
||||
|
||||
// operate on thread sf mod 2
|
||||
if (pthread_mutex_timedlock(&proc->mutex_rxtx, &tv) !=0) {
|
||||
if ( errno == ETIMEDOUT) {
|
||||
if (ret != 0) {
|
||||
if (ret == ETIMEDOUT) {
|
||||
LOG_E(PHY,"Missed real time\n");
|
||||
continue;
|
||||
} else {
|
||||
@@ -1760,7 +1773,7 @@ void *UE_thread(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
//usleep(3000);
|
||||
// usleep(3000);
|
||||
if(sub_frame == 0) {
|
||||
//UE->proc.proc_rxtx[0].frame_rx++;
|
||||
//UE->proc.proc_rxtx[1].frame_rx++;
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_vars.h"
|
||||
#include "PHY_INTERFACE/phy_interface_vars.h"
|
||||
|
||||
#include "PHY/TOOLS/phy_scope_interface.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
@@ -85,26 +85,14 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifdef XFORMS
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#include "stats.h"
|
||||
#endif
|
||||
|
||||
#include "lte-softmodem.h"
|
||||
|
||||
|
||||
|
||||
/* temporary compilation wokaround (UE/eNB split */
|
||||
uint16_t sf_ahead;
|
||||
#ifdef XFORMS
|
||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||
// at eNB 0, an UL scope for every UE
|
||||
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
|
||||
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||
char title[255];
|
||||
unsigned char scope_enb_num_ue = 2;
|
||||
static pthread_t forms_thread; //xforms
|
||||
#endif //XFORMS
|
||||
|
||||
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
@@ -148,7 +136,7 @@ int snr_dB=25;
|
||||
runmode_t mode = normal_txrx;
|
||||
|
||||
FILE *input_fd=NULL;
|
||||
|
||||
int otg_enabled=0;
|
||||
|
||||
#if MAX_NUM_CCs == 1
|
||||
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
|
||||
@@ -179,10 +167,6 @@ char channels[128] = "0";
|
||||
|
||||
int rx_input_level_dBm;
|
||||
|
||||
#ifdef XFORMS
|
||||
extern int otg_enabled;
|
||||
#endif
|
||||
//int number_of_cards = 1;
|
||||
|
||||
|
||||
static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
@@ -218,7 +202,7 @@ extern char uecap_xer[1024];
|
||||
char uecap_xer_in=0;
|
||||
|
||||
int oaisim_flag=0;
|
||||
threads_t threads = {-1,-1,-1,-1,-1,-1,-1};
|
||||
//threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
@@ -329,72 +313,6 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef XFORMS
|
||||
|
||||
|
||||
void reset_stats(FL_OBJECT *button, long arg) {
|
||||
int i,j,k;
|
||||
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
for (k=0; k<8; k++) { //harq_processes
|
||||
for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) {
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0;
|
||||
}
|
||||
|
||||
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void *scope_thread(void *arg) {
|
||||
char stats_buffer[16384];
|
||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||
FILE *UE_stats, *eNB_stats;
|
||||
# endif
|
||||
struct sched_param sched_param;
|
||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
|
||||
sched_setscheduler(0, SCHED_FIFO,&sched_param);
|
||||
printf("Scope thread has priority %d\n",sched_param.sched_priority);
|
||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||
UE_stats = fopen("UE_stats.txt", "w");
|
||||
#endif
|
||||
|
||||
while (!oai_exit) {
|
||||
// dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm);
|
||||
//fl_set_object_label(form_stats->stats_text, stats_buffer);
|
||||
fl_clear_browser(form_stats->stats_text);
|
||||
fl_add_browser_line(form_stats->stats_text, stats_buffer);
|
||||
|
||||
phy_scope_UE(form_ue[0],
|
||||
PHY_vars_UE_g[0][0],
|
||||
0,
|
||||
0,
|
||||
7);
|
||||
usleep(10000);
|
||||
|
||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||
|
||||
if (UE_stats) {
|
||||
rewind (UE_stats);
|
||||
fwrite (stats_buffer, 1, len, UE_stats);
|
||||
fclose (UE_stats);
|
||||
}
|
||||
|
||||
# endif
|
||||
pthread_exit((void *)arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
extern int16_t dlsch_demod_shift;
|
||||
|
||||
static void get_options(void) {
|
||||
@@ -676,9 +594,6 @@ void init_pdcp(void) {
|
||||
}
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
#if defined (XFORMS)
|
||||
void *status;
|
||||
#endif
|
||||
int CC_id;
|
||||
uint8_t abstraction_flag=0;
|
||||
#ifdef UESIM_EXPANSION
|
||||
@@ -688,9 +603,6 @@ int main( int argc, char **argv ) {
|
||||
// if not changed from the command line option --num-ues
|
||||
NB_UE_INST=1;
|
||||
NB_THREAD_INST=1;
|
||||
#if defined (XFORMS)
|
||||
int ret;
|
||||
#endif
|
||||
configmodule_interface_t *config_mod;
|
||||
start_background_system();
|
||||
config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
|
||||
@@ -751,9 +663,7 @@ int main( int argc, char **argv ) {
|
||||
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
init_opt();
|
||||
|
||||
init_pdcp();
|
||||
|
||||
//TTN for D2D
|
||||
printf ("RRC control socket\n");
|
||||
rrc_control_socket_init();
|
||||
@@ -904,37 +814,9 @@ int main( int argc, char **argv ) {
|
||||
PHY_vars_UE_g[0][0]->no_timing_correction = 1;
|
||||
}
|
||||
|
||||
#ifdef XFORMS
|
||||
int UE_id;
|
||||
printf("XFORMS\n");
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
load_softscope("ue");
|
||||
|
||||
if (get_softmodem_params()->do_forms==1) {
|
||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||
form_stats = create_form_stats_form();
|
||||
fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats");
|
||||
UE_id = 0;
|
||||
form_ue[UE_id] = create_lte_phy_scope_ue();
|
||||
sprintf (title, "LTE DL SCOPE UE");
|
||||
fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||
/*
|
||||
if (openair_daq_vars.use_ia_receiver) {
|
||||
fl_set_button(form_ue[UE_id]->button_0,1);
|
||||
fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver ON");
|
||||
} else {
|
||||
fl_set_button(form_ue[UE_id]->button_0,0);
|
||||
fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF");
|
||||
}*/
|
||||
fl_set_button(form_ue[UE_id]->button_0,0);
|
||||
fl_set_object_label(form_ue[UE_id]->button_0, "IA Receiver OFF");
|
||||
ret = pthread_create(&forms_thread, NULL, scope_thread, NULL);
|
||||
|
||||
if (ret == 0)
|
||||
pthread_setname_np( forms_thread, "xforms" );
|
||||
|
||||
printf("Scope thread created, ret=%d\n",ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
printf("Sending sync to all threads (%p,%p,%p)\n",&sync_var,&sync_cond,&sync_mutex);
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
@@ -963,19 +845,11 @@ int main( int argc, char **argv ) {
|
||||
|
||||
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
||||
#endif
|
||||
|
||||
// stop threads
|
||||
#ifdef XFORMS
|
||||
printf("waiting for XFORMS thread\n");
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
end_forms();
|
||||
|
||||
if (get_softmodem_params()->do_forms==1) {
|
||||
pthread_join(forms_thread,&status);
|
||||
fl_hide_form(form_stats->stats_form);
|
||||
fl_free_form(form_stats->stats_form);
|
||||
fl_hide_form(form_ue[0]->lte_phy_scope_ue);
|
||||
fl_free_form(form_ue[0]->lte_phy_scope_ue);
|
||||
}
|
||||
|
||||
#endif
|
||||
printf("stopping MODEM threads\n");
|
||||
pthread_cond_destroy(&sync_cond);
|
||||
pthread_mutex_destroy(&sync_mutex);
|
||||
|
||||
Reference in New Issue
Block a user