diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 831bbe496a..b4bbfd15a4 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -690,6 +690,7 @@ typedef struct PHY_VARS_gNB_s { time_stats_t ul_indication_stats; time_stats_t slot_indication_stats; time_stats_t schedule_response_stats; + time_stats_t ulsch_decoding_stats; time_stats_t ulsch_ldpc_decoding_stats; time_stats_t ulsch_deinterleaving_stats; time_stats_t ulsch_channel_estimation_stats; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 0a348e9c03..a85e9afea0 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -428,7 +428,12 @@ static int nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int //---------------------------------------------------------- //--------------------- ULSCH decoding --------------------- //---------------------------------------------------------- - + /* Do ULSCH decoding time measurement only when number of PUSCH is limited to 1 + * (valid for unitary physical simulators). ULSCH processing lopp is then executed + * only once, which ensures exactly one start and stop of the ULSCH decoding time + * measurement per processed TB.*/ + if (gNB->max_nb_pusch == 1) + start_meas(&gNB->ulsch_decoding_stats); int nbDecode = nr_ulsch_decoding(gNB, ULSCH_id, gNB->pusch_vars[ULSCH_id].llr, frame_parms, pusch_pdu, frame_rx, slot_rx, harq_pid, G); @@ -916,6 +921,12 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) delNotifiedFIFO_elt(req); totalDecode--; } + /* Do ULSCH decoding time measurement only when number of PUSCH is limited to 1 + * (valid for unitary physical simulators). ULSCH processing loop is then executed + * only once, which ensures exactly one start and stop of the ULSCH decoding time + * measurement per processed TB.*/ + if (gNB->max_nb_pusch == 1) + stop_meas(&gNB->ulsch_decoding_stats); for (int i = 0; i < gNB->max_nb_srs; i++) { NR_gNB_SRS_t *srs = &gNB->srs[i]; if (srs) { diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 374234e55d..1a5bf3bb19 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -924,6 +924,7 @@ int main(int argc, char *argv[]) reset_meas(&gNB->rx_pusch_stats); reset_meas(&gNB->rx_pusch_init_stats); reset_meas(&gNB->rx_pusch_symbol_processing_stats); + reset_meas(&gNB->ulsch_decoding_stats); reset_meas(&gNB->ulsch_channel_estimation_stats); reset_meas(&UE->ulsch_ldpc_encoding_stats); reset_meas(&UE->ulsch_rate_matching_stats); @@ -1548,6 +1549,7 @@ int main(int argc, char *argv[]) printStatIndent2(&gNB->ulsch_channel_estimation_stats, "ULSCH channel estimation time"); printStatIndent2(&gNB->rx_pusch_init_stats, "RX PUSCH Initialization time"); printStatIndent2(&gNB->rx_pusch_symbol_processing_stats, "RX PUSCH Symbol Processing time"); + printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time"); printf("\nUE TX\n"); printStatIndent(&UE->ulsch_encoding_stats,"ULSCH total encoding time");