diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 6a914fc33e..a94db960c0 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -38,6 +38,7 @@ #include "assertions.h" #include #include +#include "rt_profiling.h" #include "PHY/types.h" @@ -115,10 +116,17 @@ void tx_func(void *param) { int frame_tx = info->frame; int slot_tx = info->slot; + int absslot_tx = info->timestamp_tx/info->gNB->frame_parms.get_samples_per_slot(slot_tx,&info->gNB->frame_parms); + int absslot_rx = absslot_tx-info->gNB->RU_list[0]->sl_ahead; + int rt_prof_idx = absslot_rx % RT_PROF_DEPTH; + + clock_gettime(CLOCK_MONOTONIC,&info->gNB->rt_L1_profiling.start_L1_TX[rt_prof_idx]); phy_procedures_gNB_TX(info, frame_tx, slot_tx, 1); + clock_gettime(CLOCK_MONOTONIC,&info->gNB->rt_L1_profiling.return_L1_TX[rt_prof_idx]); + } void rx_func(void *param) { @@ -130,6 +138,11 @@ void rx_func(void *param) { int slot_tx = info->slot_tx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; + int absslot_tx = info->timestamp_tx/gNB->frame_parms.get_samples_per_slot(slot_rx,&gNB->frame_parms); + int absslot_rx = absslot_tx - gNB->RU_list[0]->sl_ahead; + int rt_prof_idx = absslot_rx % RT_PROF_DEPTH; + + clock_gettime(CLOCK_MONOTONIC,&info->gNB->rt_L1_profiling.start_L1_RX[rt_prof_idx]); start_meas(&softmodem_stats_rxtx_sf); // ******************************************************************* @@ -229,6 +242,7 @@ void rx_func(void *param) { stop_meas( &softmodem_stats_rxtx_sf ); LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, frame_rx, slot_rx, frame_tx, slot_tx); + clock_gettime(CLOCK_MONOTONIC,&info->gNB->rt_L1_profiling.return_L1_RX[rt_prof_idx]); // Call the scheduler start_meas(&gNB->ul_indication_stats); diff --git a/executables/rt_profiling.h b/executables/rt_profiling.h index ada628e419..e37c37bb1e 100644 --- a/executables/rt_profiling.h +++ b/executables/rt_profiling.h @@ -50,12 +50,14 @@ typedef struct { } rt_ru_profiling_t; typedef struct { - int absslot_rx[RT_PROF_DEPTH]; + int absslot_ux[RT_PROF_DEPTH]; + struct timespec start_L1_RX[RT_PROF_DEPTH]; struct timespec return_L1_RX[RT_PROF_DEPTH]; + struct timespec start_L1_TX[RT_PROF_DEPTH]; struct timespec return_L1_TX[RT_PROF_DEPTH]; struct timespec return_L1_prachrx[RT_PROF_DEPTH]; - struct timespec return_L1_pushL1[RT_PROF_DEPTH]; -} rt_l1_profiling_t; + struct timespec return_L1_puschL1[RT_PROF_DEPTH]; +} rt_L1_profiling_t; #ifdef __cplusplus } #endif diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 9ed6f50616..7001a7e4d6 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -42,6 +42,7 @@ #include "PHY/defs_common.h" #include "PHY/CODING/nrLDPC_extern.h" #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" +#include "executables/rt_profiling.h" #include "nfapi_nr_interface_scf.h" @@ -908,6 +909,8 @@ typedef struct PHY_VARS_gNB_s { int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; + /// structure for analyzing high-level RT measurements + rt_L1_profiling_t rt_L1_profiling; } PHY_VARS_gNB; typedef struct LDPCDecode_s {