Commit 1b35f0b1 authored by Raymond Knopp's avatar Raymond Knopp

added profiling circular buffer to gNB

parent afed0cec
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "assertions.h" #include "assertions.h"
#include <common/utils/LOG/log.h> #include <common/utils/LOG/log.h>
#include <common/utils/system.h> #include <common/utils/system.h>
#include "rt_profiling.h"
#include "PHY/types.h" #include "PHY/types.h"
...@@ -115,10 +116,17 @@ void tx_func(void *param) { ...@@ -115,10 +116,17 @@ void tx_func(void *param) {
int frame_tx = info->frame; int frame_tx = info->frame;
int slot_tx = info->slot; 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, phy_procedures_gNB_TX(info,
frame_tx, frame_tx,
slot_tx, slot_tx,
1); 1);
clock_gettime(CLOCK_MONOTONIC,&info->gNB->rt_L1_profiling.return_L1_TX[rt_prof_idx]);
} }
void rx_func(void *param) { void rx_func(void *param) {
...@@ -130,6 +138,11 @@ void rx_func(void *param) { ...@@ -130,6 +138,11 @@ void rx_func(void *param) {
int slot_tx = info->slot_tx; int slot_tx = info->slot_tx;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; 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); start_meas(&softmodem_stats_rxtx_sf);
// ******************************************************************* // *******************************************************************
...@@ -229,6 +242,7 @@ void rx_func(void *param) { ...@@ -229,6 +242,7 @@ void rx_func(void *param) {
stop_meas( &softmodem_stats_rxtx_sf ); 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); 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 // Call the scheduler
start_meas(&gNB->ul_indication_stats); start_meas(&gNB->ul_indication_stats);
......
...@@ -50,12 +50,14 @@ typedef struct { ...@@ -50,12 +50,14 @@ typedef struct {
} rt_ru_profiling_t; } rt_ru_profiling_t;
typedef struct { 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 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_TX[RT_PROF_DEPTH];
struct timespec return_L1_prachrx[RT_PROF_DEPTH]; struct timespec return_L1_prachrx[RT_PROF_DEPTH];
struct timespec return_L1_pushL1[RT_PROF_DEPTH]; struct timespec return_L1_puschL1[RT_PROF_DEPTH];
} rt_l1_profiling_t; } rt_L1_profiling_t;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/CODING/nrLDPC_extern.h" #include "PHY/CODING/nrLDPC_extern.h"
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
#include "executables/rt_profiling.h"
#include "nfapi_nr_interface_scf.h" #include "nfapi_nr_interface_scf.h"
...@@ -908,6 +909,8 @@ typedef struct PHY_VARS_gNB_s { ...@@ -908,6 +909,8 @@ typedef struct PHY_VARS_gNB_s {
int number_of_nr_dlsch_max; int number_of_nr_dlsch_max;
int number_of_nr_ulsch_max; int number_of_nr_ulsch_max;
void * scopeData; void * scopeData;
/// structure for analyzing high-level RT measurements
rt_L1_profiling_t rt_L1_profiling;
} PHY_VARS_gNB; } PHY_VARS_gNB;
typedef struct LDPCDecode_s { typedef struct LDPCDecode_s {
......
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