Rewrite NR UE PHY cpu measurements
This commit is contained in:
@@ -184,14 +184,12 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
rxdata_ptr = (int16_t *)tmp_dft_in;
|
||||
}
|
||||
|
||||
start_meas(&ue->rx_dft_stats);
|
||||
|
||||
start_meas_nr_ue_phy(ue, RX_DFT_STATS);
|
||||
dft(dftsize,
|
||||
rxdata_ptr,
|
||||
(int16_t *)&rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
|
||||
1);
|
||||
|
||||
stop_meas(&ue->rx_dft_stats);
|
||||
stop_meas_nr_ue_phy(ue, RX_DFT_STATS);
|
||||
|
||||
apply_nr_rotation_RX(frame_parms, rxdataF[aa], frame_parms->symbol_rotation[linktype], Ns, frame_parms->N_RB_DL, 0, symbol, 1);
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ static bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
NR_UE_DLSCH_t *dlsch = (NR_UE_DLSCH_t *) rdata->dlsch;
|
||||
int r = rdata->segment_r;
|
||||
|
||||
merge_meas(&phy_vars_ue->dlsch_deinterleaving_stats, &rdata->ts_deinterleave);
|
||||
merge_meas(&phy_vars_ue->dlsch_rate_unmatching_stats, &rdata->ts_rate_unmatch);
|
||||
merge_meas(&phy_vars_ue->dlsch_ldpc_decoding_stats, &rdata->ts_ldpc_decode);
|
||||
merge_meas(&phy_vars_ue->phy_cpu_stats.cpu_time_stats[DLSCH_DEINTERLEAVING_STATS], &rdata->ts_deinterleave);
|
||||
merge_meas(&phy_vars_ue->phy_cpu_stats.cpu_time_stats[DLSCH_RATE_UNMATCHING_STATS], &rdata->ts_rate_unmatch);
|
||||
merge_meas(&phy_vars_ue->phy_cpu_stats.cpu_time_stats[DLSCH_LDPC_DECODING_STATS], &rdata->ts_ldpc_decode);
|
||||
|
||||
bool decodeSuccess = (rdata->decodeIterations < (1+dlsch->max_ldpc_iterations));
|
||||
|
||||
|
||||
@@ -438,12 +438,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
//--------------------- RBs extraction ---------------------
|
||||
//----------------------------------------------------------
|
||||
const int n_rx = frame_parms->nb_antennas_rx;
|
||||
time_stats_t meas = {0};
|
||||
const bool meas_enabled = cpumeas(CPUMEAS_GETSTATE);
|
||||
|
||||
if (meas_enabled)
|
||||
start_meas(&meas);
|
||||
{
|
||||
start_meas_nr_ue_phy(ue, DLSCH_EXTRACT_RBS_STATS);
|
||||
__attribute__((aligned(32))) c16_t rxdataF_ext[nbRx][rx_size_symbol];
|
||||
memset(rxdataF_ext, 0, sizeof(rxdataF_ext));
|
||||
|
||||
@@ -469,15 +467,15 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
dlsch_config->dlDmrsSymbPos,
|
||||
csi_res_bitmap,
|
||||
ue->chest_time);
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_EXTRACT_RBS_STATS);
|
||||
if (meas_enabled) {
|
||||
stop_meas(&meas);
|
||||
LOG_D(PHY,
|
||||
"[AbsSFN %u.%d] Slot%d Symbol %d: Pilot/Data extraction %5.2f \n",
|
||||
frame,
|
||||
nr_slot_rx,
|
||||
slot,
|
||||
symbol,
|
||||
meas.p_time / (cpuf * 1000.0));
|
||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_EXTRACT_RBS_STATS].p_time / (cpuf * 1000.0));
|
||||
}
|
||||
if (ue->phy_sim_pdsch_rxdataF_ext)
|
||||
for (unsigned char aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
@@ -491,25 +489,23 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
//----------------------------------------------------------
|
||||
//--------------------- Channel Scaling --------------------
|
||||
//----------------------------------------------------------
|
||||
if (meas_enabled)
|
||||
start_meas(&meas);
|
||||
start_meas_nr_ue_phy(ue, DLSCH_CHANNEL_SCALE_STATS);
|
||||
nr_dlsch_scale_channel(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, n_rx, symbol, pilots, nb_re_pdsch, nb_rb_pdsch);
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_SCALE_STATS);
|
||||
if (meas_enabled) {
|
||||
stop_meas(&meas);
|
||||
LOG_D(PHY,
|
||||
"[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",
|
||||
frame,
|
||||
nr_slot_rx,
|
||||
slot,
|
||||
symbol,
|
||||
meas.p_time / (cpuf * 1000.0));
|
||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_CHANNEL_SCALE_STATS].p_time / (cpuf * 1000.0));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- Channel Level Calc. ----------------
|
||||
//----------------------------------------------------------
|
||||
if (meas_enabled)
|
||||
start_meas(&meas);
|
||||
start_meas_nr_ue_phy(ue, DLSCH_CHANNEL_LEVEL_STATS);
|
||||
if (first_symbol_flag) {
|
||||
int32_t avg[MAX_ANT][MAX_ANT] = {};
|
||||
if (nb_re_pdsch)
|
||||
@@ -537,8 +533,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
// LOG_I(PHY, "avgs Power per SC is %d lg2_maxh %d\n", avgs, log2_maxh);
|
||||
LOG_D(PHY, "[DLSCH] AbsSubframe %d.%d log2_maxh = %d (%d)\n", frame % 1024, nr_slot_rx, *log2_maxh, avgs);
|
||||
}
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_LEVEL_STATS);
|
||||
if (meas_enabled) {
|
||||
stop_meas(&meas);
|
||||
LOG_D(PHY,
|
||||
"[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",
|
||||
frame,
|
||||
@@ -546,7 +542,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
slot,
|
||||
symbol,
|
||||
first_symbol_flag,
|
||||
meas.p_time / (cpuf * 1000.0));
|
||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_CHANNEL_LEVEL_STATS].p_time / (cpuf * 1000.0));
|
||||
}
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_PDSCH_ENERGY, T_INT(gNB_id), T_INT(0), T_INT(frame % 1024), T_INT(nr_slot_rx));
|
||||
@@ -556,8 +552,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
//--------------------- channel compensation ---------------
|
||||
//----------------------------------------------------------
|
||||
// Disable correlation measurement for optimizing UE
|
||||
if (meas_enabled)
|
||||
start_meas(&meas);
|
||||
start_meas_nr_ue_phy(ue, DLSCH_CHANNEL_COMPENSATION_STATS);
|
||||
nr_dlsch_channel_compensation(rx_size_symbol,
|
||||
nbRx,
|
||||
rxdataF_ext,
|
||||
@@ -576,8 +571,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
nb_rb_pdsch,
|
||||
*log2_maxh,
|
||||
measurements); // log2_maxh+I0_shift
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_COMPENSATION_STATS);
|
||||
if (meas_enabled) {
|
||||
stop_meas(&meas);
|
||||
LOG_D(PHY,
|
||||
"[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",
|
||||
frame,
|
||||
@@ -585,13 +580,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
slot,
|
||||
symbol,
|
||||
*log2_maxh,
|
||||
meas.p_time / (cpuf * 1000.0));
|
||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_CHANNEL_COMPENSATION_STATS].p_time / (cpuf * 1000.0));
|
||||
}
|
||||
}
|
||||
|
||||
if (meas_enabled)
|
||||
start_meas(&meas);
|
||||
|
||||
start_meas_nr_ue_phy(ue, DLSCH_MRC_MMSE_STATS);
|
||||
if (n_rx > 1) {
|
||||
nr_dlsch_detection_mrc(rx_size_symbol,
|
||||
nl,
|
||||
@@ -620,20 +613,20 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
nb_re_pdsch,
|
||||
nvar);
|
||||
}
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_MRC_MMSE_STATS);
|
||||
|
||||
if (meas_enabled) {
|
||||
stop_meas(&meas);
|
||||
LOG_D(PHY,
|
||||
"[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and MMSE %5.2f \n",
|
||||
frame,
|
||||
nr_slot_rx,
|
||||
slot,
|
||||
symbol,
|
||||
meas.p_time / (cpuf * 1000.0));
|
||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_MRC_MMSE_STATS].p_time / (cpuf * 1000.0));
|
||||
}
|
||||
|
||||
if (meas_enabled)
|
||||
start_meas(&meas);
|
||||
|
||||
|
||||
/* Store the valid DL RE's */
|
||||
dl_valid_re[symbol-1] = nb_re_pdsch;
|
||||
int startSymbIdx = 0;
|
||||
@@ -682,6 +675,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
else
|
||||
first_symbol_flag = 0;
|
||||
/* Calculate LLR's for each symbol */
|
||||
start_meas_nr_ue_phy(ue, DLSCH_LLR_STATS);
|
||||
nr_dlsch_llr(rx_size_symbol,
|
||||
nbRx,
|
||||
rx_llr_layer_size,
|
||||
@@ -703,8 +697,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
nr_slot_rx,
|
||||
dlsch,
|
||||
llr_offset);
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_LLR_STATS);
|
||||
}
|
||||
|
||||
start_meas_nr_ue_phy(ue, DLSCH_LAYER_DEMAPPING);
|
||||
nr_dlsch_layer_demapping(llr,
|
||||
dlsch[0].Nl,
|
||||
dlsch[0].dlsch_config.qamModOrder,
|
||||
@@ -713,6 +709,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
codeword_TB1,
|
||||
rx_llr_layer_size,
|
||||
layer_llr);
|
||||
stop_meas_nr_ue_phy(ue, DLSCH_LAYER_DEMAPPING);
|
||||
// Please keep it: useful for debugging
|
||||
#ifdef DEBUG_PDSCH_RX
|
||||
char filename[50];
|
||||
@@ -742,14 +739,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
if (meas_enabled) {
|
||||
stop_meas(&meas);
|
||||
LOG_D(PHY,
|
||||
"[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",
|
||||
frame,
|
||||
nr_slot_rx,
|
||||
slot,
|
||||
symbol,
|
||||
meas.p_time / (cpuf * 1000.0));
|
||||
ue->phy_cpu_stats.cpu_time_stats[DLSCH_LLR_STATS].p_time / (cpuf * 1000.0));
|
||||
}
|
||||
|
||||
#if T_TRACER
|
||||
|
||||
@@ -48,7 +48,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
uint32_t tb_size,
|
||||
unsigned int G)
|
||||
{
|
||||
start_meas(&ue->ulsch_encoding_stats);
|
||||
start_meas_nr_ue_phy(ue, ULSCH_ENCODING_STATS);
|
||||
|
||||
/////////////////////////parameters and variables initialization/////////////////////////
|
||||
|
||||
@@ -107,7 +107,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
harq_process->BG = ulsch->pusch_pdu.ldpcBaseGraph;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
|
||||
start_meas(&ue->ulsch_segmentation_stats);
|
||||
start_meas_nr_ue_phy(ue, ULSCH_SEGMENTATION_STATS);
|
||||
impp.Kb = nr_segmentation(harq_process->payload_AB,
|
||||
harq_process->c,
|
||||
B,
|
||||
@@ -126,7 +126,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
LOG_E(PHY, "nr_segmentation.c: too many segments %d, B %d\n", impp.n_segments, B);
|
||||
return(-1);
|
||||
}
|
||||
stop_meas(&ue->ulsch_segmentation_stats);
|
||||
stop_meas_nr_ue_phy(ue, ULSCH_SEGMENTATION_STATS);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
@@ -148,7 +148,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
|
||||
}
|
||||
start_meas(&ue->ulsch_ldpc_encoding_stats);
|
||||
|
||||
start_meas_nr_ue_phy(ue, ULSCH_LDPC_ENCODING_STATS);
|
||||
if (ldpc_interface_offload.LDPCencoder) {
|
||||
for (int j = 0; j < impp.n_segments; j++) {
|
||||
impp.perCB[j].E_cb = nr_get_E(G, impp.n_segments, impp.Qm, ulsch->pusch_pdu.nrOfLayers, j);
|
||||
@@ -168,6 +169,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
write_output("ulsch_enc_output0.m", "enc0", &harq_process->d[0][0], (3 * 8 * Kr_bytes) + 12, 1, 4);
|
||||
#endif
|
||||
}
|
||||
stop_meas_nr_ue_phy(ue, ULSCH_LDPC_ENCODING_STATS);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
for (int r = 0; r < impp.n_segments; r++) { // looping over C segments
|
||||
if (impp.F > 0) {
|
||||
@@ -191,7 +193,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
impp.perCB[r].E_cb = nr_get_E(G, impp.n_segments, impp.Qm, ulsch->pusch_pdu.nrOfLayers, r);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
|
||||
start_meas(&ue->ulsch_rate_matching_stats);
|
||||
start_meas(&ue->phy_cpu_stats.cpu_time_stats[ULSCH_RATE_MATCHING_STATS]);
|
||||
if (nr_rate_matching_ldpc(ulsch->pusch_pdu.tbslbrm,
|
||||
impp.BG,
|
||||
impp.Zc,
|
||||
@@ -205,7 +207,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
== -1)
|
||||
return -1;
|
||||
|
||||
stop_meas(&ue->ulsch_rate_matching_stats);
|
||||
stop_meas(&ue->phy_cpu_stats.cpu_time_stats[ULSCH_RATE_MATCHING_STATS]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_OUT);
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
@@ -215,9 +217,9 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
|
||||
///////////////////////// e---->| Rate matching bit interleaving |---->f /////////////////////////
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_IN);
|
||||
start_meas(&ue->ulsch_interleaving_stats);
|
||||
start_meas_nr_ue_phy(ue, ULSCH_INTERLEAVING_STATS);
|
||||
nr_interleaving_ldpc(impp.perCB[r].E_cb, impp.Qm, harq_process->e + r_offset, harq_process->f + r_offset);
|
||||
stop_meas(&ue->ulsch_interleaving_stats);
|
||||
stop_meas_nr_ue_phy(ue, ULSCH_INTERLEAVING_STATS);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_OUT);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
@@ -231,6 +233,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
stop_meas(&ue->ulsch_encoding_stats);
|
||||
stop_meas_nr_ue_phy(ue, ULSCH_ENCODING_STATS);
|
||||
return(0);
|
||||
}
|
||||
|
||||
+12
-49
@@ -40,6 +40,7 @@
|
||||
#include "defs_nr_common.h"
|
||||
#include "CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/defs_nr_sl_UE.h"
|
||||
#include "openair1/PHY/nr_phy_common/inc/nr_ue_phy_meas.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -527,56 +528,10 @@ typedef struct PHY_VARS_NR_UE_s {
|
||||
scheduling_request_config_t scheduling_request_config_nr[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
#endif
|
||||
|
||||
time_stats_t phy_proc;
|
||||
time_stats_t phy_proc_tx;
|
||||
time_stats_t phy_proc_rx;
|
||||
|
||||
time_stats_t ue_ul_indication_stats;
|
||||
|
||||
uint32_t use_ia_receiver;
|
||||
|
||||
time_stats_t ofdm_mod_stats;
|
||||
time_stats_t ulsch_encoding_stats;
|
||||
time_stats_t ulsch_ldpc_encoding_stats;
|
||||
time_stats_t ulsch_modulation_stats;
|
||||
time_stats_t ulsch_segmentation_stats;
|
||||
time_stats_t ulsch_rate_matching_stats;
|
||||
time_stats_t ulsch_interleaving_stats;
|
||||
time_stats_t ulsch_multiplexing_stats;
|
||||
|
||||
time_stats_t ue_front_end_stat;
|
||||
time_stats_t ue_front_end_per_slot_stat[LTE_SLOTS_PER_SUBFRAME];
|
||||
time_stats_t pdcch_procedures_stat;
|
||||
time_stats_t pdsch_procedures_stat;
|
||||
time_stats_t pdsch_procedures_per_slot_stat[LTE_SLOTS_PER_SUBFRAME];
|
||||
time_stats_t dlsch_procedures_stat;
|
||||
|
||||
time_stats_t rx_pdsch_stats;
|
||||
time_stats_t ofdm_demod_stats;
|
||||
time_stats_t dlsch_rx_pdcch_stats;
|
||||
time_stats_t rx_dft_stats;
|
||||
time_stats_t dlsch_channel_estimation_stats;
|
||||
time_stats_t dlsch_freq_offset_estimation_stats;
|
||||
time_stats_t dlsch_decoding_stats;
|
||||
time_stats_t dlsch_demodulation_stats;
|
||||
time_stats_t dlsch_rate_unmatching_stats;
|
||||
time_stats_t dlsch_ldpc_decoding_stats;
|
||||
time_stats_t dlsch_deinterleaving_stats;
|
||||
time_stats_t dlsch_llr_stats;
|
||||
time_stats_t dlsch_llr_stats_parallelization[LTE_SLOTS_PER_SUBFRAME];
|
||||
time_stats_t dlsch_unscrambling_stats;
|
||||
time_stats_t dlsch_rate_matching_stats;
|
||||
time_stats_t dlsch_ldpc_encoding_stats;
|
||||
time_stats_t dlsch_interleaving_stats;
|
||||
time_stats_t dlsch_tc_init_stats;
|
||||
time_stats_t dlsch_tc_alpha_stats;
|
||||
time_stats_t dlsch_tc_beta_stats;
|
||||
time_stats_t dlsch_tc_gamma_stats;
|
||||
time_stats_t dlsch_tc_ext_stats;
|
||||
time_stats_t dlsch_tc_intl1_stats;
|
||||
time_stats_t dlsch_tc_intl2_stats;
|
||||
time_stats_t tx_prach;
|
||||
// TODO: move this out of phy
|
||||
time_stats_t ue_ul_indication_stats;
|
||||
nr_ue_phy_cpu_stat_t phy_cpu_stats;
|
||||
|
||||
/// RF and Interface devices per CC
|
||||
openair0_device rfdevice;
|
||||
@@ -706,5 +661,13 @@ typedef struct LDPCDecode_ue_s {
|
||||
UE_nr_rxtx_proc_t proc;
|
||||
} ldpcDecode_ue_t;
|
||||
|
||||
static inline void start_meas_nr_ue_phy(PHY_VARS_NR_UE *ue, int meas_index) {
|
||||
start_meas(&ue->phy_cpu_stats.cpu_time_stats[meas_index]);
|
||||
}
|
||||
|
||||
static inline void stop_meas_nr_ue_phy(PHY_VARS_NR_UE *ue, int meas_index) {
|
||||
stop_meas(&ue->phy_cpu_stats.cpu_time_stats[meas_index]);
|
||||
}
|
||||
|
||||
#include "SIMULATION/ETH_TRANSPORT/defs.h"
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
add_library(nr_phy_common src/nr_phy_common.c)
|
||||
target_link_libraries(nr_phy_common PRIVATE UTIL)
|
||||
target_include_directories(nr_phy_common PUBLIC inc/)
|
||||
|
||||
add_library(nr_ue_phy_meas src/nr_ue_phy_meas.c)
|
||||
target_include_directories(nr_ue_phy_meas PUBLIC inc/)
|
||||
target_link_libraries(nr_ue_phy_meas PUBLIC utils)
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __NR_UE_PHY_MEAS__H__
|
||||
#define __NR_UE_PHY_MEAS__H__
|
||||
#include "time_meas.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define NOOP(a) a
|
||||
#define FOREACH_NR_PHY_CPU_MEAS(FN) \
|
||||
FN(RX_PDSCH_STATS),\
|
||||
FN(DLSCH_RX_PDCCH_STATS),\
|
||||
FN(RX_DFT_STATS),\
|
||||
FN(DLSCH_CHANNEL_ESTIMATION_STATS),\
|
||||
FN(DLSCH_DECODING_STATS),\
|
||||
FN(DLSCH_RATE_UNMATCHING_STATS),\
|
||||
FN(DLSCH_LDPC_DECODING_STATS),\
|
||||
FN(DLSCH_DEINTERLEAVING_STATS),\
|
||||
FN(DLSCH_EXTRACT_RBS_STATS),\
|
||||
FN(DLSCH_CHANNEL_SCALE_STATS),\
|
||||
FN(DLSCH_CHANNEL_LEVEL_STATS),\
|
||||
FN(DLSCH_MRC_MMSE_STATS),\
|
||||
FN(DLSCH_UNSCRAMBLING_STATS),\
|
||||
FN(DLSCH_CHANNEL_COMPENSATION_STATS),\
|
||||
FN(DLSCH_LLR_STATS),\
|
||||
FN(DLSCH_LAYER_DEMAPPING),\
|
||||
FN(PHY_RX_PDCCH_STATS),\
|
||||
FN(DLSCH_PROCEDURES_STATS),\
|
||||
FN(PHY_PROC_TX),\
|
||||
FN(ULSCH_SEGMENTATION_STATS),\
|
||||
FN(ULSCH_LDPC_ENCODING_STATS),\
|
||||
FN(ULSCH_RATE_MATCHING_STATS),\
|
||||
FN(ULSCH_INTERLEAVING_STATS),\
|
||||
FN(ULSCH_ENCODING_STATS)
|
||||
|
||||
typedef enum {
|
||||
FOREACH_NR_PHY_CPU_MEAS(NOOP),
|
||||
MAX_CPU_STAT_TYPE
|
||||
} nr_ue_phy_cpu_stat_type_t;
|
||||
|
||||
typedef struct nr_ue_phy_cpu_stat_t {
|
||||
time_stats_t cpu_time_stats[MAX_CPU_STAT_TYPE];
|
||||
} nr_ue_phy_cpu_stat_t;
|
||||
|
||||
void init_nr_ue_phy_cpu_stats(nr_ue_phy_cpu_stat_t *ue_phy_cpu_stats);
|
||||
void reset_nr_ue_phy_cpu_stats(nr_ue_phy_cpu_stat_t *ue_phy_cpu_stats);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "nr_ue_phy_meas.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
void init_nr_ue_phy_cpu_stats(nr_ue_phy_cpu_stat_t *ue_phy_cpu_stats) {
|
||||
reset_nr_ue_phy_cpu_stats(ue_phy_cpu_stats);
|
||||
const char* cpu_stats_enum_to_string_table[] = {
|
||||
FOREACH_NR_PHY_CPU_MEAS(TO_STRING)
|
||||
};
|
||||
for (int i = 0; i < MAX_CPU_STAT_TYPE; i++) {
|
||||
ue_phy_cpu_stats->cpu_time_stats[i].meas_name = strdup(cpu_stats_enum_to_string_table[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void reset_nr_ue_phy_cpu_stats(nr_ue_phy_cpu_stat_t *ue_phy_cpu_stats) {
|
||||
for (int i = 0; i < MAX_CPU_STAT_TYPE; i++) {
|
||||
reset_meas(&ue_phy_cpu_stats->cpu_time_stats[i]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user