fix(nr_dlsch): time meas in TX symbol processing
* Global timers were started and stopped in the TX symbol processing tasks which is not thread safe * gNBs nrL1_stats.log now shows PDSCH generation time rather than layer mapping and precoding times
This commit is contained in:
@@ -208,8 +208,7 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
|
|||||||
output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output);
|
output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output);
|
||||||
output += print_meas_log(&gNB->dlsch_modulation_stats, "DLSCH modulation", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->dlsch_modulation_stats, "DLSCH modulation", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->dlsch_resource_mapping_stats, "DLSCH resource mapping", NULL, NULL, output,end-output);
|
output += print_meas_log(&gNB->dlsch_pdsch_generation_stats, "PDSCH generation", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->dlsch_precoding_stats, "DLSCH precoding", NULL, NULL, output,end-output);
|
|
||||||
output += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->ts_deinterleave, "UL segment deinterleaving", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->ts_deinterleave, "UL segment deinterleaving", NULL, NULL, output, end - output);
|
||||||
output += print_meas_log(&gNB->ts_rate_unmatch, "UL segment rate recovery", NULL, NULL, output, end - output);
|
output += print_meas_log(&gNB->ts_rate_unmatch, "UL segment rate recovery", NULL, NULL, output, end - output);
|
||||||
@@ -280,8 +279,7 @@ void *nrL1_stats_thread(void *param) {
|
|||||||
reset_meas(&gNB->rx_pusch_stats);
|
reset_meas(&gNB->rx_pusch_stats);
|
||||||
reset_meas(&gNB->dlsch_scrambling_stats);
|
reset_meas(&gNB->dlsch_scrambling_stats);
|
||||||
reset_meas(&gNB->dlsch_modulation_stats);
|
reset_meas(&gNB->dlsch_modulation_stats);
|
||||||
reset_meas(&gNB->dlsch_resource_mapping_stats);
|
reset_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||||
reset_meas(&gNB->dlsch_precoding_stats);
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) {
|
if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) {
|
||||||
|
|||||||
@@ -486,6 +486,8 @@ typedef struct pdschSymbolProc_s {
|
|||||||
unsigned int beam_nb;
|
unsigned int beam_nb;
|
||||||
unsigned int re_beginning_of_symbol[14];
|
unsigned int re_beginning_of_symbol[14];
|
||||||
c16_t *tx_layers[4];
|
c16_t *tx_layers[4];
|
||||||
|
time_stats_t dlsch_resource_mapping_stats;
|
||||||
|
time_stats_t dlsch_precoding_stats;
|
||||||
} pdschSymbolProc_t;
|
} pdschSymbolProc_t;
|
||||||
|
|
||||||
static void nr_pdsch_symbol_processing(void *arg)
|
static void nr_pdsch_symbol_processing(void *arg)
|
||||||
@@ -518,7 +520,7 @@ static void nr_pdsch_symbol_processing(void *arg)
|
|||||||
rel15->nrOfLayers);
|
rel15->nrOfLayers);
|
||||||
#endif
|
#endif
|
||||||
for (int l_symbol = rdata->startSymbol; l_symbol < rdata->startSymbol + rdata->numSymbols; l_symbol++) {
|
for (int l_symbol = rdata->startSymbol; l_symbol < rdata->startSymbol + rdata->numSymbols; l_symbol++) {
|
||||||
start_meas(&gNB->dlsch_resource_mapping_stats);
|
start_meas(&rdata->dlsch_resource_mapping_stats);
|
||||||
int l_prime = 0; // single symbol layer 0
|
int l_prime = 0; // single symbol layer 0
|
||||||
int l_overline = get_l0(rel15->dlDmrsSymbPos);
|
int l_overline = get_l0(rel15->dlDmrsSymbPos);
|
||||||
|
|
||||||
@@ -581,14 +583,14 @@ static void nr_pdsch_symbol_processing(void *arg)
|
|||||||
rel15->dmrsConfigType,
|
rel15->dmrsConfigType,
|
||||||
mod_dmrs + dmrs_idx);
|
mod_dmrs + dmrs_idx);
|
||||||
} // layer loop
|
} // layer loop
|
||||||
stop_meas(&gNB->dlsch_resource_mapping_stats);
|
stop_meas(&rdata->dlsch_resource_mapping_stats);
|
||||||
|
|
||||||
start_meas(&gNB->dlsch_precoding_stats);
|
start_meas(&rdata->dlsch_precoding_stats);
|
||||||
for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) {
|
for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) {
|
||||||
const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz;
|
const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz;
|
||||||
do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol);
|
do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol);
|
||||||
}
|
}
|
||||||
stop_meas(&gNB->dlsch_precoding_stats);
|
stop_meas(&rdata->dlsch_precoding_stats);
|
||||||
}
|
}
|
||||||
// Task running in // completed
|
// Task running in // completed
|
||||||
completed_task_ans(rdata->ans);
|
completed_task_ans(rdata->ans);
|
||||||
@@ -752,12 +754,18 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
|||||||
re_beginning_of_symbol -= n_dmrs;
|
re_beginning_of_symbol -= n_dmrs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
reset_meas(&rdata->dlsch_resource_mapping_stats);
|
||||||
|
reset_meas(&rdata->dlsch_precoding_stats);
|
||||||
for (int l = 0; l < rel15->nrOfLayers; l++)
|
for (int l = 0; l < rel15->nrOfLayers; l++)
|
||||||
rdata->tx_layers[l] = tx_layers[l];
|
rdata->tx_layers[l] = tx_layers[l];
|
||||||
task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata};
|
task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata};
|
||||||
pushTpool(&gNB->threadPool, t);
|
pushTpool(&gNB->threadPool, t);
|
||||||
}
|
}
|
||||||
join_task_ans(&ans);
|
join_task_ans(&ans);
|
||||||
|
for (int i = 0; i < nb_tasks; i++) {
|
||||||
|
merge_meas(&gNB->dlsch_resource_mapping_stats, &arr[i].dlsch_resource_mapping_stats);
|
||||||
|
merge_meas(&gNB->dlsch_precoding_stats, &arr[i].dlsch_precoding_stats);
|
||||||
|
}
|
||||||
stop_meas(&gNB->dlsch_pdsch_generation_stats);
|
stop_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||||
/* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits)
|
/* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits)
|
||||||
* should remain a multiple of 8 * 64 with enough offset to fit each dlsch
|
* should remain a multiple of 8 * 64 with enough offset to fit each dlsch
|
||||||
|
|||||||
Reference in New Issue
Block a user