Merge branch 'eurecom-develop' into episys/merge_nsa_w_develop
At this point we are successfully able to build. Additionally, we can run the scenario, however, it does not pass. It seems that the gNB is not connecting to the proxy correctly. Just wanted to push the progress so far. FYI, the items that had to be changed to correct the linking issues were the following: - mac_rrc_data_ind_ue vs. nr_mac_rrc_data_ind_ue - rrc_data_req vs. nr_rrc_data_req - mac_rrc_data_req_ue vs. nr_mac_rrc_data_req_ue - rrc_data_req_ue vs. rrc_data_req_nr_ue - rrc_data_req vs. nr_rrc_data_req The listed functions should be declard in the LTE/NR UE directory depending on the functionality. Several were mixed. i.e.: LTE functions being called in NR UE. Also, removing siWindowLength, siWindowLength_int, SIBType, SIBPeriod, and siPeriod_int from the NR UE RRC. These variable were not used in the NR UE and are defined for LTE only. Lastly, in the NR_IF_Module.c of the NR UE, the global variable def_dci_pdu_rel15 is not accessible. Need to revisit this. For not it is commented out.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
[*]
|
||||
[*] GTKWave Analyzer v3.3.66 (w)1999-2015 BSI
|
||||
[*] Sun May 19 21:39:57 2019
|
||||
[*] Tue Jan 26 21:45:57 2021
|
||||
[*]
|
||||
[dumpfile] "/tmp/openair_dump_eNB.vcd"
|
||||
[dumpfile_mtime] "Sun May 19 21:30:25 2019"
|
||||
[dumpfile_size] 11590554
|
||||
[savefile] "/home/sphex/raymond/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
|
||||
[timestart] 7629910000
|
||||
[size] 1840 795
|
||||
[dumpfile] "/home/eurecom/raymond/gtkw/openair_dump_eNB.vcd"
|
||||
[dumpfile_mtime] "Tue Jan 26 21:26:33 2021"
|
||||
[dumpfile_size] 180869253
|
||||
[savefile] "/home/eurecom/raymond/openairinterface5g_2/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
|
||||
[timestart] 11468800000
|
||||
[size] 1693 785
|
||||
[pos] -1 -1
|
||||
*-21.832302 7639830000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[sst_width] 386
|
||||
@@ -16,17 +16,22 @@
|
||||
[sst_vpaned_height] 303
|
||||
@28
|
||||
functions.trx_read
|
||||
@29
|
||||
functions.trx_write_thread
|
||||
@28
|
||||
functions.trx_write
|
||||
@24
|
||||
variables.trx_ts[63:0]
|
||||
variables.trx_tst[63:0]
|
||||
variables.trx_write_flags[63:0]
|
||||
@28
|
||||
functions.eNB_thread_rxtx0
|
||||
@420
|
||||
variables.l1_proc_tx_ic[63:0]
|
||||
variables.l1_proc_ic[63:0]
|
||||
@24
|
||||
variables.frame_number_RX0_RU[63:0]
|
||||
@25
|
||||
variables.tti_number_RX0_RU[63:0]
|
||||
@24
|
||||
variables.frame_number_TX0_RU[63:0]
|
||||
variables.tti_number_TX0_RU[63:0]
|
||||
@28
|
||||
|
||||
+80
-66
@@ -70,6 +70,7 @@
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
@@ -96,6 +97,9 @@
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
//#define DEBUG_THREADS 1
|
||||
|
||||
//#define USRP_DEBUG 1
|
||||
@@ -261,7 +265,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
|
||||
eNB->UL_INFO.subframe = proc->subframe_rx;
|
||||
eNB->UL_INFO.module_id = eNB->Mod_id;
|
||||
eNB->UL_INFO.CC_id = eNB->CC_id;
|
||||
eNB->if_inst->UL_indication(&eNB->UL_INFO, proc);
|
||||
eNB->if_inst->UL_indication(&eNB->UL_INFO, (void*)proc);
|
||||
AssertFatal((ret= pthread_mutex_unlock(&eNB->UL_INFO_mutex))==0,"error unlocking UL_INFO_mutex, return %d\n",ret);
|
||||
/* this conflict resolution may be totally wrong, to be tested */
|
||||
/* CONFLICT RESOLUTION: BEGIN */
|
||||
@@ -323,7 +327,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
|
||||
static void *L1_thread_tx(void *param) {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
PHY_VARS_eNB *eNB = eNB_proc->eNB;
|
||||
char thread_name[100];
|
||||
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
@@ -331,6 +335,7 @@ static void *L1_thread_tx(void *param) {
|
||||
|
||||
//wait_sync("tx_thread");
|
||||
|
||||
proc->respEncode = eNB->proc.L1_proc.respEncode;
|
||||
while (!oai_exit) {
|
||||
LOG_D(PHY,"Waiting for TX (IC %d)\n",proc->instance_cnt);
|
||||
|
||||
@@ -351,21 +356,19 @@ static void *L1_thread_tx(void *param) {
|
||||
LOG_D(PHY,"L1 TX processing %d.%d\n",proc->frame_tx,proc->subframe_tx);
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
AssertFatal((ret= pthread_mutex_lock( &proc->mutex ))==0,"error locking L1_proc_tx mutex, return %d\n",ret);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,proc->instance_cnt);
|
||||
int subframe_tx = proc->subframe_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
uint64_t timestamp_tx = proc->timestamp_tx;
|
||||
proc->instance_cnt = -1;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,proc->instance_cnt);
|
||||
LOG_D(PHY,"L1 TX signaling done for %d.%d\n",proc->frame_tx,proc->subframe_tx);
|
||||
// the thread can now be woken up
|
||||
LOG_D(PHY,"L1_thread_tx: signaling completion in %d.%d\n",proc->frame_tx,proc->subframe_tx);
|
||||
|
||||
if (pthread_cond_signal(&proc->cond) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
|
||||
AssertFatal((ret=pthread_cond_signal(&proc->cond))== 0, "ERROR pthread_cond_signal for eNB TXnp4 thread ret %d\n",ret);
|
||||
AssertFatal((ret= pthread_mutex_unlock( &proc->mutex ))==0,"error unlocking L1_proc_tx mutex, return %d\n",ret);
|
||||
|
||||
|
||||
wakeup_txfh(eNB,proc,frame_tx,subframe_tx,timestamp_tx);
|
||||
}
|
||||
|
||||
@@ -391,6 +394,8 @@ static void *L1_thread( void *param ) {
|
||||
}
|
||||
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
|
||||
|
||||
char thread_name[100];
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
@@ -414,7 +419,7 @@ static void *L1_thread( void *param ) {
|
||||
LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid));
|
||||
|
||||
while (!oai_exit) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0, 0 );
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
LOG_D(PHY,"L1RX waiting for RU RX\n");
|
||||
|
||||
@@ -422,7 +427,7 @@ static void *L1_thread( void *param ) {
|
||||
|
||||
LOG_D(PHY,"L1RX starting in %d.%d\n",proc->frame_rx,proc->subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0, 1 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB,proc->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB,proc->subframe_rx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB,proc->frame_tx);
|
||||
@@ -436,6 +441,8 @@ static void *L1_thread( void *param ) {
|
||||
|
||||
LOG_D(PHY,"L1 RX %d.%d done\n",proc->frame_rx,proc->subframe_rx);
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC, proc->instance_cnt);
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx,proc->timestamp_tx);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) {
|
||||
@@ -444,9 +451,7 @@ static void *L1_thread( void *param ) {
|
||||
}
|
||||
}
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
} // while !oai_exit
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||
LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
|
||||
eNB_thread_rxtx_status = 0;
|
||||
@@ -542,6 +547,7 @@ int wakeup_txfh(PHY_VARS_eNB *eNB,
|
||||
AssertFatal(pthread_cond_signal(&ru_proc->cond_eNBs) == 0,
|
||||
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&ru_proc->mutex_eNBs))==0,"mutex_unlock returned %d\n",ret);
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
@@ -554,19 +560,19 @@ int wakeup_tx(PHY_VARS_eNB *eNB,
|
||||
int frame_tx,
|
||||
int subframe_tx,
|
||||
uint64_t timestamp_tx) {
|
||||
L1_rxtx_proc_t *L1_proc = &eNB->proc.L1_proc;
|
||||
L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx;
|
||||
int ret;
|
||||
LOG_D(PHY,"ENTERED wakeup_tx (IC %d)\n",L1_proc_tx->instance_cnt);
|
||||
// check if subframe is a has TX else return
|
||||
if (subframe_select(&eNB->frame_parms,subframe_tx) == SF_UL) return 0;
|
||||
AssertFatal((ret = pthread_mutex_lock(&L1_proc_tx->mutex))==0,"mutex_lock returns %d\n",ret);
|
||||
LOG_D(PHY,"L1 RX %d.%d Waiting to wake up L1 TX %d.%d (IC L1TX %d)\n",L1_proc->frame_rx,L1_proc->subframe_rx,L1_proc->frame_tx,L1_proc->subframe_tx,L1_proc_tx->instance_cnt);
|
||||
LOG_D(PHY,"L1 RX %d.%d Waiting to wake up L1 TX %d.%d (IC L1TX %d)\n",frame_rx,subframe_rx,frame_tx,subframe_tx,L1_proc_tx->instance_cnt);
|
||||
|
||||
while(L1_proc_tx->instance_cnt == 0) {
|
||||
pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"L1 RX Got signal that TX %d.%d is done\n",L1_proc_tx->frame_tx,L1_proc_tx->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,L1_proc_tx->instance_cnt);
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,L1_proc_tx->instance_cnt);
|
||||
L1_proc_tx->subframe_rx = subframe_rx;
|
||||
@@ -575,9 +581,11 @@ int wakeup_tx(PHY_VARS_eNB *eNB,
|
||||
L1_proc_tx->frame_tx = frame_tx;
|
||||
L1_proc_tx->timestamp_tx = timestamp_tx;
|
||||
// the thread can now be woken up
|
||||
LOG_D(PHY,"L1 RX Waking up L1 TX %d.%d\n",L1_proc->frame_tx,L1_proc->subframe_tx);
|
||||
LOG_D(PHY,"L1 RX Waking up L1 TX %d.%d\n",frame_tx,subframe_tx);
|
||||
|
||||
AssertFatal(pthread_cond_signal(&L1_proc_tx->cond) == 0, "ERROR pthread_cond_signal for eNB L1 thread tx\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&L1_proc_tx->mutex))==0,"mutex_unlock returns %d\n",ret);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -597,10 +605,16 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"mutex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
/* AssertFatal(1==0,"L1_thread isn't ready in %d.%d (L1RX %d.%d), aborting RX, exiting\n",
|
||||
ru_proc->frame_rx,ru_proc->tti_rx,L1_proc->frame_rx,L1_proc->subframe_rx);
|
||||
*/
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC, L1_proc->instance_cnt);
|
||||
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// transmitted timestamp of the next TX slot (first).
|
||||
@@ -618,14 +632,12 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_TX_RU+ru->idx, L1_proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU+ru->idx, L1_proc->subframe_tx);
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&L1_proc->cond) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RXn-TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// the thread can now be woken up
|
||||
AssertFatal((ret=pthread_cond_signal(&L1_proc->cond))== 0, "ERROR pthread_cond_signal for eNB RXn-TXnp4 thread, ret %d\n",ret);
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"mutex_unlock return %d\n",ret);
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -849,6 +861,21 @@ static void *process_stats_thread(void *param) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void *L1_stats_thread(void *param) {
|
||||
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
|
||||
wait_sync("L1_stats_thread");
|
||||
FILE *fd;
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
fd=fopen("L1_stats.log","w");
|
||||
AssertFatal(fd!=NULL,"Cannot open L1_stats.log\n");
|
||||
dump_I0_stats(fd,eNB);
|
||||
dump_ulsch_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
|
||||
dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
|
||||
fclose(fd);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void init_eNB_proc(int inst) {
|
||||
/*int i=0;*/
|
||||
@@ -870,6 +897,7 @@ void init_eNB_proc(int inst) {
|
||||
L1_proc_tx->instance_cnt = -1;
|
||||
L1_proc->instance_cnt_RUs = 0;
|
||||
L1_proc_tx->instance_cnt_RUs = 0;
|
||||
proc->eNB = eNB;
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_synch = -1;
|
||||
@@ -951,10 +979,8 @@ void init_eNB_proc(int inst) {
|
||||
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
if (opp_enabled == 1)
|
||||
{
|
||||
pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
}
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
pthread_create(&proc->L1_stats_thread,NULL,L1_stats_thread,(void*)eNB);
|
||||
}
|
||||
|
||||
//for multiple CCs: setup master and slaves
|
||||
@@ -1085,60 +1111,47 @@ void print_opp_meas(void) {
|
||||
|
||||
|
||||
void free_transport(PHY_VARS_eNB *eNB) {
|
||||
for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||
for (int i=0; i<NUMBER_OF_DLSCH_MAX; i++) {
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffers for DLSCH %d\n",i);
|
||||
|
||||
for (int j=0; j<2; j++) free_eNB_dlsch(eNB->dlsch[i][j]);
|
||||
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||
free_eNB_ulsch(eNB->ulsch[1+i]);
|
||||
}
|
||||
|
||||
free_eNB_ulsch(eNB->ulsch[0]);
|
||||
for (int i=0;i<NUMBER_OF_ULSCH_MAX;i++) {
|
||||
LOG_D(PHY, "Freeing Transport Channel Buffer for ULSCH %d\n",i);
|
||||
free_eNB_ulsch(eNB->ulsch[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_transport(PHY_VARS_eNB *eNB) {
|
||||
int i;
|
||||
int j;
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
LOG_I(PHY, "Initialise transport\n");
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||
for (int i=0;i<NUMBER_OF_DLSCH_MAX; i++) {
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d/%d\n",i,NUMBER_OF_DLSCH_MAX,(i-NUMBER_OF_DLSCH_MAX)<0);
|
||||
|
||||
for (j=0; j<2; j++) {
|
||||
for (int j=0; j<2; j++) {
|
||||
eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL,0,fp);
|
||||
|
||||
LOG_I(PHY,"eNB->dlsch[%d][%d] %p\n",i,j,eNB->dlsch[i][j]);
|
||||
if (!eNB->dlsch[i][j]) {
|
||||
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
|
||||
LOG_E(PHY,"Can't get eNB dlsch structures for DLSCH %d \n", i);
|
||||
exit(-1);
|
||||
} else {
|
||||
eNB->dlsch[i][j]->rnti=0;
|
||||
LOG_D(PHY,"dlsch[%d][%d] => %p rnti:%d\n",i,j,eNB->dlsch[i][j], eNB->dlsch[i][j]->rnti);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0;i<NUMBER_OF_ULSCH_MAX; i++) {
|
||||
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||
eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0);
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,NUMBER_OF_ULSCH_MAX);
|
||||
eNB->ulsch[i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0);
|
||||
|
||||
if (!eNB->ulsch[1+i]) {
|
||||
if (!eNB->ulsch[i]) {
|
||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// this is the transmission mode for the signalling channels
|
||||
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
|
||||
eNB->transmission_mode[i] = fp->nb_antenna_ports_eNB==1 ? 1 : 2;
|
||||
}
|
||||
|
||||
// ULSCH for RA
|
||||
eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, fp->N_RB_UL, 0);
|
||||
|
||||
if (!eNB->ulsch[0]) {
|
||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
eNB->dlsch_SI = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
||||
@@ -1151,7 +1164,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
|
||||
eNB->rx_total_gain_dB=130;
|
||||
|
||||
for(i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||
for(int i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||
eNB->mu_mimo_mode[i].dl_pow_off = 2;
|
||||
|
||||
eNB->check_for_total_transmissions = 0;
|
||||
@@ -1159,11 +1172,13 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
eNB->FULL_MUMIMO_transmissions = 0;
|
||||
eNB->check_for_SUMIMO_transmissions = 0;
|
||||
fp->pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
if (eNB->use_DTX == 0) fill_subframe_mask(eNB);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void init_eNB_afterRU(void) {
|
||||
int inst,CC_id,ru_id,i,aa;
|
||||
int inst,CC_id,i;
|
||||
PHY_VARS_eNB *eNB;
|
||||
LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst);
|
||||
|
||||
@@ -1173,13 +1188,14 @@ void init_eNB_afterRU(void) {
|
||||
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
||||
LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.eNB[inst][CC_id]);
|
||||
eNB = RC.eNB[inst][CC_id];
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
|
||||
// map antennas and PRACH signals to eNB RX
|
||||
if (0) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
||||
|
||||
// map antennas and PRACH signals to eNB RX
|
||||
LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
|
||||
eNB->frame_parms.nb_antennas_rx = 0;
|
||||
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
|
||||
if (NFAPI_MODE==NFAPI_MODE_PNF) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
||||
for (int ru_id=0; ru_id<eNB->num_RU; ru_id++)
|
||||
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
||||
phy_init_lte_eNB(eNB,0,0);
|
||||
LOG_I(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
|
||||
eNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||
|
||||
@@ -1188,10 +1204,8 @@ void init_eNB_afterRU(void) {
|
||||
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||
}
|
||||
|
||||
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
|
||||
|
||||
for (ru_id=0,aa=0; ru_id<eNB->num_RU; ru_id++) {
|
||||
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
||||
for (int ru_id=0,aa=0; ru_id<eNB->num_RU; ru_id++) {
|
||||
|
||||
AssertFatal(eNB->RU_list[ru_id]->common.rxdataF!=NULL,
|
||||
"RU %d : common.rxdataF is NULL\n",
|
||||
@@ -1239,7 +1253,7 @@ void init_eNB_afterRU(void) {
|
||||
init_eNB_proc(inst);
|
||||
}
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id);
|
||||
RC.ru[ru_id]->wakeup_rxtx = wakeup_rxtx;
|
||||
RC.ru[ru_id]->wakeup_prach_eNB = wakeup_prach_eNB;
|
||||
|
||||
+279
-260
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,7 @@
|
||||
#include <sched.h>
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
#include <common/utils/msc/msc.h>
|
||||
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
@@ -56,6 +57,8 @@
|
||||
|
||||
//#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/phy_extern_ue.h>
|
||||
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
@@ -103,7 +106,6 @@ pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
|
||||
|
||||
uint16_t sf_ahead=4;
|
||||
|
||||
pthread_cond_t sync_cond;
|
||||
@@ -164,16 +166,19 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *
|
||||
AssertFatal(false, "Must not be called in this context\n");
|
||||
}
|
||||
|
||||
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
|
||||
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
|
||||
extern void init_eNB_afterRU(void);
|
||||
|
||||
RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond);
|
||||
|
||||
int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
|
||||
THREAD_STRUCT thread_struct;
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
@@ -183,6 +188,7 @@ double cpuf;
|
||||
|
||||
int oaisim_flag=0;
|
||||
uint16_t ue_idx_standalone = 0xFFFF;
|
||||
uint8_t proto_agent_flag = 0;
|
||||
|
||||
|
||||
/* forward declarations */
|
||||
@@ -428,7 +434,6 @@ int stop_L1L2(module_id_t enb_id) {
|
||||
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
|
||||
*/
|
||||
int restart_L1L2(module_id_t enb_id) {
|
||||
RU_t *ru = RC.ru[enb_id];
|
||||
int cc_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
LOG_W(ENB_APP, "restarting lte-softmodem\n");
|
||||
@@ -439,10 +444,12 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
|
||||
for (cc_id = 0; cc_id < RC.nb_L1_CC[enb_id]; cc_id++) {
|
||||
RC.eNB[enb_id][cc_id]->configured = 0;
|
||||
for (int ru_id=0;ru_id<RC.eNB[enb_id][cc_id]->num_RU;ru_id++) {
|
||||
int ru_idx = RC.eNB[enb_id][cc_id]->RU_list[ru_id]->idx;
|
||||
RC.ru_mask |= (1 << ru_idx);
|
||||
set_function_spec_param(RC.ru[ru_idx]);
|
||||
}
|
||||
}
|
||||
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
set_function_spec_param(RC.ru[enb_id]);
|
||||
/* reset the list of connected UEs in the MAC, since in this process with
|
||||
* loose all UEs (have to reconnect) */
|
||||
init_UE_info(&RC.mac[enb_id]->UE_info);
|
||||
@@ -463,9 +470,15 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
||||
* broken, so we cannot test it */
|
||||
wait_eNBs();
|
||||
init_RU_proc(ru);
|
||||
ru->rf_map.card = 0;
|
||||
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||
for (int cc_id=0;cc_id<RC.nb_L1_CC[enb_id]; cc_id++) {
|
||||
for (int ru_id=0;ru_id<RC.eNB[enb_id][cc_id]->num_RU;ru_id++) {
|
||||
int ru_idx = RC.eNB[enb_id][cc_id]->RU_list[ru_id]->idx;
|
||||
|
||||
init_RU_proc(RC.ru[ru_idx]);
|
||||
RC.ru[ru_idx]->rf_map.card = 0;
|
||||
RC.ru[ru_idx]->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||
}
|
||||
}
|
||||
wait_RUs();
|
||||
init_eNB_afterRU();
|
||||
printf("Sending sync to all threads\n");
|
||||
@@ -593,7 +606,7 @@ int main ( int argc, char **argv )
|
||||
/* We need to read RU configuration before FlexRAN starts so it knows what
|
||||
* splits to report. Actual RU start comes later. */
|
||||
if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
RCconfig_RU();
|
||||
RC.ru = RCconfig_RU(RC.nb_RU,RC.nb_L1_inst,RC.eNB,&RC.ru_mask,&RC.ru_mutex,&RC.ru_cond);
|
||||
LOG_I(PHY,
|
||||
"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
|
||||
RC.nb_L1_inst, RC.nb_RU, get_nprocs());
|
||||
@@ -670,6 +683,7 @@ int main ( int argc, char **argv )
|
||||
for (int x=0; x < RC.nb_L1_inst; x++)
|
||||
for (int CC_id=0; CC_id<RC.nb_L1_CC[x]; CC_id++) {
|
||||
L1_rxtx_proc_t *L1proc= &RC.eNB[x][CC_id]->proc.L1_proc;
|
||||
L1_rxtx_proc_t *L1proctx= &RC.eNB[x][CC_id]->proc.L1_proc_tx;
|
||||
L1proc->threadPool=(tpool_t*)malloc(sizeof(tpool_t));
|
||||
L1proc->respEncode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
L1proc->respDecode=(notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
@@ -677,9 +691,11 @@ int main ( int argc, char **argv )
|
||||
initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool, true);
|
||||
else
|
||||
initTpool("n", L1proc->threadPool, true);
|
||||
initNotifiedFIFO(L1proc->respEncode);
|
||||
initNotifiedFIFO(L1proc->respDecode);
|
||||
RC.eNB[x][CC_id]->proc.L1_proc_tx.threadPool = L1proc->threadPool;
|
||||
initNotifiedFIFO(L1proc->respEncode);
|
||||
initNotifiedFIFO(L1proc->respDecode);
|
||||
L1proctx->threadPool=L1proc->threadPool;
|
||||
L1proctx->respEncode=L1proc->respEncode;
|
||||
L1proctx->nbEncode=L1proc->nbEncode;
|
||||
}
|
||||
|
||||
|
||||
@@ -694,7 +710,7 @@ int main ( int argc, char **argv )
|
||||
// some initialization is necessary and init_ru_vnf do this.
|
||||
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
printf("Initializing RU threads\n");
|
||||
init_RU(get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
|
||||
init_RU(RC.ru,RC.nb_RU,RC.eNB,RC.nb_L1_inst,RC.nb_L1_CC,get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
RC.ru[ru_id]->rf_map.card=0;
|
||||
@@ -744,7 +760,7 @@ int main ( int argc, char **argv )
|
||||
fflush(stderr);
|
||||
// end of CI modifications
|
||||
//getchar();
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
load_softscope("enb",NULL);
|
||||
itti_wait_tasks_end();
|
||||
|
||||
@@ -761,7 +777,7 @@ int main ( int argc, char **argv )
|
||||
|
||||
#if 0 //Disable clean up because this tends to crash (and unnecessary)
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(node_type)) {
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
end_forms();
|
||||
|
||||
LOG_I(ENB_APP,"stopping MODEM threads\n");
|
||||
|
||||
@@ -97,7 +97,6 @@
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#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}, \
|
||||
@@ -141,6 +140,9 @@ extern pthread_cond_t sync_cond;
|
||||
extern pthread_mutex_t sync_mutex;
|
||||
extern int sync_var;
|
||||
|
||||
extern uint16_t ue_id_g;
|
||||
extern uint16_t node_number;
|
||||
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
@@ -173,7 +175,7 @@ extern void init_RU_proc(RU_t *ru);
|
||||
extern void stop_RU(int nb_ru);
|
||||
extern void kill_RU_proc(RU_t *ru);
|
||||
extern void set_function_spec_param(RU_t *ru);
|
||||
extern void init_RU(char *, int send_dmrssync);
|
||||
extern void init_RU(RU_t **rup,int nb_RU,PHY_VARS_eNB ***eNBp,int nb_L1,int *nb_CC,char *rf_config_file, int send_dmrssync);
|
||||
|
||||
// In lte-ue.c
|
||||
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
@@ -201,7 +203,6 @@ extern void init_te_thread(PHY_VARS_eNB *);
|
||||
extern void kill_td_thread(PHY_VARS_eNB *);
|
||||
extern void kill_te_thread(PHY_VARS_eNB *);
|
||||
|
||||
extern void RCConfig_sim(void);
|
||||
extern void init_ocm(void);
|
||||
extern void init_ue_devices(PHY_VARS_UE *);
|
||||
|
||||
|
||||
+23
-23
@@ -32,6 +32,7 @@
|
||||
#include "lte-softmodem.h"
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
#include "system.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
@@ -87,6 +88,7 @@ extern void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
|
||||
extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
|
||||
|
||||
|
||||
int tx_req_num_elems;
|
||||
extern uint16_t sf_ahead;
|
||||
//extern int tx_req_UE_MAC1();
|
||||
|
||||
@@ -173,9 +175,8 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t abstraction_flag)
|
||||
|
||||
{
|
||||
PHY_VARS_UE *ue = (PHY_VARS_UE *)malloc(sizeof(PHY_VARS_UE));
|
||||
memset(ue,0,sizeof(PHY_VARS_UE));
|
||||
|
||||
PHY_VARS_UE *ue = (PHY_VARS_UE *)calloc(1,sizeof(PHY_VARS_UE));
|
||||
AssertFatal(ue,"");
|
||||
if (frame_parms!=(LTE_DL_FRAME_PARMS *)NULL) { // if we want to give initial frame parms, allocate the PHY_VARS_UE structure and put them in
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(LTE_DL_FRAME_PARMS));
|
||||
}
|
||||
@@ -222,14 +223,23 @@ void init_thread(int sched_runtime,
|
||||
}
|
||||
|
||||
#else
|
||||
int settingPriority = 1;
|
||||
|
||||
if (CPU_COUNT(cpuset) > 0)
|
||||
AssertFatal( 0 == pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), cpuset), "");
|
||||
if (checkIfFedoraDistribution())
|
||||
if (checkIfGenericKernelOnFedora())
|
||||
if (checkIfInsideContainer())
|
||||
settingPriority = 0;
|
||||
|
||||
if (settingPriority) {
|
||||
if (CPU_COUNT(cpuset) > 0)
|
||||
AssertFatal( 0 == pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), cpuset), "");
|
||||
|
||||
struct sched_param sp;
|
||||
sp.sched_priority = sched_fifo;
|
||||
AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)==0,
|
||||
"Can't set thread priority, Are you root?\n");
|
||||
}
|
||||
|
||||
struct sched_param sp;
|
||||
sp.sched_priority = sched_fifo;
|
||||
AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)==0,
|
||||
"Can't set thread priority, Are you root?\n");
|
||||
/* Check the actual affinity mask assigned to the thread */
|
||||
cpu_set_t *cset=CPU_ALLOC(CPU_SETSIZE);
|
||||
|
||||
@@ -275,13 +285,7 @@ void init_UE(int nb_inst,
|
||||
|
||||
LOG_I(PHY,"Allocating UE context %d\n",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;
|
||||
PHY_vars_UE_g[inst][0] = init_ue_vars(RC.ru[0]->frame_parms,inst,0);
|
||||
}
|
||||
PHY_vars_UE_g[inst][0] = init_ue_vars(fp0,inst,0);
|
||||
|
||||
// turn off timing control loop in UE
|
||||
PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction;
|
||||
@@ -363,17 +367,13 @@ void init_UE(int nb_inst,
|
||||
*/
|
||||
UE->N_TA_offset = 0;
|
||||
|
||||
if (IS_SOFTMODEM_SIML1 ) init_ue_devices(UE);
|
||||
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
|
||||
init_UE_threads(inst);
|
||||
|
||||
if (!IS_SOFTMODEM_SIML1 ) {
|
||||
ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
|
||||
ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
|
||||
|
||||
if (ret !=0) {
|
||||
exit_fun("Error loading device library");
|
||||
}
|
||||
if (ret !=0) {
|
||||
exit_fun("Error loading device library");
|
||||
}
|
||||
|
||||
UE->rfdevice.host_type = RAU_HOST;
|
||||
|
||||
@@ -83,10 +83,9 @@
|
||||
#include "create_tasks.h"
|
||||
#include "system.h"
|
||||
|
||||
|
||||
#include "lte-softmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
extern int ue_id_g;
|
||||
/* temporary compilation wokaround (UE/eNB split */
|
||||
|
||||
|
||||
@@ -168,7 +167,6 @@ extern void get_uethreads_params(void);
|
||||
|
||||
int transmission_mode=1;
|
||||
|
||||
int usrp_tx_thread = 0;
|
||||
|
||||
|
||||
char *usrp_args=NULL;
|
||||
@@ -194,6 +192,8 @@ int oaisim_flag=0;
|
||||
uint8_t abstraction_flag=0;
|
||||
|
||||
bler_struct bler_data[NUM_MCS];
|
||||
// needed for pdcp.c
|
||||
RAN_CONTEXT_t RC;
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
@@ -289,7 +289,6 @@ static void get_options(void) {
|
||||
int dumpframe=0;
|
||||
int timingadv=0;
|
||||
uint8_t nfapi_mode = NFAPI_MONOLITHIC;
|
||||
int simL1flag =0;
|
||||
|
||||
set_default_frame_parms(frame_parms);
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
@@ -303,8 +302,6 @@ static void get_options(void) {
|
||||
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
|
||||
nfapi_setmode(nfapi_mode);
|
||||
|
||||
if (simL1flag)
|
||||
set_softmodem_optmask(SOFTMODEM_SIML1_BIT);
|
||||
|
||||
if (loopfile != NULL) {
|
||||
printf("Input file for hardware emulation: %s",loopfile);
|
||||
@@ -597,11 +594,6 @@ int main( int argc, char **argv ) {
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 1 && (!IS_SOFTMODEM_SIML1) && NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
|
||||
printf("Running with more than 1 UE instance and simL1 is not active, this will result in undefined behaviour for now, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Checking option of nums_ue_thread.
|
||||
if(NB_THREAD_INST < 1) {
|
||||
printf("Running with 0 UE rxtx thread, exiting.\n");
|
||||
@@ -633,8 +625,8 @@ int main( int argc, char **argv ) {
|
||||
|
||||
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
|
||||
init_opt();
|
||||
ue_id_g = (node_number == 0)? 0 : node_number-2 ;//ue_id_g = 0, 1, ...,
|
||||
if( node_number == 0 )
|
||||
ue_id_g = (node_number == 0) ? 0 : node_number-2; //ue_id_g = 0, 1, ...,
|
||||
if(node_number == 0)
|
||||
{
|
||||
init_pdcp(0);
|
||||
}
|
||||
@@ -681,9 +673,6 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
} else init_openair0(frame_parms[0],(int)rx_gain[0][0]);
|
||||
|
||||
if (IS_SOFTMODEM_SIML1 ) {
|
||||
RCConfig_sim();
|
||||
}
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
|
||||
@@ -800,12 +789,8 @@ int main( int argc, char **argv ) {
|
||||
|
||||
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
|
||||
|
||||
if (IS_SOFTMODEM_SIML1 ) {
|
||||
init_ocm();
|
||||
PHY_vars_UE_g[0][0]->no_timing_correction = 1;
|
||||
}
|
||||
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
load_softscope("ue",NULL);
|
||||
|
||||
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
@@ -830,7 +815,7 @@ int main( int argc, char **argv ) {
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
|
||||
// stop threads
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
end_forms();
|
||||
|
||||
printf("stopping MODEM threads\n");
|
||||
|
||||
@@ -361,6 +361,7 @@ void init_ocm(void) {
|
||||
DS_TDL,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
random_channel(sim.RU2UE[ru_id][UE_id][CC_id],0);
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s) from UE %d to ru %d\n", "AWGN", UE_id, ru_id);
|
||||
@@ -374,6 +375,7 @@ void init_ocm(void) {
|
||||
DS_TDL,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
random_channel(sim.UE2RU[UE_id][ru_id][CC_id],0);
|
||||
// to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed.
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#ifndef __RFSIM__H__
|
||||
#define __RFSIM__H__
|
||||
#include "lte-softmodem.h"
|
||||
#include "openair1/SIMULATION/TOOLS/sim.h"
|
||||
#include "platform_constants.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
|
||||
void init_ocm(void);
|
||||
|
||||
void update_ocm(double snr_dB,double sinr_dB);
|
||||
|
||||
//extern pthread_mutex_t async_server_lock;
|
||||
//extern pthread_cond_t async_server_notify;
|
||||
//extern int async_server_shutdown;
|
||||
|
||||
void init_channel_vars(void);
|
||||
|
||||
#endif
|
||||
@@ -43,7 +43,9 @@
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include "rt_wrapper.h"
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
#include <common/utils/msc/msc.h>
|
||||
|
||||
#include "openair1/PHY/defs_common.h"
|
||||
|
||||
@@ -293,6 +295,7 @@ void thread_top_init(char *thread_name,
|
||||
struct sched_param sparam;
|
||||
char cpu_affinity[1024];
|
||||
cpu_set_t cpuset;
|
||||
int settingPriority = 1;
|
||||
|
||||
/* Set affinity mask to include CPUs 2 to MAX_CPUS */
|
||||
/* CPU 0 is reserved for UHD threads */
|
||||
@@ -339,30 +342,37 @@ void thread_top_init(char *thread_name,
|
||||
}
|
||||
}
|
||||
|
||||
memset(&sparam, 0, sizeof(sparam));
|
||||
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
||||
policy = SCHED_FIFO ;
|
||||
|
||||
s = pthread_setschedparam(pthread_self(), policy, &sparam);
|
||||
if (s != 0) {
|
||||
perror("pthread_setschedparam : ");
|
||||
exit_fun("Error setting thread priority");
|
||||
}
|
||||
|
||||
s = pthread_getschedparam(pthread_self(), &policy, &sparam);
|
||||
if (s != 0) {
|
||||
perror("pthread_getschedparam : ");
|
||||
exit_fun("Error getting thread priority");
|
||||
}
|
||||
if (checkIfFedoraDistribution())
|
||||
if (checkIfGenericKernelOnFedora())
|
||||
if (checkIfInsideContainer())
|
||||
settingPriority = 0;
|
||||
|
||||
pthread_setname_np(pthread_self(), thread_name);
|
||||
if (settingPriority) {
|
||||
memset(&sparam, 0, sizeof(sparam));
|
||||
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
||||
policy = SCHED_FIFO;
|
||||
|
||||
s = pthread_setschedparam(pthread_self(), policy, &sparam);
|
||||
if (s != 0) {
|
||||
perror("pthread_setschedparam : ");
|
||||
exit_fun("Error setting thread priority");
|
||||
}
|
||||
|
||||
s = pthread_getschedparam(pthread_self(), &policy, &sparam);
|
||||
if (s != 0) {
|
||||
perror("pthread_getschedparam : ");
|
||||
exit_fun("Error getting thread priority");
|
||||
}
|
||||
|
||||
LOG_I(HW, "[SCHED][eNB] %s started on CPU %d, sched_policy = %s , priority = %d, CPU Affinity=%s \n",thread_name,sched_getcpu(),
|
||||
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
||||
(policy == SCHED_RR) ? "SCHED_RR" :
|
||||
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
||||
"???",
|
||||
sparam.sched_priority, cpu_affinity );
|
||||
pthread_setname_np(pthread_self(), thread_name);
|
||||
|
||||
LOG_I(HW, "[SCHED][eNB] %s started on CPU %d, sched_policy = %s , priority = %d, CPU Affinity=%s \n",thread_name,sched_getcpu(),
|
||||
(policy == SCHED_FIFO) ? "SCHED_FIFO" :
|
||||
(policy == SCHED_RR) ? "SCHED_RR" :
|
||||
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
|
||||
"???",
|
||||
sparam.sched_priority, cpu_affinity );
|
||||
}
|
||||
|
||||
#endif //LOW_LATENCY
|
||||
|
||||
|
||||
@@ -61,30 +61,17 @@
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
#include "UTIL/MATH/oml.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "enb_config.h"
|
||||
|
||||
|
||||
int attach_rru(RU_t *ru);
|
||||
void configure_ru(int idx, void *arg);
|
||||
void configure_rru(int idx, void *arg);
|
||||
void configure_ru(RU_t *ru, void *arg);
|
||||
void configure_rru(RU_t *ru, void *arg);
|
||||
void fill_rf_config(RU_t *ru, char *rf_config_file);
|
||||
void* ru_thread_control( void* param );
|
||||
|
||||
@@ -164,7 +151,7 @@ int send_capab(RU_t *ru)
|
||||
cap->FH_fmt = MBP_IF5;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",RC.ru[0]->function);
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",ru->function);
|
||||
break;
|
||||
}
|
||||
cap->num_bands = ru->num_bands;
|
||||
@@ -224,7 +211,7 @@ int attach_rru(RU_t *ru)
|
||||
LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx);
|
||||
}
|
||||
}
|
||||
configure_ru(ru->idx,
|
||||
configure_ru(ru,
|
||||
(RRU_capabilities_t *)&rru_config_msg.msg[0]);
|
||||
|
||||
rru_config_msg.type = RRU_config;
|
||||
@@ -296,7 +283,7 @@ int connect_rau(RU_t *ru)
|
||||
cap->FH_fmt = MBP_IF5;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",RC.ru[0]->function);
|
||||
AssertFatal(1==0,"RU_function is unknown %d\n",ru->function);
|
||||
break;
|
||||
}
|
||||
cap->num_bands = ru->num_bands;
|
||||
@@ -335,7 +322,7 @@ int connect_rau(RU_t *ru)
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_FreqOffset[0],
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
|
||||
|
||||
configure_rru(ru->idx,
|
||||
configure_rru(ru,
|
||||
(void*)&rru_config_msg.msg[0]);
|
||||
configuration_received = 1;
|
||||
}
|
||||
@@ -388,21 +375,20 @@ int check_capabilities(RU_t *ru,
|
||||
return(-1);
|
||||
}
|
||||
|
||||
void configure_ru(int idx,
|
||||
void configure_ru(RU_t *ru,
|
||||
void *arg)
|
||||
{
|
||||
RU_t *ru = RC.ru[idx];
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg;
|
||||
int ret;
|
||||
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n",idx);
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n",ru->idx);
|
||||
|
||||
|
||||
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
|
||||
|
||||
AssertFatal((ret=check_capabilities(ru,capabilities)) == 0,
|
||||
"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret);
|
||||
"Cannot configure RRU %d, check_capabilities returned %d\n", ru->idx,ret);
|
||||
// take antenna capabilities of RRU
|
||||
ru->nb_tx = capabilities->nb_tx[0];
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
@@ -440,11 +426,10 @@ void configure_ru(int idx,
|
||||
phy_init_RU(ru);
|
||||
}
|
||||
|
||||
void configure_rru(int idx,
|
||||
void configure_rru(RU_t *ru,
|
||||
void *arg)
|
||||
{
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RU_t *ru = RC.ru[idx];
|
||||
|
||||
ru->frame_parms->eutra_band = config->band_list[0];
|
||||
ru->frame_parms->dl_CarrierFreq = config->tx_freq[0];
|
||||
@@ -486,7 +471,6 @@ void configure_rru(int idx,
|
||||
static int send_update_rru(RU_t * ru, LTE_DL_FRAME_PARMS * fp){
|
||||
//ssize_t msg_len/*,len*/;
|
||||
int i;
|
||||
//LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
memset((void *)&rru_config_msg,0,sizeof(rru_config_msg));
|
||||
rru_config_msg.type = RRU_config_update;
|
||||
@@ -535,7 +519,7 @@ void* ru_thread_control( void* param )
|
||||
send_tick(ru);
|
||||
|
||||
if (ru->state == RU_RUN && ru->if_south != LOCAL_RF){
|
||||
LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->eNB_list[0]->frame_parms;
|
||||
LOG_D(PHY,"Check MBSFN SF changes\n");
|
||||
if(fp->num_MBSFN_config != ru_sf_update){
|
||||
ru_sf_update = fp->num_MBSFN_config;
|
||||
@@ -579,7 +563,7 @@ void* ru_thread_control( void* param )
|
||||
((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_tx[0],
|
||||
((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_rx[0]);
|
||||
|
||||
configure_ru(ru->idx,(RRU_capabilities_t *)&rru_config_msg.msg[0]);
|
||||
configure_ru(ru,(RRU_capabilities_t *)&rru_config_msg.msg[0]);
|
||||
|
||||
// send config
|
||||
if (send_config(ru,rru_config_msg) == 0) ru->state = RU_CONFIG;
|
||||
@@ -603,7 +587,7 @@ void* ru_thread_control( void* param )
|
||||
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
|
||||
|
||||
ru->frame_parms = calloc(1, sizeof(*ru->frame_parms));
|
||||
configure_rru(ru->idx, (void*)&rru_config_msg.msg[0]);
|
||||
configure_rru(ru, (void*)&rru_config_msg.msg[0]);
|
||||
|
||||
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
@@ -652,10 +636,10 @@ void* ru_thread_control( void* param )
|
||||
|
||||
|
||||
LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d) is ready in state %s\n",ru->idx,ru->is_slave,ru_states[ru->state]);
|
||||
pthread_mutex_lock(&RC.ru_mutex);
|
||||
RC.ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
pthread_mutex_lock(ru->ru_mutex);
|
||||
*ru->ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(ru->ru_cond);
|
||||
pthread_mutex_unlock(ru->ru_mutex);
|
||||
|
||||
wait_sync("ru_thread_control");
|
||||
|
||||
@@ -710,10 +694,10 @@ void* ru_thread_control( void* param )
|
||||
if (ru->state == RU_READY){
|
||||
|
||||
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
|
||||
pthread_mutex_lock(&RC.ru_mutex);
|
||||
RC.ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(&RC.ru_cond);
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
pthread_mutex_lock(ru->ru_mutex);
|
||||
*ru->ru_mask &= ~(1<<ru->idx);
|
||||
pthread_cond_signal(ru->ru_cond);
|
||||
pthread_mutex_unlock(ru->ru_mutex);
|
||||
|
||||
wait_sync("ru_thread_control");
|
||||
|
||||
@@ -736,7 +720,7 @@ void* ru_thread_control( void* param )
|
||||
break;
|
||||
|
||||
case RRU_sync_ok: //RAU
|
||||
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_config_ok msg...Ignoring\n");
|
||||
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_sync_ok msg...Ignoring\n");
|
||||
else{
|
||||
if (ru->is_slave == 1){
|
||||
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Received RRU_sync_ok from RRU %d\n",ru->idx);
|
||||
|
||||
Reference in New Issue
Block a user