diff --git a/common/utils/time_meas.c b/common/utils/time_meas.c index df2bfd64de..ef87ff4582 100644 --- a/common/utils/time_meas.c +++ b/common/utils/time_meas.c @@ -85,21 +85,21 @@ void print_meas(time_stats_t *ts, first_time=1; if ((total_exec_time == NULL) || (sf_exec_time== NULL)) - fprintf(stderr, "%25s %25s %25s %25s %25s %6f\n","Name","Total","Per Trials", "Num Trials","CPU_F_GHz", cpu_freq_GHz); + fprintf(stderr, "%30s %25s %25s %25s %25s %6f\n","Name","Total","Per Trials", "Num Trials","CPU_F_GHz", cpu_freq_GHz); else - fprintf(stderr, "%25s %25s %25s %20s %15s %6f\n","Name","Total","Average/Frame","Trials", "CPU_F_GHz", cpu_freq_GHz); + fprintf(stderr, "%30s %25s %25s %20s %15s %6f\n","Name","Total","Average/Frame","Trials", "CPU_F_GHz", cpu_freq_GHz); } if (ts->trials>0) { //printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials); if ((total_exec_time == NULL) || (sf_exec_time== NULL)) { - fprintf(stderr, "%25s: %15.3f us; %15d; %15.3f us;\n", + fprintf(stderr, "%30s: %15.3f us; %15d; %15.3f us;\n", name, (ts->diff/ts->trials/cpu_freq_GHz/1000.0), ts->trials, ts->max/cpu_freq_GHz/1000.0); } else { - fprintf(stderr, "%25s: %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n", + fprintf(stderr, "%30s: %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n", name, (ts->diff/cpu_freq_GHz/1000000.0), ((ts->diff/cpu_freq_GHz/1000000.0)/(total_exec_time->diff/cpu_freq_GHz/1000000.0))*100, // percentage diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 5e562eff31..d73e7cade8 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -287,7 +287,7 @@ void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) { ru->nr_frame_parms->get_samples_per_slot(slot,ru->nr_frame_parms), 0); stop_meas(&ru->tx_fhaul); - + LOG_D(PHY,"IF5 TX %d.%d\n",frame,slot); } // southbound IF4p5 fronthaul @@ -338,7 +338,7 @@ void fh_if5_south_in(RU_t *ru, } stop_meas(&ru->rx_fhaul); - LOG_I(PHY,"IF5 %d.%d => RX %d.%d first_rx %d: time %f\n",*frame,*tti,proc->frame_rx,proc->tti_rx,proc->first_rx,ru->rx_fhaul.p_time/(cpu_freq_GHz*1000.0)); + LOG_D(PHY,"IF5 %d.%d => RX %d.%d first_rx %d: time %f\n",*frame,*tti,proc->frame_rx,proc->tti_rx,proc->first_rx,ru->rx_fhaul.p_time/(cpu_freq_GHz*1000.0)); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF5, 0 ); @@ -1175,17 +1175,16 @@ void *ru_stats_thread(void *param) { sleep(1); if (opp_enabled == 1) { - if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL); + if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx (all ports)",NULL,NULL); if (ru->feptx_ofdm) { - print_meas(&ru->precoding_stats,"feptx_prec",NULL,NULL); + print_meas(&ru->precoding_stats,"feptx_prec (per port)",NULL,NULL); print_meas(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL); + print_meas(&ru->ofdm_mod_stats,"feptx_ofdm (per port)",NULL,NULL); if (ru->txfh_in_fep) { - print_meas(&ru->ofdm_mod_stats,"feptx_ofdm (with txfh)",NULL,NULL); - print_meas(&ru->ofdm_total_stats,"feptx_total (with txfh)",NULL,NULL); + print_meas(&ru->ofdm_total_stats,"feptx_total (all ports/fh)",NULL,NULL); } else { - print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL); print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL); } } @@ -1402,7 +1401,10 @@ void *ru_thread( void *param ) { initial_wait=0; opp_enabled = opp_enabled0; } - if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); + if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) { + reset_meas(&ru->rx_fhaul); + reset_meas(&ru->tx_fhaul); + } proc->timestamp_tx = proc->timestamp_rx; int sl=proc->tti_tx; for (int slidx=0;slidxsl_ahead;slidx++) diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 22d4b97a74..82a53054ff 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -62,6 +62,7 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) { //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0) , 1 ); + if (aa==0) start_meas(&ru->ofdm_mod_stats); slot_offset = fp->get_samples_slot_timestamp(slot,fp,0); slot_offsetF = first_symbol*fp->ofdm_symbol_size; @@ -140,6 +141,7 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) { } // numerology 0 } + if (aa==0) stop_meas(&ru->ofdm_mod_stats); if (ru->txfh_in_fep) { ru->ifdevice.trx_write_func2(&ru->ifdevice, ru->proc.timestamp_tx, @@ -357,9 +359,7 @@ static void *nr_feptx_thread(void *param) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 0); ////////////FEPTX//////////// - if (aa==0 && l==0) start_meas(&ru->ofdm_mod_stats); nr_feptx0(ru,slot,start,fp->symbols_per_slot>>1,aa); - if (aa==0 && l==0) stop_meas(&ru->ofdm_mod_stats); if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break; @@ -396,9 +396,7 @@ static void *nr_feptx_thread(void *param) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 0); - start_meas(&ru->ofdm_mod_stats); nr_feptx0(ru,slot,start,1,aa); - stop_meas(&ru->ofdm_mod_stats); if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break; @@ -434,7 +432,6 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) { if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 ); - start_meas(&ru->ofdm_mod_stats); // LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot); @@ -442,7 +439,6 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) { nr_feptx0(ru,slot,0,NR_NUMBER_OF_SYMBOLS_PER_SLOT,aa); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 ); - stop_meas(&ru->ofdm_mod_stats); LOG_D(PHY,"feptx_ofdm (TXPATH): frame %d, slot %d: txp (time %p) %d dB, txp (freq) %d dB\n", frame_tx,slot,txdata,dB_fixed(signal_energy((int32_t*)txdata,fp->get_samples_per_slot( @@ -750,9 +746,7 @@ void nr_feptx(void *arg) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->aid , 0); ////////////FEPTX//////////// - if (aa==0) start_meas(&ru->ofdm_mod_stats); nr_feptx0(ru,slot,0,fp->symbols_per_slot,aa); - if (aa==0) stop_meas(&ru->ofdm_mod_stats); } void nr_feptx_tp(RU_t *ru, int frame_tx, int slot) { diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c index 6fa1f0c817..662b19ba45 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -336,9 +336,9 @@ void *trx_eth_write_udp_cmd(void *arg) { *(uint16_t *)(buff2 + 4) = aid; openair0_timestamp TS = timestamp + fhstate->TS0; - TS = 6*device->sampling_rate_ratio_d*(TS/device->sampling_rate_ratio_n); + TS = (6*device->sampling_rate_ratio_d*TS)/device->sampling_rate_ratio_n; TS -= device->txrx_offset; - int TSinc = 6*256*device->sampling_rate_ratio_d/device->sampling_rate_ratio_n; + int TSinc = (6*256*device->sampling_rate_ratio_d)/device->sampling_rate_ratio_n; int len=256; for (int offset=0;offsetsampling_rate_ratio_n*(TS/(device->sampling_rate_ratio_d*6)); + TS = (device->sampling_rate_ratio_n*TS)/(device->sampling_rate_ratio_d*6); if ((int)count <= 0) continue; AssertFatal(aid < 8,"Cannot handle more than 8 antennas, got aid %d\n",aid); fhstate->r[aid]=1;