Commit ca2c8357 authored by Raymond Knopp's avatar Raymond Knopp

vcd for rru/rau. bug fixing on fronthaul interfaces

parent 98cbcf61
...@@ -73,7 +73,7 @@ void feptx_ofdm(RU_t *ru) { ...@@ -73,7 +73,7 @@ void feptx_ofdm(RU_t *ru) {
// int CC_id = ru->proc.CC_id; // int CC_id = ru->proc.CC_id;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN , 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
// slot_offset_F = (subframe<<1)*slot_sizeF; // slot_offset_F = (subframe<<1)*slot_sizeF;
...@@ -189,7 +189,7 @@ void feptx_ofdm(RU_t *ru) { ...@@ -189,7 +189,7 @@ void feptx_ofdm(RU_t *ru) {
dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF))); dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF)));
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN , 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
} }
void feptx_prec(RU_t *ru) { void feptx_prec(RU_t *ru) {
...@@ -216,7 +216,7 @@ void feptx_prec(RU_t *ru) { ...@@ -216,7 +216,7 @@ void feptx_prec(RU_t *ru) {
aa); aa);
} }
} }
LOG_I(PHY,"feptx_prec: frame %d, subframe %d: txp (freq) %d dB\n", LOG_D(PHY,"feptx_prec: frame %d, subframe %d: txp (freq) %d dB\n",
ru->proc.frame_tx,subframe, ru->proc.frame_tx,subframe,
dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[0],2*fp->symbols_per_tti*fp->ofdm_symbol_size))); dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[0],2*fp->symbols_per_tti*fp->ofdm_symbol_size)));
} }
...@@ -294,7 +294,6 @@ void ru_fep_full_2thread(RU_t *ru) { ...@@ -294,7 +294,6 @@ void ru_fep_full_2thread(RU_t *ru) {
wait.tv_sec=0; wait.tv_sec=0;
wait.tv_nsec=5000000L; wait.tv_nsec=5000000L;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
start_meas(&ru->ofdm_demod_stats); start_meas(&ru->ofdm_demod_stats);
if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) { if (pthread_mutex_timedlock(&proc->mutex_fep,&wait) != 0) {
...@@ -339,7 +338,6 @@ void fep_full(RU_t *ru) { ...@@ -339,7 +338,6 @@ void fep_full(RU_t *ru) {
start_meas(&ru->ofdm_demod_stats); start_meas(&ru->ofdm_demod_stats);
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
remove_7_5_kHz(ru,proc->subframe_rx<<1); remove_7_5_kHz(ru,proc->subframe_rx<<1);
remove_7_5_kHz(ru,1+(proc->subframe_rx<<1)); remove_7_5_kHz(ru,1+(proc->subframe_rx<<1));
...@@ -359,7 +357,6 @@ void fep_full(RU_t *ru) { ...@@ -359,7 +357,6 @@ void fep_full(RU_t *ru) {
} }
stop_meas(&ru->ofdm_demod_stats); stop_meas(&ru->ofdm_demod_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
} }
...@@ -371,7 +368,7 @@ void do_prach_ru(RU_t *ru) { ...@@ -371,7 +368,7 @@ void do_prach_ru(RU_t *ru) {
// check if we have to detect PRACH first // check if we have to detect PRACH first
if (is_prach_subframe(fp,proc->frame_prach,proc->subframe_prach)>0) { if (is_prach_subframe(fp,proc->frame_prach,proc->subframe_prach)>0) {
/* accept some delay in processing - up to 5ms */ //accept some delay in processing - up to 5ms
int i; int i;
for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) { for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) {
LOG_W(PHY,"Frame %d Subframe %d, PRACH thread busy (IC %d)!!\n", proc->frame_prach,proc->subframe_prach, LOG_W(PHY,"Frame %d Subframe %d, PRACH thread busy (IC %d)!!\n", proc->frame_prach,proc->subframe_prach,
...@@ -403,3 +400,4 @@ void do_prach_ru(RU_t *ru) { ...@@ -403,3 +400,4 @@ void do_prach_ru(RU_t *ru) {
} }
} }
...@@ -240,9 +240,12 @@ const char* eurecomFunctionsNames[] = { ...@@ -240,9 +240,12 @@ const char* eurecomFunctionsNames[] = {
"phy_procedures_eNb_tx1", "phy_procedures_eNb_tx1",
"phy_procedures_ru_feprx0", "phy_procedures_ru_feprx0",
"phy_procedures_ru_feprx1", "phy_procedures_ru_feprx1",
"phy_procedures_ru_feptx_ofdm0",
"phy_procedures_ru_feptx_ofdm1",
"phy_procedures_ru_feptx_prec0",
"phy_procedures_ru_feptx_prec1",
"phy_procedures_eNb_rx_uespec0", "phy_procedures_eNb_rx_uespec0",
"phy_procedures_eNb_rx_uespec1", "phy_procedures_eNb_rx_uespec1",
"phy_eNB_slot_fep",
"phy_procedures_ue_tx", "phy_procedures_ue_tx",
"phy_procedures_ue_rx", "phy_procedures_ue_rx",
"phy_procedures_ue_tx_ulsch_uespec", "phy_procedures_ue_tx_ulsch_uespec",
...@@ -292,6 +295,7 @@ const char* eurecomFunctionsNames[] = { ...@@ -292,6 +295,7 @@ const char* eurecomFunctionsNames[] = {
"phy_enb_ulsch_decoding7", "phy_enb_ulsch_decoding7",
"phy_enb_sfgen", "phy_enb_sfgen",
"phy_enb_prach_rx", "phy_enb_prach_rx",
"phy_ru_prach_rx",
"phy_enb_pdcch_tx", "phy_enb_pdcch_tx",
"phy_enb_rs_tx", "phy_enb_rs_tx",
"phy_ue_generate_prach", "phy_ue_generate_prach",
......
...@@ -214,9 +214,12 @@ typedef enum { ...@@ -214,9 +214,12 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX1, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC1, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC1,
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,
...@@ -266,6 +269,7 @@ typedef enum { ...@@ -266,6 +269,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING7, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING7,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH,
......
...@@ -137,7 +137,7 @@ static inline void fh_if5_mobipass_south_out(RU_t *ru) { ...@@ -137,7 +137,7 @@ static inline void fh_if5_mobipass_south_out(RU_t *ru) {
// southbound IF4p5 fronthaul // southbound IF4p5 fronthaul
static inline void fh_if4p5_south_out(RU_t *ru) { 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 ); 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,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.subframe_tx); LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.subframe_tx);
send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT, 0); send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT, 0);
} }
...@@ -206,12 +206,9 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) { ...@@ -206,12 +206,9 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
if ((proc->first_rx==0) && (sf!=*subframe)) if ((proc->first_rx==0) && (sf!=*subframe))
LOG_E(PHY,"rx_fh_if4p5: PULTICK received subframe %d != expected %d (first_rx %d)\n",sf,*subframe,proc->first_rx); LOG_E(PHY,"rx_fh_if4p5: PULTICK received subframe %d != expected %d (first_rx %d)\n",sf,*subframe,proc->first_rx);
break; break;
} else if (packet_type == IF4p5_PRACH) { } else if (packet_type == IF4p5_PRACH) {
if (ru->do_prach==1) { // nothing in RU for RAU
proc->subframe_prach = sf;
proc->frame_prach = f;
do_prach_ru(ru);
}
} }
} while(proc->symbol_mask[*subframe] != symbol_mask_full); } while(proc->symbol_mask[*subframe] != symbol_mask_full);
...@@ -453,7 +450,14 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) { ...@@ -453,7 +450,14 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
} while (symbol_mask != symbol_mask_full); } while (symbol_mask != symbol_mask_full);
proc->subframe_tx = subframe_tx; proc->subframe_tx = subframe_tx;
proc->frame_tx = frame_tx;
// dump VCD output for first RU in list
if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU, subframe_tx );
}
if (ru->feptx_ofdm) ru->feptx_ofdm(ru); if (ru->feptx_ofdm) ru->feptx_ofdm(ru);
if (ru->fh_south_out) ru->fh_south_out(ru); if (ru->fh_south_out) ru->fh_south_out(ru);
} }
...@@ -527,6 +531,11 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) { ...@@ -527,6 +531,11 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
proc->subframe_tx = (proc->subframe_rx+4)%10; proc->subframe_tx = (proc->subframe_rx+4)%10;
proc->frame_tx = (proc->subframe_rx>5) ? (proc->frame_rx+1)&1023 : proc->frame_rx; proc->frame_tx = (proc->subframe_rx>5) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
// dump VCD output for first RU in list
if (ru == RC.ru[0]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, proc->frame_rx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU, proc->subframe_rx );
}
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->subframe_rx != *subframe){ if (proc->subframe_rx != *subframe){
...@@ -631,7 +640,7 @@ static void* ru_thread_asynch_rxtx( void* param ) { ...@@ -631,7 +640,7 @@ static void* ru_thread_asynch_rxtx( void* param ) {
} else { } else {
subframe++; subframe++;
} }
LOG_I(PHY,"ru_thread_asynch_rxtx: Waiting on incoming fronthaul\n"); LOG_D(PHY,"ru_thread_asynch_rxtx: Waiting on incoming fronthaul\n");
// asynchronous receive from south (Mobipass) // asynchronous receive from south (Mobipass)
if (ru->fh_south_asynch_in) ru->fh_south_asynch_in(ru,&frame,&subframe); if (ru->fh_south_asynch_in) ru->fh_south_asynch_in(ru,&frame,&subframe);
// asynchronous receive from north (RRU IF4/IF5) // asynchronous receive from north (RRU IF4/IF5)
...@@ -707,15 +716,15 @@ static void* ru_thread_prach( void* param ) { ...@@ -707,15 +716,15 @@ static void* ru_thread_prach( void* param ) {
while (!oai_exit) { while (!oai_exit) {
if (oai_exit) break; if (oai_exit) break;
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break; if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
rx_prach(NULL, rx_prach(NULL,
ru, ru,
NULL, NULL,
NULL, NULL,
proc->frame_prach, proc->frame_prach,
0); 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 );
if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break; if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
} }
...@@ -857,17 +866,15 @@ static inline int wakeup_prach(RU_t *ru) { ...@@ -857,17 +866,15 @@ static inline int wakeup_prach(RU_t *ru) {
exit_fun( "error locking mutex_rxtx" ); exit_fun( "error locking mutex_rxtx" );
return(-1); return(-1);
} }
++ru->proc.instance_cnt_prach; if (ru->proc.instance_cnt_prach==-1) {
ru->proc.frame_prach = ru->proc.frame_rx; ++ru->proc.instance_cnt_prach;
ru->proc.subframe_prach = ru->proc.subframe_rx; ru->proc.frame_prach = ru->proc.frame_rx;
ru->proc.subframe_prach = ru->proc.subframe_rx;
// the thread can now be woken up
if (pthread_cond_signal(&ru->proc.cond_prach) != 0) { // the thread can now be woken up
LOG_E( PHY, "[RU] ERROR pthread_cond_signal for RU prach thread\n"); AssertFatal(pthread_cond_signal(&ru->proc.cond_prach) == 0, "ERROR pthread_cond_signal for RU prach thread\n");
exit_fun( "ERROR pthread_cond_signal" );
return(-1);
} }
else LOG_W(PHY,"RU prach thread busy, skipping\n");
pthread_mutex_unlock( &ru->proc.mutex_prach ); pthread_mutex_unlock( &ru->proc.mutex_prach );
return(0); return(0);
...@@ -956,8 +963,10 @@ static void* ru_thread( void* param ) { ...@@ -956,8 +963,10 @@ static void* ru_thread( void* param ) {
else AssertFatal(1==0, "No fronthaul interface at south port"); else AssertFatal(1==0, "No fronthaul interface at south port");
LOG_D(PHY,"RU thread (proc %p), received frame %d (%p), subframe %d (%p)\n", LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d \n",
proc, proc->frame_tx,&frame,subframe,&subframe); ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
proc->frame_rx,proc->subframe_rx);
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>0)) if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>0))
wakeup_prach(ru); wakeup_prach(ru);
......
...@@ -251,7 +251,10 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM ...@@ -251,7 +251,10 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
frame_parms->N_RB_DL*12); frame_parms->N_RB_DL*12);
#ifdef DEBUG_SIM #ifdef DEBUG_SIM
LOG_D(OCM,"[SIM][DL] RU %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d\n", LOG_I(PHY,"[SIM][DL] subframe %d: txp (time) %d dB\n",
subframe,dB_fixed(signal_energy(&txdata[0][sf_offset],frame_parms->samples_per_tti)));
LOG_I(OCM,"[SIM][DL] RU %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d\n",
ru_id,CC_id, ru_id,CC_id,
10*log10(tx_pwr), 10*log10(tx_pwr),
frame_parms->pdsch_config_common.referenceSignalPower, frame_parms->pdsch_config_common.referenceSignalPower,
......
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