Commit 6f394db3 authored by Robert Schmidt's avatar Robert Schmidt

Respect do_precoding variable, print correct precoding stats

Reformat code to properly copy memory if we skip precoding.

precoding_stats timing is not part of ru->feptx_ofdm, but
ru->feptx_prec, so always print it.

Previously, in order to speed up processing if precoding is disabled, we
just copy the pointer from txdataF to txdataF_BF, as opposed to do a
full memcpy() to duplicate the data. The same happens if we cannot have
precoding, i.e., in SISO. This has implications such as memory leaks,
which is why this is not being done. However, the code comment is
intentionally placed there.
parent b8e377d4
...@@ -361,8 +361,11 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size ...@@ -361,8 +361,11 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
if (ru->feprx) if (ru->feprx)
output += print_meas_log(&ru->ofdm_demod_stats, "feprx", NULL, NULL, output, end - output); output += print_meas_log(&ru->ofdm_demod_stats, "feprx", NULL, NULL, output, end - output);
if (ru->feptx_ofdm) { if (ru->feptx_prec) {
output += print_meas_log(&ru->precoding_stats,"feptx_prec",NULL,NULL, output, end - output); output += print_meas_log(&ru->precoding_stats,"feptx_prec",NULL,NULL, output, end - output);
}
if (ru->feptx_ofdm) {
output += print_meas_log(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL, output, end - output); output += print_meas_log(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL, output, end - output);
output += print_meas_log(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL, output, end - output); output += print_meas_log(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL, output, end - output);
output += print_meas_log(&ru->ofdm_total_stats,"feptx_total",NULL,NULL, output, end - output); output += print_meas_log(&ru->ofdm_total_stats,"feptx_total",NULL,NULL, output, end - output);
......
...@@ -188,27 +188,23 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -188,27 +188,23 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
if (nr_slot_select(cfg,frame_tx,slot_tx) == NR_UPLINK_SLOT) return; if (nr_slot_select(cfg,frame_tx,slot_tx) == NR_UPLINK_SLOT) return;
for(i=0; i<ru->nb_log_antennas; ++i) { if (!ru->do_precoding || (ru->nb_tx == 1 && ru->nb_log_antennas == 1)) {
memcpy((void*)ru->common.txdataF[i], for (i = 0; i < ru->nb_log_antennas; ++i) {
(void*)&gNB->common_vars.txdataF[i][txdataF_offset], //ru->common.txdataF_BF[i] = (int32_t *)&gNB->common_vars.txdataF[i][txdataF_offset];
fp->samples_per_slot_wCP*sizeof(int32_t)); memcpy(ru->common.txdataF_BF[i],
if (ru->do_precoding == 1) &gNB->common_vars.txdataF[i][txdataF_offset],
fp->samples_per_slot_wCP*sizeof(int32_t));
}
}
else {
for(i=0; i<ru->nb_log_antennas; ++i) {
memcpy((void*)ru->common.txdataF[i],
(void*)&gNB->common_vars.txdataF[i][txdataF_offset],
fp->samples_per_slot_wCP*sizeof(int32_t));
memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot], memcpy((void*)&ru->common.beam_id[i][slot_tx*fp->symbols_per_slot],
(void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot], (void*)&gNB->common_vars.beam_id[i][slot_tx*fp->symbols_per_slot],
fp->symbols_per_slot*sizeof(uint8_t)); fp->symbols_per_slot*sizeof(uint8_t));
} }
if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
memcpy((void*)ru->common.txdataF_BF[0],
(void*)ru->common.txdataF[0],
fp->samples_per_slot_wCP*sizeof(int32_t));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
}// if (ru->nb_tx == 1)
else {
bw = ru->beam_weights[0]; bw = ru->beam_weights[0];
for (l=0;l<fp->symbols_per_slot;l++) { for (l=0;l<fp->symbols_per_slot;l++) {
for (aa=0;aa<ru->nb_tx;aa++) { for (aa=0;aa<ru->nb_tx;aa++) {
...@@ -223,7 +219,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -223,7 +219,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
0); 0);
}// for (aa=0;aa<ru->nb_tx;aa++) }// for (aa=0;aa<ru->nb_tx;aa++)
}// for (l=0;l<fp->symbols_per_slot;l++) }// for (l=0;l<fp->symbols_per_slot;l++)
}// if (ru->nb_tx == 1) }// ru->do_precoding
}// if (ru->num_gNB == 1) }// if (ru->num_gNB == 1)
stop_meas(&ru->precoding_stats); stop_meas(&ru->precoding_stats);
} }
......
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