Commit a24001bf authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'ru_rau_enhancement_L1_renaming' of...

Merge branch 'ru_rau_enhancement_L1_renaming' of https://gitlab.eurecom.fr/oai/openairinterface5g into ru_rau_enhancement_L1_renaming
parents fb0132e2 eebb19d9
......@@ -82,11 +82,29 @@ const char* eurecomVariablesNames[] = {
"frame_number_if4p5_north_out",
"subframe_number_if4p5_north_asynch_in",
"frame_number_if4p5_north_asynch_in",
"subframe_number_if4p5_south_out",
"frame_number_if4p5_south_out",
"subframe_number_if4p5_south_in",
"frame_number_if4p5_south_in",
"subframe_number_if4p5_south_out_ru",
"subframe_number_if4p5_south_out_ru1",
"frame_number_if4p5_south_out_ru",
"frame_number_if4p5_south_out_ru1",
"subframe_number_if4p5_south_in_ru",
"subframe_number_if4p5_south_in_ru1",
"frame_number_if4p5_south_in_ru",
"frame_number_if4p5_south_in_ru1",
"subframe_number_wakeup_l1s_ru",
"subframe_number_wakeup_l1s_ru1",
"frame_number_wakeup_l1s_ru",
"frame_number_wakeup_l1s_ru1",
"subframe_number_wakeup_rxtx_rx_ru",
"subframe_number_wakeup_rxtx_rx_ru1",
"frame_number_wakeup_rxtx_rx_ru",
"frame_number_wakeup_rxtx_rx_ru1",
"subframe_number_wakeup_rxtx_tx_ru",
"subframe_number_wakeup_rxtx_tx_ru1",
"frame_number_wakeup_rxtx_tx_ru",
"frame_number_wakeup_rxtx_tx_ru1",
"ic_enb",
"l1_proc_ic",
"l1_proc_tx_ic",
"runtime_TX_eNB",
"runtime_RX_eNB",
"frame_number_TX0_UE",
......@@ -425,10 +443,10 @@ const char* eurecomFunctionsNames[] = {
"test",
/* IF4/IF5 signals */
"send_if4",
"send_if4_RU1",
"recv_if4",
"recv_if4_RU1",
"send_if4_ru",
"send_if4_ru1",
"recv_if4_ru",
"recv_if4_ru1",
"send_if5",
"recv_if5",
......
......@@ -59,11 +59,29 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_RX_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_RX_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_TX_RU,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_TX_RU1,
VCD_SIGNAL_DUMPER_VARIABLES_IC_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC,
VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE,
......@@ -405,9 +423,9 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_TEST,
/* IF4/IF5 signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4,
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4_RU,
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4_RU1,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4_RU,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4_RU1,
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5,
......
......@@ -44,7 +44,7 @@ typedef struct {
#define VCD_NUM_FUNCTIONS (218)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (137) /*(136)*//*(128)*/
#define VCD_NUM_VARIABLES (155)
/* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
......@@ -1051,31 +1051,121 @@ ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_north_asynch_in
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_out
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_OUT
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_OUT
VCD_NAME = subframe_number_if4p5_south_out_ru
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU1
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_out
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_IN
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_IN
VCD_NAME = subframe_number_if4p5_south_out_ru1
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_OUT_RU
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_OUT_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_in
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_IN
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_IN
VCD_NAME = frame_number_if4p5_south_out_ru
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_OUT_RU1
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_OUT_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_in
VCD_NAME = frame_number_if4p5_south_out_ru1
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_in_ru
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU1
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_in_ru1
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_IN_RU
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_IN_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_in_ru
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_IN_RU1
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_IN_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_in_ru1
ID = VCD_VARIABLE_SUBFRAME_NUMBER_WAKEUP_L1S_RU
DESC = VCD variable SUBFRAME_NUMBER_WAKEUP_L1S_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_wakeup_l1s_ru
ID = VCD_VARIABLE_SUBFRAME_NUMBER_WAKEUP_L1S_RU1
DESC = VCD variable SUBFRAME_NUMBER_WAKEUP_L1S_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_wakeup_l1s_ru1
ID = VCD_VARIABLE_FRAME_NUMBER_WAKEUP_L1S_RU
DESC = VCD variable FRAME_NUMBER_WAKEUP_L1S_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_wakeup_l1s_ru
ID = VCD_VARIABLE_FRAME_NUMBER_WAKEUP_L1S_RU1
DESC = VCD variable FRAME_NUMBER_WAKEUP_L1S_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_wakeup_l1s_ru1
ID = VCD_VARIABLE_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU
DESC = VCD variable SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_wakeup_rxtx_rx_ru
ID = VCD_VARIABLE_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU1
DESC = VCD variable SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_wakeup_rxtx_rx_ru1
ID = VCD_VARIABLE_FRAME_NUMBER_WAKEUP_RXTX_RX_RU
DESC = VCD variable FRAME_NUMBER_WAKEUP_RXTX_RX_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_wakeup_rxtx_rx_ru
ID = VCD_VARIABLE_FRAME_NUMBER_WAKEUP_RXTX_RX_RU1
DESC = VCD variable FRAME_NUMBER_WAKEUP_RXTX_RX_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_wakeup_rxtx_rx_ru1
ID = VCD_VARIABLE_SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU
DESC = VCD variable SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_wakeup_rxtx_tx_ru
ID = VCD_VARIABLE_SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU1
DESC = VCD variable SUBFRAME_NUMBER_WAKEUP_RXTX_TX_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_wakeup_rxtx_tx_ru1
ID = VCD_VARIABLE_FRAME_NUMBER_WAKEUP_RXTX_TX_RU
DESC = VCD variable FRAME_NUMBER_WAKEUP_RXTX_TX_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_wakeup_rxtx_tx_ru
ID = VCD_VARIABLE_FRAME_NUMBER_WAKEUP_RXTX_TX_RU1
DESC = VCD variable FRAME_NUMBER_WAKEUP_RXTX_TX_RU1
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_wakeup_rxtx_tx_ru1
ID = VCD_VARIABLE_IC_ENB
DESC = VCD variable IC_ENB
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = ic_enb
ID = VCD_VARIABLE_L1_PROC_IC
DESC = VCD variable L1_PROC_IC
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = l1_proc_ic
ID = VCD_VARIABLE_L1_PROC_TX_IC
DESC = VCD variable L1_PROC_TX_IC
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = l1_proc_tx_ic
ID = VCD_VARIABLE_RUNTIME_TX_ENB
DESC = VCD variable RUNTIME_TX_ENB
GROUP = ALL:VCD:ENB:VCD_VARIABLE
......@@ -2644,26 +2734,26 @@ ID = VCD_FUNCTION_TEST
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = test
ID = VCD_FUNCTION_SEND_IF4
DESC = VCD function SEND_IF4
ID = VCD_FUNCTION_SEND_IF4_RU
DESC = VCD function SEND_IF4_RU
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = send_if4
VCD_NAME = send_if4_ru
ID = VCD_FUNCTION_SEND_IF4_RU1
DESC = VCD function SEND_IF4_RU1
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = send_if4_RU1
ID = VCD_FUNCTION_RECV_IF4
DESC = VCD function RECV_IF4
VCD_NAME = send_if4_ru1
ID = VCD_FUNCTION_RECV_IF4_RU
DESC = VCD function RECV_IF4_RU
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = recv_if4
VCD_NAME = recv_if4_ru
ID = VCD_FUNCTION_RECV_IF4_RU1
DESC = VCD function RECV_IF4_RU1
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = recv_if4_RU1
VCD_NAME = recv_if4_ru1
ID = VCD_FUNCTION_SEND_IF5
DESC = VCD function SEND_IF5
GROUP = ALL:VCD:ENB:VCD_FUNCTION
......
......@@ -64,7 +64,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
int nsym = fp->symbols_per_tti;
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4+ru->idx, 1 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4_RU+ru->idx,1);
if (packet_type == IF4p5_PDLFFT) {
LOG_D(PHY,"send DL_IF4p5: RU %d frame %d, subframe %d\n",ru->idx,frame,subframe);
......@@ -266,7 +266,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
}
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4+ru->idx, 0 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4_RU+ru->idx,0);
return;
}
......@@ -285,7 +285,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
int slotoffsetF=0, blockoffsetF=0;
eth_state_t *eth = (eth_state_t*) (ru->ifdevice.priv);
int idx;
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4+ru->idx, 1 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4_RU+ru->idx,1);
if (ru->function == NGFI_RRU_IF4p5) {
db_fulllength = (12*fp->N_RB_DL)*ru->nb_tx;
......@@ -420,7 +420,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
AssertFatal(1==0, "recv_IF4p5 - Unknown packet_type %x", *packet_type);
}
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4+ru->idx, 0 );
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4_RU+ru->idx,0);
return;
}
......
......@@ -301,7 +301,8 @@ typedef enum {
RU_READY = 2,
RU_RUN = 3,
RU_ERROR = 4,
RU_SYNC = 5
RU_SYNC = 5,
RU_CHECK_SYNC = 6
} rru_state_t;
/// Some commamds to RRU. Not sure we should do it like this !
......@@ -480,7 +481,8 @@ typedef enum {
RRU_stop=5,
RRU_sync_ok=6,
RRU_frame_resynch=7,
RRU_MSG_max_num=8
RRU_MSG_max_num=8,
RRU_check_sync = 9
} rru_config_msg_type_t;
typedef struct RRU_CONFIG_msg_s {
......
......@@ -174,7 +174,6 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf);
LOG_I(PHY,"ENTERED rxtx\n");
if (nfapi_mode == 1) {
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
......@@ -284,7 +283,7 @@ LOG_I(PHY,"ENTERED rxtx\n");
stop_meas( &softmodem_stats_rxtx_sf );
LOG_I(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
softmodem_stats_rxtx_sf.p_time, nfapi_meas.p_time,
......@@ -358,7 +357,9 @@ static void* L1_thread_tx(void* param) {
phy_procedures_eNB_TX(eNB, proc, 1);
pthread_mutex_lock( &proc->mutex );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,proc->instance_cnt);
proc->instance_cnt = -1;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_TX_IC,proc->instance_cnt);
// the thread can now be woken up
if (pthread_cond_signal(&proc->cond) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
......@@ -434,8 +435,9 @@ static void* L1_thread( void* param ) {
{
if (rxtx(eNB,proc,thread_name) < 0) break;
}
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC,proc->instance_cnt);
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!=2){
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT)
......@@ -489,7 +491,7 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
wait.tv_nsec=5000000L;
LTE_DL_FRAME_PARMS *fp;
LOG_I(PHY,"Entered wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs);
LOG_D(PHY,"wakeup_txfh %d.%d IC_RU = %d\n", proc->frame_tx, proc->subframe_tx, proc->instance_cnt_RUs);
if(wait_on_condition(&proc->mutex_RUs,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) {
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx);
return(-1);
......@@ -528,8 +530,10 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
ru_proc->timestamp_tx = proc->timestamp_tx;
ru_proc->subframe_tx = proc->subframe_tx;
ru_proc->frame_tx = proc->frame_tx;
LOG_I(PHY,"wakeup_txfh: ru_proc->subframe_tx %d\n",ru_proc->subframe_tx);
// the thread can now be woken up
LOG_D(PHY,"wakeup_txfh: ru_proc->subframe_tx %d\n",ru_proc->subframe_tx);
// the thread can now be woken up
if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
exit_fun( "ERROR pthread_cond_signal" );
......@@ -554,7 +558,6 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
struct timespec wait;
wait.tv_sec=0;
wait.tv_nsec=5000000L;
LOG_I(PHY,"ENTERED wakeup_tx\n");
if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) {
LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n");
......@@ -564,9 +567,9 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
while(L1_proc_tx->instance_cnt == 0){ //check if the previous has finished
pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex);
}
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; // set go for the current one
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 = L1_proc->subframe_rx;
L1_proc_tx->frame_rx = L1_proc->frame_rx;
......@@ -593,8 +596,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
LOG_I(PHY,"ENTERED wakeup_rxtx\n");
int i;
struct timespec wait;
......@@ -613,9 +614,10 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
exit_fun( "error locking mutex_rxtx" );
return(-1);
}
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_L1_PROC_IC,L1_proc->instance_cnt);
++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).
......@@ -627,7 +629,9 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
L1_proc->subframe_rx = ru_proc->subframe_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;
LOG_I(PHY,"wakeup_rxtx: L1_proc->subframe_rx %d, L1_proc->subframe_tx %d\n",L1_proc->subframe_rx,L1_proc->subframe_tx);
LOG_D(PHY,"wakeup_rxtx: L1_proc->subframe_rx %d, L1_proc->subframe_tx %d\n",L1_proc->subframe_rx,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");
......@@ -637,6 +641,11 @@ LOG_I(PHY,"wakeup_rxtx: L1_proc->subframe_rx %d, L1_proc->subframe_tx %d\n",L1_p
pthread_mutex_unlock( &L1_proc->mutex);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_RX_RU+ru->idx, L1_proc->frame_rx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU+ru->idx, L1_proc->subframe_rx);
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);
return(0);
}
......
......@@ -155,7 +155,6 @@ static inline void fh_if5_south_out(RU_t *ru) {
// southbound IF4p5 fronthaul
static inline void fh_if4p5_south_out(RU_t *ru) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
LOG_I(PHY,"ENTERED fh_if4p5_south_out Sending IF4p5 for frame %d subframe %d ru %d\n",ru->proc.frame_tx,ru->proc.subframe_tx,ru->idx);
if (subframe_select(&ru->frame_parms,ru->proc.subframe_tx)!=SF_UL) {
send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT);
ru->south_out_cnt++;
......@@ -165,8 +164,8 @@ static inline void fh_if4p5_south_out(RU_t *ru) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU+ru->idx, ru->proc.subframe_tx );
}*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT,ru->proc.frame_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT,ru->proc.subframe_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT_RU+ru->idx,ru->proc.frame_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT_RU+ru->idx,ru->proc.subframe_tx);
}
......@@ -211,7 +210,6 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
RU_proc_t *proc = &ru->proc;
int f,sf;
LOG_I(PHY,"ENTERED fh_if4p5_south_in\n");
uint16_t packet_type;
uint32_t symbol_number=0;
uint32_t symbol_mask_full;
......@@ -220,7 +218,7 @@ LOG_I(PHY,"ENTERED fh_if4p5_south_in\n");
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
else
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
LOG_I(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d, ru %d\n",ru->idx,*frame,*subframe,ru->idx);
LOG_D(PHY,"fh_if4p5_south_in: RU %d, frame %d, subframe %d, ru %d\n",ru->idx,*frame,*subframe,ru->idx);
AssertFatal(proc->symbol_mask[*subframe]==0,"rx_fh_if4p5: proc->symbol_mask[%d] = %x\n",*subframe,proc->symbol_mask[*subframe]);
do {
recv_IF4p5(ru, &f, &sf, &packet_type, &symbol_number);
......@@ -271,8 +269,8 @@ LOG_I(PHY,"ENTERED fh_if4p5_south_in\n");
}*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN,f);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN,sf);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN_RU+ru->idx,f);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN_RU+ru->idx,sf);
proc->symbol_mask[sf] = 0;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
......@@ -1144,7 +1142,7 @@ void wakeup_L1s(RU_t *ru) {
RU_proc_t *ruproc = &ru->proc;
struct timespec t;
LOG_I(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);
// call eNB function directly
......@@ -1152,9 +1150,10 @@ void wakeup_L1s(RU_t *ru) {
sprintf(string,"Incoming RU %d",ru->idx);
AssertFatal(0==pthread_mutex_lock(&proc->mutex_RU),"");
LOG_D(PHY,"Frame %d, Subframe %d: RU %d done (wait_cnt %d),RU_mask[%d] %x\n",
LOG_D(PHY,"wakeup_L1s: Frame %d, Subframe %d: RU %d done (wait_cnt %d),RU_mask[%d] %x\n",
ru->proc.frame_rx,ru->proc.subframe_rx,ru->idx,ru->wait_cnt,ru->proc.subframe_rx,proc->RU_mask[ru->proc.subframe_rx]);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.frame_rx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.subframe_rx);
clock_gettime(CLOCK_MONOTONIC,&ru->proc.t[ru->proc.subframe_rx]);
if (proc->RU_mask[ru->proc.subframe_rx] == 0){
......@@ -1168,7 +1167,8 @@ void wakeup_L1s(RU_t *ru) {
if (ru == eNB->RU_list[i]) {
// AssertFatal((proc->RU_mask&(1<<i)) == 0, "eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n",eNB->Mod_id,ru->proc.frame_rx,ru->proc.subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask);
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
}else if (eNB->RU_list[i]->state == RU_SYNC){
}else if (eNB->RU_list[i]->state == RU_SYNC ||
(eNB->RU_list[i]->is_slave==1 && eNB->RU_list[i]->wait_cnt>0)){
proc->RU_mask[ru->proc.subframe_rx] |= (1<<i);
}
......@@ -1184,7 +1184,7 @@ void wakeup_L1s(RU_t *ru) {
//clock_gettime(CLOCK_MONOTONIC,&t);
//LOG_I(PHY,"RU mask is now %x, time is %lu\n",proc->RU_mask[ru->proc.subframe_rx], t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec);
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) {
if (proc->RU_mask[ru->proc.subframe_rx] == (1<<eNB->num_RU)-1) { // all RUs have provided their information so continue on and wakeup eNB top
LOG_D(PHY, "ru_mask is %d \n ", proc->RU_mask[ru->proc.subframe_rx]);
LOG_D(PHY, "the number of RU is %d, the current ru is RU %d \n ", (1<<eNB->num_RU)-1, ru->idx);
LOG_D(PHY, "ru->proc.subframe_rx is %d \n", ru->proc.subframe_rx);
......@@ -1194,13 +1194,14 @@ void wakeup_L1s(RU_t *ru) {
//stop_meas(&proc->ru_arrival_time);
AssertFatal(t.tv_nsec < proc->t[ru->proc.subframe_rx].tv_nsec+5000000,
"Time difference for subframe %d (Frame %d) => %lu > 5ms, this is RU %d\n",
ru->proc.subframe_rx, ru->proc.frame_rx,t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec, ru->idx);
ru->proc.subframe_rx, ru->proc.frame_rx, t.tv_nsec - proc->t[ru->proc.subframe_rx].tv_nsec, ru->idx);
// VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.frame_rx);
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_L1S_RU+ru->idx, ru->proc.subframe_rx);
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
// unlock RUs that are waiting for eNB processing to be completed
LOG_D(PHY,"RU %d wakeup eNB top for for subframe %d\n", ru->idx,ru->proc.subframe_rx);
LOG_D(PHY,"RU %d wakeup eNB top for subframe %d\n", ru->idx,ru->proc.subframe_rx);
if (ru->wait_cnt == 0) {
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD)
ru->eNB_top(eNB_list[0],proc->frame_rx,proc->subframe_rx,string,ru);
......@@ -1222,12 +1223,13 @@ void wakeup_L1s(RU_t *ru) {
*/
}
/*else
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
else{ // not all RUs have provided their information
AssertFatal(0==pthread_mutex_unlock(&proc->mutex_RU),"");
}
// pthread_mutex_unlock(&proc->mutex_RU);
// LOG_D(PHY,"wakeup eNB top for for subframe %d\n", ru->proc.subframe_rx);
// ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
*/
ru->proc.emulate_rf_busy = 0;
}
......@@ -1506,10 +1508,10 @@ static void* ru_thread_tx( void* param ) {
if (oai_exit) break;
LOG_I(PHY,"ru_thread_tx (ru %d): Waiting for TX processing\n",ru->idx);
LOG_D(PHY,"ru_thread_tx (ru %d): Waiting for TX processing\n",ru->idx);
// wait until eNBs are finished subframe RX n and TX n+4
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx");
LOG_I(PHY,"ru_thread_tx (ru %d): Woken from condition\n",ru->idx);
LOG_D(PHY,"ru_thread_tx (ru %d): Woken from condition\n",ru->idx);
if (oai_exit) break;
//printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~ru_thread_tx is waken up %d.%d having L1 %d\n", proc->frame_tx, proc->subframe_tx, ru->num_eNB);
......@@ -1542,6 +1544,9 @@ static void* ru_thread_tx( void* param ) {
eNB->Mod_id,eNB_proc->frame_rx,eNB_proc->subframe_rx,ru->idx,eNB->num_RU,eNB_proc->RU_mask_tx);
eNB_proc->RU_mask_tx |= (1<<j);
}
else if (eNB->RU_list[j]->state == RU_SYNC){
eNB_proc->RU_mask_tx |= (1<<j);
}
}
if (eNB_proc->RU_mask_tx != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
LOG_I(PHY,"Not all RUs have provided their info (mask = %d)\n", eNB_proc->RU_mask_tx);
......@@ -1751,7 +1756,7 @@ if(!emulate_rf){
ru->wait_cnt--;
LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
LOG_I(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) {
// Send RRU_frame adjust
......@@ -1764,7 +1769,6 @@ if(!emulate_rf){
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU\n");
resynch_done=1;
}
wakeup_L1s(ru);
}
else {
......@@ -1825,7 +1829,6 @@ if(!emulate_rf){
exit_fun("error unlocking mutex_pre_scd");
}
#endif
// wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_L1s(ru);
......
......@@ -705,7 +705,7 @@ void* ru_thread_control( void* param ) {
if (ru->if_south == LOCAL_RF) LOG_E(PHY,"Received RRU_config_ok msg...Ignoring\n");
else{
if (ru->is_slave == 1){
LOG_I(PHY,"Received RRU_sync_ok from RRU %d\n",ru->idx);
printf(PHY,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Received RRU_sync_ok from RRU %d\n",ru->idx);
// Just change the state of the RRU to unblock ru_thread()
ru->state = RU_RUN;
}else LOG_E(PHY,"Received RRU_sync_ok from a master RRU...Ignoring\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment