Commit 1b69fc6c authored by Laurent THOMAS's avatar Laurent THOMAS

fix incorrect usage of time_meas() that is not thread safe API

parent e74b9a5c
...@@ -110,8 +110,6 @@ ...@@ -110,8 +110,6 @@
{"ulsch_ldpc_encoding_stats", &(UE->ulsch_ldpc_encoding_stats),0,1},\ {"ulsch_ldpc_encoding_stats", &(UE->ulsch_ldpc_encoding_stats),0,1},\
{"ulsch_interleaving_stats", &(UE->ulsch_interleaving_stats),0,1},\ {"ulsch_interleaving_stats", &(UE->ulsch_interleaving_stats),0,1},\
{"ulsch_multiplexing_stats", &(UE->ulsch_multiplexing_stats),0,1},\ {"ulsch_multiplexing_stats", &(UE->ulsch_multiplexing_stats),0,1},\
{"generic_stat", &(UE->generic_stat),0,1},\
{"generic_stat_bis", &(UE->generic_stat_bis[0]),0,LTE_SLOTS_PER_SUBFRAME},\
{"ofdm_demod_stats", &(UE->ofdm_demod_stats),0,1},\ {"ofdm_demod_stats", &(UE->ofdm_demod_stats),0,1},\
{"dlsch_rx_pdcch_stats", &(UE->dlsch_rx_pdcch_stats),0,1},\ {"dlsch_rx_pdcch_stats", &(UE->dlsch_rx_pdcch_stats),0,1},\
{"rx_dft_stats", &(UE->rx_dft_stats),0,1},\ {"rx_dft_stats", &(UE->rx_dft_stats),0,1},\
......
...@@ -406,8 +406,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -406,8 +406,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//--------------------- RBs extraction --------------------- //--------------------- RBs extraction ---------------------
//---------------------------------------------------------- //----------------------------------------------------------
const int n_rx = frame_parms->nb_antennas_rx; const int n_rx = frame_parms->nb_antennas_rx;
time_stats_t meas = {0};
const bool meas_enabled = cpumeas(CPUMEAS_GETSTATE);
start_meas(&ue->generic_stat_bis[slot]); if (meas_enabled)
start_meas(&meas);
{ {
__attribute__((aligned(32))) c16_t rxdataF_ext[nbRx][rx_size_symbol]; __attribute__((aligned(32))) c16_t rxdataF_ext[nbRx][rx_size_symbol];
memset(rxdataF_ext, 0, sizeof(rxdataF_ext)); memset(rxdataF_ext, 0, sizeof(rxdataF_ext));
...@@ -429,14 +432,21 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -429,14 +432,21 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
frame_parms, frame_parms,
dlsch[0].dlsch_config.dlDmrsSymbPos, dlsch[0].dlsch_config.dlDmrsSymbPos,
ue->chest_time); ue->chest_time);
stop_meas(&ue->generic_stat_bis[slot]); 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));
}
if (ue->phy_sim_pdsch_rxdataF_ext) if (ue->phy_sim_pdsch_rxdataF_ext)
for (unsigned char aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { for (unsigned char aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
int offset = ((void *)rxdataF_ext[aarx] - (void *)rxdataF_ext) + symbol * rx_size_symbol; int offset = ((void *)rxdataF_ext[aarx] - (void *)rxdataF_ext) + symbol * rx_size_symbol;
memcpy(ue->phy_sim_pdsch_rxdataF_ext + offset, rxdataF_ext, rx_size_symbol * sizeof(c16_t)); memcpy(ue->phy_sim_pdsch_rxdataF_ext + offset, rxdataF_ext, rx_size_symbol * sizeof(c16_t));
} }
if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Pilot/Data extraction %5.2f \n", frame, nr_slot_rx, slot, symbol, ue->generic_stat_bis[slot].p_time / (cpuf * 1000.0));
nb_re_pdsch = (pilots == 1) nb_re_pdsch = (pilots == 1)
? ((config_type == NFAPI_NR_DMRS_TYPE1) ? nb_rb_pdsch * (12 - 6 * dlsch[0].dlsch_config.n_dmrs_cdm_groups) : nb_rb_pdsch * (12 - 4 * dlsch[0].dlsch_config.n_dmrs_cdm_groups)) ? ((config_type == NFAPI_NR_DMRS_TYPE1) ? nb_rb_pdsch * (12 - 6 * dlsch[0].dlsch_config.n_dmrs_cdm_groups) : nb_rb_pdsch * (12 - 4 * dlsch[0].dlsch_config.n_dmrs_cdm_groups))
...@@ -444,18 +454,26 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -444,18 +454,26 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//---------------------------------------------------------- //----------------------------------------------------------
//--------------------- Channel Scaling -------------------- //--------------------- Channel Scaling --------------------
//---------------------------------------------------------- //----------------------------------------------------------
start_meas(&ue->generic_stat_bis[slot]); if (meas_enabled)
start_meas(&meas);
nr_dlsch_scale_channel(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, n_rx, symbol, pilots, nb_re_pdsch, nb_rb_pdsch); 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(&ue->generic_stat_bis[slot]); if (meas_enabled) {
stop_meas(&meas);
if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY,
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n", frame, nr_slot_rx, slot, symbol, ue->generic_stat_bis[slot].p_time / (cpuf * 1000.0)); "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",
frame,
nr_slot_rx,
slot,
symbol,
meas.p_time / (cpuf * 1000.0));
}
//---------------------------------------------------------- //----------------------------------------------------------
//--------------------- Channel Level Calc. ---------------- //--------------------- Channel Level Calc. ----------------
//---------------------------------------------------------- //----------------------------------------------------------
start_meas(&ue->generic_stat_bis[slot]); if (meas_enabled)
if (first_symbol_flag==1) { start_meas(&meas);
if (first_symbol_flag == 1) {
nr_dlsch_channel_level(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, avg, symbol, nb_re_pdsch, nb_rb_pdsch); nr_dlsch_channel_level(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, avg, symbol, nb_re_pdsch, nb_rb_pdsch);
avgs = 0; avgs = 0;
for (aatx=0;aatx<nl;aatx++) for (aatx=0;aatx<nl;aatx++)
...@@ -476,45 +494,56 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -476,45 +494,56 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
*log2_maxh = (log2_approx(avgs)/2) + 1; *log2_maxh = (log2_approx(avgs)/2) + 1;
//LOG_I(PHY, "avgs Power per SC is %d lg2_maxh %d\n", avgs, log2_maxh); //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,%d)\n", frame % 1024, nr_slot_rx, *log2_maxh, avg[0], avgs); LOG_D(PHY, "[DLSCH] AbsSubframe %d.%d log2_maxh = %d (%d,%d)\n", frame % 1024, nr_slot_rx, *log2_maxh, avg[0], avgs);
} }
stop_meas(&ue->generic_stat_bis[slot]); 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,
nr_slot_rx,
slot,
symbol,
first_symbol_flag,
meas.p_time / (cpuf * 1000.0));
}
#if T_TRACER #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), T(T_UE_PHY_PDSCH_ENERGY,
T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3])); T_INT(gNB_id),
T_INT(0),
T_INT(frame % 1024),
T_INT(nr_slot_rx),
T_INT(avg[0]),
T_INT(avg[1]),
T_INT(avg[2]),
T_INT(avg[3]));
#endif #endif
if (cpumeas(CPUMEAS_GETSTATE)) //----------------------------------------------------------
LOG_D(PHY, //--------------------- channel compensation ---------------
"[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n", //----------------------------------------------------------
frame, nr_slot_rx, slot, symbol, first_symbol_flag, ue->generic_stat_bis[slot].p_time / (cpuf * 1000.0)); // Disable correlation measurement for optimizing UE
if (meas_enabled)
//---------------------------------------------------------- start_meas(&meas);
//--------------------- channel compensation --------------- nr_dlsch_channel_compensation(rx_size_symbol,
//---------------------------------------------------------- nbRx,
// Disable correlation measurement for optimizing UE rxdataF_ext,
start_meas(&ue->generic_stat_bis[slot]); dl_ch_estimates_ext,
nr_dlsch_channel_compensation(rx_size_symbol, dl_ch_mag,
nbRx, dl_ch_magb,
rxdataF_ext, dl_ch_magr,
dl_ch_estimates_ext, rxdataF_comp,
dl_ch_mag, NULL,
dl_ch_magb, frame_parms,
dl_ch_magr, nl,
rxdataF_comp, symbol,
NULL, nb_re_pdsch,
frame_parms, first_symbol_flag,
nl, dlsch[0].dlsch_config.qamModOrder,
symbol, nb_rb_pdsch,
nb_re_pdsch, *log2_maxh,
first_symbol_flag, measurements); // log2_maxh+I0_shift
dlsch[0].dlsch_config.qamModOrder, if (meas_enabled) {
nb_rb_pdsch, stop_meas(&meas);
*log2_maxh,
measurements); // log2_maxh+I0_shift
stop_meas(&ue->generic_stat_bis[slot]);
}
if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY, LOG_D(PHY,
"[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n", "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d Channel Comp %5.2f \n",
frame, frame,
...@@ -522,22 +551,54 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -522,22 +551,54 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
slot, slot,
symbol, symbol,
*log2_maxh, *log2_maxh,
ue->generic_stat_bis[slot].p_time / (cpuf * 1000.0)); meas.p_time / (cpuf * 1000.0));
}
}
start_meas(&ue->generic_stat_bis[slot]); if (meas_enabled)
start_meas(&meas);
if (n_rx > 1) { if (n_rx > 1) {
nr_dlsch_detection_mrc(rx_size_symbol, nl, n_rx, rxdataF_comp, NULL, dl_ch_mag, dl_ch_magb, dl_ch_magr, symbol, nb_rb_pdsch, nb_re_pdsch); nr_dlsch_detection_mrc(rx_size_symbol,
if (nl >= 2)//Apply zero forcing for 2, 3, and 4 Tx layers nl,
nr_zero_forcing_rx( n_rx,
rx_size_symbol, n_rx, nl, rxdataF_comp, dl_ch_mag, dl_ch_magb, dl_ch_magr, dl_ch_estimates_ext, nb_rb_pdsch, dlsch[0].dlsch_config.qamModOrder, *log2_maxh, symbol, nb_re_pdsch); rxdataF_comp,
NULL,
dl_ch_mag,
dl_ch_magb,
dl_ch_magr,
symbol,
nb_rb_pdsch,
nb_re_pdsch);
if (nl >= 2) // Apply zero forcing for 2, 3, and 4 Tx layers
nr_zero_forcing_rx(rx_size_symbol,
n_rx,
nl,
rxdataF_comp,
dl_ch_mag,
dl_ch_magb,
dl_ch_magr,
dl_ch_estimates_ext,
nb_rb_pdsch,
dlsch[0].dlsch_config.qamModOrder,
*log2_maxh,
symbol,
nb_re_pdsch);
} }
stop_meas(&ue->generic_stat_bis[slot]);
if (cpumeas(CPUMEAS_GETSTATE)) if (meas_enabled) {
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and zero forcing %5.2f \n", frame, nr_slot_rx, slot, symbol, ue->generic_stat_bis[slot].p_time / (cpuf * 1000.0)); stop_meas(&meas);
LOG_D(PHY,
"[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and zero forcing %5.2f \n",
frame,
nr_slot_rx,
slot,
symbol,
meas.p_time / (cpuf * 1000.0));
}
start_meas(&ue->generic_stat_bis[slot]); if (meas_enabled)
start_meas(&meas);
/* Store the valid DL RE's */ /* Store the valid DL RE's */
dl_valid_re[symbol-1] = nb_re_pdsch; dl_valid_re[symbol-1] = nb_re_pdsch;
...@@ -652,9 +713,16 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -652,9 +713,16 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#endif #endif
} }
stop_meas(&ue->generic_stat_bis[slot]); if (meas_enabled) {
if (cpumeas(CPUMEAS_GETSTATE)) stop_meas(&meas);
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n", frame, nr_slot_rx, slot, symbol, ue->generic_stat_bis[slot].p_time / (cpuf * 1000.0)); 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));
}
#if T_TRACER #if T_TRACER
T(T_UE_PHY_PDSCH_IQ, T(T_UE_PHY_PDSCH_IQ,
......
...@@ -592,8 +592,6 @@ typedef struct { ...@@ -592,8 +592,6 @@ typedef struct {
time_stats_t ulsch_interleaving_stats; time_stats_t ulsch_interleaving_stats;
time_stats_t ulsch_multiplexing_stats; time_stats_t ulsch_multiplexing_stats;
time_stats_t generic_stat;
time_stats_t generic_stat_bis[LTE_SLOTS_PER_SUBFRAME];
time_stats_t ue_front_end_stat; time_stats_t ue_front_end_stat;
time_stats_t ue_front_end_per_slot_stat[LTE_SLOTS_PER_SUBFRAME]; time_stats_t ue_front_end_per_slot_stat[LTE_SLOTS_PER_SUBFRAME];
time_stats_t pdcch_procedures_stat; time_stats_t pdcch_procedures_stat;
......
...@@ -1019,7 +1019,8 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, ...@@ -1019,7 +1019,8 @@ void pdsch_processing(PHY_VARS_NR_UE *ue,
int gNB_id = proc->gNB_id; int gNB_id = proc->gNB_id;
NR_UE_DLSCH_t *dlsch = &phy_data->dlsch[0]; NR_UE_DLSCH_t *dlsch = &phy_data->dlsch[0];
start_meas(&ue->generic_stat); time_stats_t meas = {0};
start_meas(&meas);
// do procedures for C-RNTI // do procedures for C-RNTI
int ret_pdsch = 0; int ret_pdsch = 0;
...@@ -1131,7 +1132,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, ...@@ -1131,7 +1132,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue,
ue->csirs_vars[gNB_id]->active = 0; ue->csirs_vars[gNB_id]->active = 0;
} }
start_meas(&ue->generic_stat); start_meas(&meas);
if (nr_slot_rx==9) { if (nr_slot_rx==9) {
if (frame_rx % 10 == 0) { if (frame_rx % 10 == 0) {
...@@ -1157,9 +1158,9 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, ...@@ -1157,9 +1158,9 @@ void pdsch_processing(PHY_VARS_NR_UE *ue,
} }
stop_meas(&ue->generic_stat); stop_meas(&meas);
if (cpumeas(CPUMEAS_GETSTATE)) if (cpumeas(CPUMEAS_GETSTATE))
LOG_D(PHY, "after ldpc decode until end of Rx %5.2f \n", ue->generic_stat.p_time / (cpuf * 1000.0)); LOG_D(PHY, "after ldpc decode until end of Rx %5.2f \n", meas.p_time / (cpuf * 1000.0));
#ifdef EMOS #ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,gNB_id); phy_procedures_emos_UE_RX(ue,slot,gNB_id);
......
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