diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index d26980b0f8..9dd3d98e00 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2492,8 +2492,6 @@ void cba_procedures(const unsigned char thread_id,PHY_VARS_eNB *eNB,int UE_id,in void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eNB,const uint8_t abstraction_flag) { eNB_proc_t *proc = &eNB->proc[thread_id]; - const int subframe = proc->subframe_rx; - const int frame = proc->frame_rx; int i,l; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; void *rxp[fp->nb_antennas_rx]; @@ -2504,15 +2502,18 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_COMMON_RX,1); start_meas(&eNB->phy_proc_rx); #ifdef DEBUG_PHY_PROC - LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,frame, subframe); + LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",eNB->Mod_id,proc->frame_rx, proc->subframe_rx); #endif if (abstraction_flag==0) { // grab signal in chunks of 500 us (1 slot) - for (i=0; inb_antennas_rx; i++) + if ((eNB->node_function == NGFI_RRU_IF4) || (eNB->node_function == eNodeB_3GPP)) { // acquisition from RF and front-end processing - rxp[i] = (void*)&eNB->common_vars.rxdata[i][subframe*fp->samples_per_tti]; + for (i=0; inb_antennas_rx; i++) + rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][proc->subframe*fp->samples_per_tti]; + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 ); rxs = openair0.trx_read_func(&openair0, &proc->timestamp_rx, rxp, @@ -2520,7 +2521,10 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN fp->nb_antennas_rx); proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023; proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10; - + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, proc->subframe_rx ); + if (frame > 20){ if (rxs != fp->samples_per_tti>>1) exit_fun( "problem receiving samples" ); @@ -2541,6 +2545,17 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN //send_IF4(eNB,subframe<<1); } + for (i=0; inb_antennas_rx; i++) + rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][(fp->samples_per_tti>>1)+(subframe*fp->samples_per_tti)]; + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 ); + rxs = openair0.trx_read_func(&openair0, + &proc->timestamp_rx, + rxp, + fp->samples_per_tti>>1, + fp->nb_antennas_rx); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); remove_7_5_kHz(eNB,(subframe<<1)+1); for (l=0; lsymbols_per_tti/2; l++) slot_fep_ul(fp, @@ -2568,7 +2583,7 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN // check if we have to detect PRACH first - if (is_prach_subframe(fp,frame,subframe)>0) { + if (is_prach_subframe(fp,proc->frame_rx,proc->subframe_rx)>0) { // wake up thread for PRACH RX if (pthread_mutex_lock(&proc->mutex_prach) != 0) { LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB PRACH thread %d (IC %d)\n", thread_id, proc->instance_cnt_prach ); @@ -2613,7 +2628,7 @@ void phy_procedures_eNB_common_RX(const unsigned char thread_id,PHY_VARS_eNB *eN // and proc->subframe_tx = proc->subframe_rx+3 proc->timestamp_tx = proc->timestamp_rx + (fp->samples_per_tti<<1) + (fp->samples_per_tti>>1); proc->frame_tx = (proc->subframe_rx > 6) ? (proc->frame_rx+1) : proc->frame_rx; - proc->subframe_rx = (proc->subframe_rx + 3)%10; + proc->subframe_tx = (proc->subframe_rx + 3)%10; pthread_mutex_unlock( &proc->mutex_tx ); @@ -2850,7 +2865,6 @@ void phy_procedures_eNB_uespec_RX(const unsigned char thread_id,PHY_VARS_eNB *eN eNB->ulsch[i]->harq_processes[harq_pid]->o_ACK[1], ret); - //compute the expected ULSCH RX power (for the stats) eNB->ulsch[(uint32_t)i]->harq_processes[harq_pid]->delta_TF = get_hundred_times_delta_IF_eNB(eNB,i,harq_pid, 0); // 0 means bw_factor is not considered diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 78e481f3d6..1972993a94 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -77,6 +77,8 @@ struct vcd_module_s { const char* eurecomVariablesNames[] = { "frame_number_TX_eNB", "frame_number_RX_eNB", + "subframe_number_TX_eNB", + "subframe_number_RX_eNB", "runtime_TX_eNB", "runtime_RX_eNB", "frame_number_TX_UE", @@ -226,6 +228,8 @@ const char* eurecomFunctionsNames[] = { "lte_ue_pbch_procedures", "phy_procedures_eNb_tx", "phy_procedures_eNb_rx", + "phy_procedures_eNb_rx_common", + "phy_procedures_eNb_rx_uespec", "phy_procedures_ue_tx", "phy_procedures_ue_rx", "phy_procedures_eNB_lte", diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index a9e4339368..f0a3e70274 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -49,6 +49,8 @@ typedef enum { VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX_ENB = 0, VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, + VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX_ENB, + VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX_UE, @@ -200,6 +202,8 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, + VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE, diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw index 935bf68b2e..677e214f31 100644 --- a/targets/RT/USER/eNB_usrp.gtkw +++ b/targets/RT/USER/eNB_usrp.gtkw @@ -1,54 +1,36 @@ [*] [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI -[*] Sun Apr 10 20:34:38 2016 +[*] Fri May 27 01:34:58 2016 [*] [dumpfile] "/tmp/openair_dump_eNB.vcd" -[dumpfile_mtime] "Sun Apr 10 20:26:57 2016" -[dumpfile_size] 181182776 +[dumpfile_mtime] "Fri May 27 01:33:50 2016" +[dumpfile_size] 12743642 [savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw" -[timestart] 19787100000 -[size] 1535 876 +[timestart] 10801070000 +[size] 1535 845 [pos] -1 -1 -*-21.793451 19795882832 -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 +*-21.793451 10817350000 -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] 284 -[signals_width] 238 +[signals_width] 254 [sst_expanded] 1 [sst_vpaned_height] 294 -@24 -variables.hw_frame[63:0] -variables.hw_subframe[63:0] @28 functions.trx_read functions.trx_write @24 -variables.txcnt[63:0] -variables.rxcnt[63:0] variables.trx_ts[63:0] variables.trx_tst[63:0] variables.frame_number_TX_eNB[63:0] variables.frame_number_RX_eNB[63:0] +variables.subframe_number_TX_eNB[63:0] +variables.subframe_number_RX_eNB[63:0] @28 functions.eNB_thread_rx0 functions.eNB_thread_tx0 -functions.eNB_thread_rx1 -functions.eNB_thread_tx1 -functions.eNB_thread_rx2 -functions.eNB_thread_tx2 -functions.eNB_thread_rx3 -functions.eNB_thread_tx3 -functions.eNB_thread_rx4 -functions.eNB_thread_tx4 -functions.eNB_thread_rx5 -functions.eNB_thread_tx5 -functions.eNB_thread_rx6 -functions.eNB_thread_tx6 -functions.eNB_thread_rx7 -functions.eNB_thread_tx7 -functions.eNB_thread_rx8 -functions.eNB_thread_tx8 -functions.eNB_thread_rx9 -functions.eNB_thread_tx9 functions.phy_procedures_eNb_tx +@29 +functions.phy_enb_sfgen +@28 functions.phy_procedures_eNb_rx @24 variables.dci_info[63:0] @@ -64,7 +46,7 @@ functions.macxface_SR_indication @420 variables.ue0_SR_ENERGY[63:0] variables.ue0_SR_THRES[63:0] -@25 +@24 variables.dci_info[63:0] @28 functions.phy_enb_ulsch_decoding0 diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 582610c5c2..1f7d08c13d 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -276,6 +276,7 @@ static void* eNB_thread_tx( void* param ) eNB_proc_t *proc = (eNB_proc_t*)param; FILE *tx_time_file = NULL; char tx_time_name[101]; + void *txp[PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx]; if (opp_enabled == 1) { snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf_%d", "eNB", proc->thread_index); @@ -408,7 +409,6 @@ static void* eNB_thread_tx( void* param ) } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_TX0+(2*proc->thread_index), 1 ); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX_ENB, proc->frame_tx ); start_meas( &softmodem_stats_tx_sf[proc->thread_index] ); if (oai_exit) break; @@ -436,6 +436,9 @@ static void* eNB_thread_tx( void* param ) exit_fun("nothing to add"); } + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX_ENB, proc->frame_tx ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX_ENB, proc->subframe_tx ); if (oai_exit) break; if (PHY_vars_eNB_g[0][proc->CC_id]->node_function != NGFI_RRU_IF4) { @@ -459,7 +462,9 @@ static void* eNB_thread_tx( void* param ) } if (PHY_vars_eNB_g[0][proc->CC_id]->node_function != NGFI_RCC_IF4) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN , 1 ); do_OFDM_mod_rt( proc->subframe_tx, PHY_vars_eNB_g[0][proc->CC_id] ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN , 0 ); /* short *txdata = (short*)&PHY_vars_eNB_g[0][proc->CC_id]->common_vars.txdata[0][0][proc->subframe_tx*PHY_vars_eNB_g[0][proc->CC_id]->frame_parms.samples_per_tti]; int i; @@ -471,9 +476,30 @@ static void* eNB_thread_tx( void* param ) txdata[i+4] = -2047; txdata[i+5] = 0; txdata[i+6] = 0; - txdata[i+7] = -2047; - } + txdata[i+7] = -2047; } */ + + + // Transmit TX buffer based on timestamp from RX + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); + // prepare tx buffer pointers + int i; + for (i=0; iframe_parms.nb_antennas_tx; i++) + txp[i] = (void*)&PHY_vars_eNB_g[0][0]->common_vars.txdata[0][i][proc->subframe_tx*PHY_vars_eNB_g[0][0]->frame_parms.samples_per_tti]; + // if symb_written < spp ==> error + if (proc->frame_tx > 50) { + openair0.trx_write_func(&openair0, + (proc->timestamp_tx+openair0_cfg[0].tx_sample_advance), + txp, + PHY_vars_eNB_g[0][0]->frame_parms.samples_per_tti, + PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx, + 1); + } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); + + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-openair0_cfg[0].tx_sample_advance)&0xffffffff ); + } if (pthread_mutex_lock(&proc->mutex_tx) != 0) { @@ -683,23 +709,25 @@ static void* eNB_thread_rx( void* param ) // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices while (!oai_exit) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0, 0 ); - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 1 ); - - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, proc->frame_rx ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 0 ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 0 ); start_meas( &softmodem_stats_rx_sf[proc->thread_index] ); if (oai_exit) break; if ((((fp->frame_type == TDD )&&(subframe_select(fp,proc->subframe_rx)==SF_UL)) || (fp->frame_type == FDD))) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 1 ); // this spawns the prach and TX threads inside and updates the frame and subframe counters phy_procedures_eNB_common_RX(proc->thread_index, eNB, 0); - if (eNB->node_function != NGFI_RRU_IF4) + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON, 0 ); + if (eNB->node_function != NGFI_RRU_IF4) { + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 1 ); // this is the ue-specific processing for the subframe and can be multi-threaded later phy_procedures_eNB_uespec_RX(proc->thread_index, eNB, 0, no_relay ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 ); + } } if ((subframe_select(fp,proc->subframe_rx) == SF_S)) { @@ -714,8 +742,11 @@ static void* eNB_thread_rx( void* param ) } } #endif // LOWLATENCY - print_meas_now(&softmodem_stats_rx_sf[proc->thread_index],"eNB_RX_SF",proc->thread_index, rx_time_file); - } + print_meas_now(&softmodem_stats_rx_sf[proc->thread_index],"eNB_RX_SF",proc->thread_index, rx_time_file); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 0 ); + + + } //stop_meas( &softmodem_stats_rx_sf[proc->thread_index] ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RX0+(2*proc->thread_index), 0 ); @@ -747,7 +778,7 @@ static void* eNB_thread_prach( void* param ) MSC_START_USE(); - AssertFatal(proc->thread_index!=0,"Invalid thread index %d for PRACH thread\n",proc->thread_index); + AssertFatal(proc->thread_index==0,"Invalid thread index %d for PRACH thread\n",proc->thread_index); #ifdef LOWLATENCY struct sched_attr attr;