Commit 67bc4391 authored by Raymond Knopp's avatar Raymond Knopp Committed by Robert Schmidt

Increase measurement coverage for better reporting

parent d4cf1705
......@@ -154,6 +154,7 @@ typedef struct nrLDPC_segment_encoding_parameters_s{
time_stats_t ts_interleave;
time_stats_t ts_rate_match;
time_stats_t ts_ldpc_encode;
time_stats_t ts_output;
} nrLDPC_segment_encoding_parameters_t;
/**
......@@ -228,9 +229,11 @@ typedef struct nrLDPC_slot_encoding_parameters_s{
int nb_TBs;
tpool_t *threadPool;
time_stats_t *tinput;
time_stats_t *tinput_memcpy;
time_stats_t *tprep;
time_stats_t *tparity;
time_stats_t *toutput;
time_stats_t *tconcat;
nrLDPC_TB_encoding_parameters_t *TBs;
} nrLDPC_slot_encoding_parameters_t;
......
......@@ -108,6 +108,7 @@ typedef struct nrLDPC_decoding_parameters_s {
time_stats_t *p_ts_deinterleave;
time_stats_t *p_ts_rate_unmatch;
time_stats_t *p_ts_seg_prep;
time_stats_t *p_ts_ldpc_decode;
} nrLDPC_decoding_parameters_t;
......@@ -183,8 +184,8 @@ static void nr_process_decode_segment(void *arg)
int16_t z[68 * 384 + 16] __attribute__((aligned(16)));
start_meas(rdata->p_ts_ldpc_decode);
start_meas(rdata->p_ts_seg_prep);
memset(z, 0, 2 * rdata->Z * sizeof(*z));
// set Filler bits
memset(z + Kprime, 127, rdata->F * sizeof(*z));
......@@ -199,6 +200,7 @@ static void nr_process_decode_segment(void *arg)
for (int i = 0, j = 0; j < ((Kc * rdata->Z) >> 4) + 1; i += 2, j++) {
pl[j] = simde_mm_packs_epi16(pv[i], pv[i + 1]);
}
stop_meas(rdata->p_ts_seg_prep);
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
......@@ -206,6 +208,7 @@ static void nr_process_decode_segment(void *arg)
//////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
start_meas(rdata->p_ts_ldpc_decode);
int decodeIterations = LDPCdecoder(p_decoderParms, l, llrProcBuf, p_procTime, rdata->abort_decode);
if (decodeIterations < p_decoderParms->numMaxIter) {
......
......@@ -360,9 +360,11 @@ static int nrLDPC_launch_TB_encoding(nrLDPC_slot_encoding_parameters_t *nrLDPC_s
encoder_implemparams_t common_segment_params = {
.n_segments = nrLDPC_TB_encoding_parameters->C,
.tinput = nrLDPC_slot_encoding_parameters->tinput,
.tinput_memcpy = nrLDPC_slot_encoding_parameters->tinput_memcpy,
.tprep = nrLDPC_slot_encoding_parameters->tprep,
.tparity = nrLDPC_slot_encoding_parameters->tparity,
.toutput = nrLDPC_slot_encoding_parameters->toutput,
.tconcat = nrLDPC_slot_encoding_parameters->tconcat,
.Kb = nrLDPC_TB_encoding_parameters->Kb,
.Zc = nrLDPC_TB_encoding_parameters->Z,
.BG = nrLDPC_TB_encoding_parameters->BG,
......@@ -445,13 +447,14 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
join_task_ans(&ans);
// Write output
time_stats_t *tconcat = nrLDPC_slot_encoding_parameters->tconcat;
if(tconcat != NULL) start_meas(tconcat);
nbTasks = 0;
for (int dlsch_id = 0; dlsch_id < nrLDPC_slot_encoding_parameters->nb_TBs; dlsch_id++) {
nrLDPC_TB_encoding_parameters_t *nrLDPC_TB_encoding_parameters = &nrLDPC_slot_encoding_parameters->TBs[dlsch_id];
uint32_t C = nrLDPC_TB_encoding_parameters->C;
size_t n_seg = (C / 8 + ((C & 7) == 0 ? 0 : 1));
time_stats_t *toutput = nrLDPC_slot_encoding_parameters->toutput;
for (int j = 0; j < n_seg; j++) {
unsigned int macro_segment = j * 8;
......@@ -471,7 +474,6 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
}
}
if(toutput != NULL) start_meas(toutput);
uint32_t Eoffset=0;
for (int s=0; s<macro_segment; s++)
......@@ -487,10 +489,10 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
nrLDPC_TB_encoding_parameters->output,
Eoffset);
if(toutput != NULL) stop_meas(toutput);
}
nbTasks += n_seg;
}
if(tconcat != NULL) stop_meas(tconcat);
return 0;
}
......@@ -55,9 +55,11 @@ typedef struct {
unsigned int first_seg; // optim8segmulti
unsigned char gen_code; // orig
time_stats_t *tinput;
time_stats_t *tinput_memcpy;
time_stats_t *tprep;
time_stats_t *tparity;
time_stats_t *toutput;
time_stats_t *tconcat;
/// Size in bits of the code segments
uint32_t K;
/// Number of lifting sizes to fit the payload
......
......@@ -103,9 +103,11 @@
#include "ldpc_BG2_Zc80_byte.c"
#include "ldpc_BG2_Zc72_byte.c"
static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols)
static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols,time_stats_t *tinput_memcpy)
{
unsigned char c[2 * 22 * Zc * simd_size] __attribute__((aligned(64))); //double size matrix of c
if (tinput_memcpy) start_meas(tinput_memcpy);
for (int i1 = 0; i1 < ncols; i1++) {
memcpy(&c[2 * i1 * Zc], &cc[i1 * Zc], Zc * sizeof(unsigned char));
memcpy(&c[(2 * i1 + 1) * Zc], &cc[i1 * Zc], Zc * sizeof(unsigned char));
......@@ -118,6 +120,7 @@ static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG,sho
memcpy(&c[(2 * ncols * Zc * i1)], &c[i1], (2 * ncols * Zc * sizeof(unsigned char)) - i1);
}
}
if (tinput_memcpy) stop_meas(tinput_memcpy);
if (BG == 1) {
switch (Zc) {
case 176:
......
......@@ -193,12 +193,9 @@ int LDPCencoder(uint8_t **input, uint8_t *output, encoder_implemparams_t *impp)
if(impp->tinput != NULL) stop_meas(impp->tinput);
if ((BG==1 && Zc>=176) || (BG==2 && Zc>=72)) {
// extend matrix
if(impp->tprep != NULL) start_meas(impp->tprep);
if(impp->tprep != NULL) stop_meas(impp->tprep);
//parity check part
if(impp->tparity != NULL) start_meas(impp->tparity);
encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols);
encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols,impp->tinput_memcpy);
if(impp->tparity != NULL) stop_meas(impp->tparity);
}
else {
......@@ -207,8 +204,10 @@ int LDPCencoder(uint8_t **input, uint8_t *output, encoder_implemparams_t *impp)
return(-1);
}
}
if(impp->toutput != NULL) start_meas(impp->toutput);
memcpy(output,&cc[2*Zc],(block_length-(2*Zc)));
memcpy(output+block_length-(2*Zc),dd,((nrows-no_punctured_columns) * Zc-removed_bit));
if(impp->toutput != NULL) stop_meas(impp->toutput);
return 0;
}
......@@ -720,9 +720,11 @@ void nr_generate_pdsch(PHY_VARS_gNB *gNB, int n_dlsch, NR_gNB_DLSCH_t *dlsch_arr
{
time_stats_t *dlsch_encoding_stats = &gNB->dlsch_encoding_stats;
time_stats_t *tinput = &gNB->tinput;
time_stats_t *tinput_memcpy = &gNB->tinput_memcpy;
time_stats_t *tprep = &gNB->tprep;
time_stats_t *tparity = &gNB->tparity;
time_stats_t *toutput = &gNB->toutput;
time_stats_t *tconcat = &gNB->tconcat;
time_stats_t *dlsch_rate_matching_stats = &gNB->dlsch_rate_matching_stats;
time_stats_t *dlsch_interleaving_stats = &gNB->dlsch_interleaving_stats;
time_stats_t *dlsch_segmentation_stats = &gNB->dlsch_segmentation_stats;
......@@ -778,9 +780,11 @@ void nr_generate_pdsch(PHY_VARS_gNB *gNB, int n_dlsch, NR_gNB_DLSCH_t *dlsch_arr
slot,
output,
tinput,
tinput_memcpy,
tprep,
tparity,
toutput,
tconcat,
dlsch_rate_matching_stats,
dlsch_interleaving_stats,
dlsch_segmentation_stats)
......
......@@ -44,9 +44,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
uint8_t slot,
unsigned char *output,
time_stats_t *tinput,
time_stats_t *tinput_memcpy,
time_stats_t *tprep,
time_stats_t *tparity,
time_stats_t *toutput,
time_stats_t *tconcat,
time_stats_t *dlsch_rate_matching_stats,
time_stats_t *dlsch_interleaving_stats,
time_stats_t *dlsch_segmentation_stats);
......
......@@ -108,9 +108,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
uint8_t slot,
unsigned char *output,
time_stats_t *tinput,
time_stats_t *tinput_memcpy,
time_stats_t *tprep,
time_stats_t *tparity,
time_stats_t *toutput,
time_stats_t *tconcat,
time_stats_t *dlsch_rate_matching_stats,
time_stats_t *dlsch_interleaving_stats,
time_stats_t *dlsch_segmentation_stats)
......
......@@ -897,6 +897,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
for (int aarx = 0; aarx < nb_rx_ant; aarx++) {
for (int aatx = 0; aatx < nb_layer; aatx++) {
start_meas(&gNB->pusch_extraction_stats);
nr_ulsch_extract_rbs(rxF[aarx],
(c16_t *)pusch_vars->ul_ch_estimates[aatx * nb_rx_ant + aarx],
rxFext[aarx],
......@@ -907,6 +908,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
dmrs_symbol_flag,
rel15_ul,
frame_parms);
stop_meas(&gNB->pusch_extraction_stats);
#if T_TRACER
int nb_re_pusch = NR_NB_SC_PER_RB * rel15_ul->rb_size;
// Assume assume Tx and Rx = 1
......@@ -919,6 +921,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
#endif
}
}
start_meas(&gNB->pusch_channel_compensation_stats);
c16_t rho[nb_layer][nb_layer][buffer_length] __attribute__((aligned(64)));
c16_t rxF_ch_maga [nb_layer][buffer_length] __attribute__((aligned(64)));
c16_t rxF_ch_magb [nb_layer][buffer_length] __attribute__((aligned(64)));
......@@ -944,6 +947,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
rel15_ul,
symbol,
output_shift);
stop_meas(&gNB->pusch_channel_compensation_stats);
if (nb_layer == 1 && rel15_ul->transform_precoding == transformPrecoder_enabled && rel15_ul->qam_mod_order <= 6) {
if (rel15_ul->qam_mod_order > 2)
......@@ -966,7 +970,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
buffer_length);
pusch_vars->ul_valid_re_per_slot[symbol] -= pusch_vars->ptrs_re_per_slot;
}
start_meas(&gNB->ulsch_llr_stats);
if (nb_layer == 2) {
if (rel15_ul->qam_mod_order <= 6) {
nr_ulsch_compute_ML_llr(pusch_vars,
......@@ -1008,6 +1012,7 @@ static void inner_rx(PHY_VARS_gNB *gNB,
pusch_vars->ul_valid_re_per_slot[symbol],
symbol,
rel15_ul->qam_mod_order);
stop_meas(&gNB->ulsch_llr_stats);
}
typedef struct puschSymbolProc_s {
......@@ -1066,6 +1071,7 @@ static void nr_pusch_symbol_processing(void *arg)
int nb_re_pusch = gNB->pusch_vars[ulsch_id].ul_valid_re_per_slot[symbol];
// layer de-mapping
start_meas(&gNB->ulsch_layer_demapping_stats);
int16_t *llr_ptr = llrs[0];
if (rel15_ul->nrOfLayers != 1) {
llr_ptr = &rdata->llr[pusch_vars->llr_offset[symbol] * rel15_ul->nrOfLayers];
......@@ -1075,12 +1081,15 @@ static void nr_pusch_symbol_processing(void *arg)
llr_ptr[i * rel15_ul->nrOfLayers * rel15_ul->qam_mod_order + l * rel15_ul->qam_mod_order + m] =
llrss[l][i * rel15_ul->qam_mod_order + m];
}
stop_meas(&gNB->ulsch_layer_demapping_stats);
// unscrambling
start_meas(&gNB->ulsch_unscrambling_stats);
int16_t *llr16 = (int16_t*)&rdata->llr[pusch_vars->llr_offset[symbol] * rel15_ul->nrOfLayers];
int16_t *s = rdata->scramblingSequence + pusch_vars->llr_offset[symbol] * rel15_ul->nrOfLayers;
const int end = nb_re_pusch * rel15_ul->qam_mod_order * rel15_ul->nrOfLayers;
for (int i = 0; i < end; i++)
llr16[i] = llr_ptr[i] * s[i];
stop_meas(&gNB->ulsch_unscrambling_stats);
}
// Task running in // completed
......@@ -1313,7 +1322,8 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
int buffer_length = rel15_ul->rb_size * NR_NB_SC_PER_RB;
c16_t temp_rxFext[frame_parms->nb_antennas_rx][buffer_length] __attribute__((aligned(64)));
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++)
for (int nl = 0; nl < rel15_ul->nrOfLayers; nl++)
for (int nl = 0; nl < rel15_ul->nrOfLayers; nl++) {
start_meas(&gNB->pusch_extraction_stats);
nr_ulsch_extract_rbs(gNB->common_vars.rxdataF[beam_nb][aarx],
(c16_t *)pusch_vars->ul_ch_estimates[nl * frame_parms->nb_antennas_rx + aarx],
temp_rxFext[aarx],
......@@ -1324,6 +1334,8 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
(rel15_ul->ul_dmrs_symb_pos >> meas_symbol) & 0x01,
rel15_ul,
frame_parms);
stop_meas(&gNB->pusch_extraction_stats);
}
uint8_t shift_ch_ext = rel15_ul->nrOfLayers > 1 ? log2_approx(max_ch >> 11) : 0;
......
......@@ -442,9 +442,11 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t dlsch_resource_mapping_stats;
time_stats_t dlsch_precoding_stats;
time_stats_t tinput;
time_stats_t tinput_memcpy;
time_stats_t tprep;
time_stats_t tparity;
time_stats_t toutput;
time_stats_t tconcat;
time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_interleaving_stats;
......@@ -460,11 +462,16 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t ulsch_decoding_stats;
time_stats_t ts_deinterleave;
time_stats_t ts_rate_unmatch;
time_stats_t ts_seg_prep;
time_stats_t ts_ldpc_decode;
time_stats_t ulsch_deinterleaving_stats;
time_stats_t ulsch_channel_estimation_stats;
time_stats_t pusch_channel_estimation_antenna_processing_stats;
time_stats_t ulsch_llr_stats;
time_stats_t ulsch_layer_demapping_stats;
time_stats_t ulsch_unscrambling_stats;
time_stats_t pusch_extraction_stats;
time_stats_t pusch_channel_compensation_stats;
time_stats_t rx_srs_stats;
time_stats_t generate_srs_stats;
time_stats_t get_srs_signal_stats;
......
......@@ -506,7 +506,7 @@ int main(int argc, char **argv)
unsigned char output[nb_rb * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * NR_MAX_NB_LAYERS] __attribute__((aligned(64)));
bzero(output, sizeof(output));
if (input_fd == NULL) {
nr_dlsch_encoding(gNB, 1, dlsch, frame, slot, output, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
nr_dlsch_encoding(gNB, 1, dlsch, frame, slot, output, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
for (SNR = snr0; SNR < snr1 && !stop; SNR += snr_step) {
......
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