Commit b9a216d7 authored by Robert Schmidt's avatar Robert Schmidt

Take timing measurements for UL DLSCH decoding steps

- Measure time of deinterleaving, rate unmatching, and LDPC decoding of
  DLSCH decoding
- Add merge_meas() function to merge measurements into one
- Rename time meas variables with "turbo" to "ldpc"
parent 4289a21f
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
{"ulsch_modulation_stats", &(UE->ulsch_modulation_stats),0,1},\ {"ulsch_modulation_stats", &(UE->ulsch_modulation_stats),0,1},\
{"ulsch_segmentation_stats", &(UE->ulsch_segmentation_stats),0,1},\ {"ulsch_segmentation_stats", &(UE->ulsch_segmentation_stats),0,1},\
{"ulsch_rate_matching_stats", &(UE->ulsch_rate_matching_stats),0,1},\ {"ulsch_rate_matching_stats", &(UE->ulsch_rate_matching_stats),0,1},\
{"ulsch_turbo_encoding_stats", &(UE->ulsch_turbo_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", &(UE->generic_stat),0,1},\
...@@ -124,12 +124,12 @@ ...@@ -124,12 +124,12 @@
{"dlsch_f...timation_stats", &(UE->dlsch_freq_offset_estimation_stats),0,1},\ {"dlsch_f...timation_stats", &(UE->dlsch_freq_offset_estimation_stats),0,1},\
{"dlsch_demodulation_stats", &(UE->dlsch_demodulation_stats),0,1},\ {"dlsch_demodulation_stats", &(UE->dlsch_demodulation_stats),0,1},\
{"dlsch_rate_unmatching_stats", &(UE->dlsch_rate_unmatching_stats),0,1},\ {"dlsch_rate_unmatching_stats", &(UE->dlsch_rate_unmatching_stats),0,1},\
{"dlsch_turbo_decoding_stats", &(UE->dlsch_turbo_decoding_stats),0,1},\ {"dlsch_ldpc_decoding_stats", &(UE->dlsch_ldpc_decoding_stats),0,1},\
{"dlsch_deinterleaving_stats", &(UE->dlsch_deinterleaving_stats),0,1},\ {"dlsch_deinterleaving_stats", &(UE->dlsch_deinterleaving_stats),0,1},\
{"dlsch_llr_stats", &(UE->dlsch_llr_stats),0,1},\ {"dlsch_llr_stats", &(UE->dlsch_llr_stats),0,1},\
{"dlsch_unscrambling_stats", &(UE->dlsch_unscrambling_stats),0,1},\ {"dlsch_unscrambling_stats", &(UE->dlsch_unscrambling_stats),0,1},\
{"dlsch_rate_matching_stats", &(UE->dlsch_rate_matching_stats),0,1},\ {"dlsch_rate_matching_stats", &(UE->dlsch_rate_matching_stats),0,1},\
{"dlsch_turbo_encoding_stats", &(UE->dlsch_turbo_encoding_stats),0,1},\ {"dlsch_ldpc_encoding_stats", &(UE->dlsch_ldpc_encoding_stats),0,1},\
{"dlsch_interleaving_stats", &(UE->dlsch_interleaving_stats),0,1},\ {"dlsch_interleaving_stats", &(UE->dlsch_interleaving_stats),0,1},\
{"dlsch_tc_init_stats", &(UE->dlsch_tc_init_stats),0,1},\ {"dlsch_tc_init_stats", &(UE->dlsch_tc_init_stats),0,1},\
{"dlsch_tc_alpha_stats", &(UE->dlsch_tc_alpha_stats),0,1},\ {"dlsch_tc_alpha_stats", &(UE->dlsch_tc_alpha_stats),0,1},\
......
...@@ -115,6 +115,9 @@ static int dump_L1_UE_meas_stats(PHY_VARS_NR_UE *ue, char *output, int max_len) ...@@ -115,6 +115,9 @@ static int dump_L1_UE_meas_stats(PHY_VARS_NR_UE *ue, char *output, int max_len)
stroff += print_meas_log(&ue->rx_pdsch_stats, "PDSCH receiver", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->rx_pdsch_stats, "PDSCH receiver", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_decoding_stats[0], "PDSCH decoding t0", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_decoding_stats[0], "PDSCH decoding t0", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_decoding_stats[1], "PDSCH decoding t1", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_decoding_stats[1], "PDSCH decoding t1", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_deinterleaving_stats, " -> Deinterleive", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_rate_unmatching_stats, " -> Rate Unmatch", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_ldpc_decoding_stats, " -> LDPC Decode", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_unscrambling_stats, "PDSCH unscrambling", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_unscrambling_stats, "PDSCH unscrambling", NULL, NULL, output + stroff);
stroff += print_meas_log(&ue->dlsch_rx_pdcch_stats, "PDCCH handling", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_rx_pdcch_stats, "PDCCH handling", NULL, NULL, output + stroff);
return stroff; return stroff;
......
...@@ -233,6 +233,10 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool ...@@ -233,6 +233,10 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
NR_UE_DLSCH_t *dlsch = (NR_UE_DLSCH_t *) rdata->dlsch; NR_UE_DLSCH_t *dlsch = (NR_UE_DLSCH_t *) rdata->dlsch;
int r = rdata->segment_r; 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);
bool decodeSuccess = (rdata->decodeIterations < (1+dlsch->max_ldpc_iterations)); bool decodeSuccess = (rdata->decodeIterations < (1+dlsch->max_ldpc_iterations));
if (decodeSuccess) { if (decodeSuccess) {
...@@ -296,12 +300,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool ...@@ -296,12 +300,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
void nr_processDLSegment(void* arg) { void nr_processDLSegment(void* arg) {
ldpcDecode_ue_t *rdata = (ldpcDecode_ue_t*) arg; ldpcDecode_ue_t *rdata = (ldpcDecode_ue_t*) arg;
NR_UE_DLSCH_t *dlsch = rdata->dlsch; NR_UE_DLSCH_t *dlsch = rdata->dlsch;
#if UE_TIMING_TRACE //TBD
PHY_VARS_NR_UE *phy_vars_ue = rdata->phy_vars_ue;
time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats;
time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats;
time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats;
#endif
NR_DL_UE_HARQ_t *harq_process= rdata->harq_process; NR_DL_UE_HARQ_t *harq_process= rdata->harq_process;
t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms; t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms;
int length_dec; int length_dec;
...@@ -341,21 +339,16 @@ void nr_processDLSegment(void* arg) { ...@@ -341,21 +339,16 @@ void nr_processDLSegment(void* arg) {
t_nrLDPC_procBuf **p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf; t_nrLDPC_procBuf **p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
#if UE_TIMING_TRACE start_meas(&rdata->ts_deinterleave);
start_meas(dlsch_deinterleaving_stats);
#endif
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
nr_deinterleaving_ldpc(E, nr_deinterleaving_ldpc(E,
Qm, Qm,
harq_process->w[r], // [hna] w is e harq_process->w[r], // [hna] w is e
dlsch_llr+r_offset); dlsch_llr+r_offset);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE stop_meas(&rdata->ts_deinterleave);
stop_meas(dlsch_deinterleaving_stats);
#endif start_meas(&rdata->ts_rate_unmatch);
#if UE_TIMING_TRACE
start_meas(dlsch_rate_unmatching_stats);
#endif
/* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n", /* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,E,harq_process->F, harq_pid,r, G,E,harq_process->F,
Kr*3, Kr*3,
...@@ -380,17 +373,12 @@ void nr_processDLSegment(void* arg) { ...@@ -380,17 +373,12 @@ void nr_processDLSegment(void* arg) {
harq_process->F, harq_process->F,
Kr-harq_process->F-2*(p_decoderParms->Z))==-1) { Kr-harq_process->F-2*(p_decoderParms->Z))==-1) {
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE stop_meas(&rdata->ts_rate_unmatch);
stop_meas(dlsch_rate_unmatching_stats);
#endif
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n"); LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
rdata->decodeIterations = dlsch->max_ldpc_iterations + 1; rdata->decodeIterations = dlsch->max_ldpc_iterations + 1;
return; return;
} else {
#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
#endif
} }
stop_meas(&rdata->ts_rate_unmatch);
r_offset += E; r_offset += E;
...@@ -418,9 +406,7 @@ void nr_processDLSegment(void* arg) { ...@@ -418,9 +406,7 @@ void nr_processDLSegment(void* arg) {
} }
{ {
#if UE_TIMING_TRACE start_meas(&rdata->ts_ldpc_decode);
start_meas(dlsch_turbo_decoding_stats);
#endif
//set first 2*Z_c bits to zeros //set first 2*Z_c bits to zeros
memset(&z[0],0,2*harq_process->Z*sizeof(int16_t)); memset(&z[0],0,2*harq_process->Z*sizeof(int16_t));
//set Filler bits //set Filler bits
...@@ -470,9 +456,7 @@ void nr_processDLSegment(void* arg) { ...@@ -470,9 +456,7 @@ void nr_processDLSegment(void* arg) {
harq_process->c[r][m]= (uint8_t) llrProcBuf[m]; harq_process->c[r][m]= (uint8_t) llrProcBuf[m];
} }
#if UE_TIMING_TRACE stop_meas(&rdata->ts_ldpc_decode);
stop_meas(dlsch_turbo_decoding_stats);
#endif
} }
} }
...@@ -673,6 +657,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -673,6 +657,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
rdata->offset = offset; rdata->offset = offset;
rdata->dlsch = dlsch; rdata->dlsch = dlsch;
rdata->dlsch_id = 0; rdata->dlsch_id = 0;
reset_meas(&rdata->ts_deinterleave);
reset_meas(&rdata->ts_rate_unmatch);
reset_meas(&rdata->ts_ldpc_decode);
pushTpool(&(pool_dl),req); pushTpool(&(pool_dl),req);
nbDecode++; nbDecode++;
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",nbDecode); LOG_D(PHY,"Added a block to decode, in pipe: %d\n",nbDecode);
......
...@@ -178,6 +178,16 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) { ...@@ -178,6 +178,16 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) {
} }
} }
static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts)
{
if (!opp_enabled)
return;
dst_ts->trials += src_ts->trials;
dst_ts->diff += src_ts->diff;
if (src_ts->max > dst_ts->max)
dst_ts->max = src_ts->max;
}
extern notifiedFIFO_t measur_fifo; extern notifiedFIFO_t measur_fifo;
#define CPUMEASUR_SECTION "cpumeasur" #define CPUMEASUR_SECTION "cpumeasur"
......
...@@ -1014,7 +1014,6 @@ typedef struct { ...@@ -1014,7 +1014,6 @@ typedef struct {
time_stats_t ulsch_modulation_stats; time_stats_t ulsch_modulation_stats;
time_stats_t ulsch_segmentation_stats; time_stats_t ulsch_segmentation_stats;
time_stats_t ulsch_rate_matching_stats; time_stats_t ulsch_rate_matching_stats;
time_stats_t ulsch_turbo_encoding_stats;
time_stats_t ulsch_interleaving_stats; time_stats_t ulsch_interleaving_stats;
time_stats_t ulsch_multiplexing_stats; time_stats_t ulsch_multiplexing_stats;
...@@ -1036,13 +1035,13 @@ typedef struct { ...@@ -1036,13 +1035,13 @@ typedef struct {
time_stats_t dlsch_decoding_stats[2]; time_stats_t dlsch_decoding_stats[2];
time_stats_t dlsch_demodulation_stats; time_stats_t dlsch_demodulation_stats;
time_stats_t dlsch_rate_unmatching_stats; time_stats_t dlsch_rate_unmatching_stats;
time_stats_t dlsch_turbo_decoding_stats; time_stats_t dlsch_ldpc_decoding_stats;
time_stats_t dlsch_deinterleaving_stats; time_stats_t dlsch_deinterleaving_stats;
time_stats_t dlsch_llr_stats; time_stats_t dlsch_llr_stats;
time_stats_t dlsch_llr_stats_parallelization[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t dlsch_llr_stats_parallelization[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME];
time_stats_t dlsch_unscrambling_stats; time_stats_t dlsch_unscrambling_stats;
time_stats_t dlsch_rate_matching_stats; time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_stats; time_stats_t dlsch_ldpc_encoding_stats;
time_stats_t dlsch_interleaving_stats; time_stats_t dlsch_interleaving_stats;
time_stats_t dlsch_tc_init_stats; time_stats_t dlsch_tc_init_stats;
time_stats_t dlsch_tc_alpha_stats; time_stats_t dlsch_tc_alpha_stats;
...@@ -1101,6 +1100,9 @@ typedef struct LDPCDecode_ue_s { ...@@ -1101,6 +1100,9 @@ typedef struct LDPCDecode_ue_s {
int offset; int offset;
int Tbslbrm; int Tbslbrm;
int decodeIterations; int decodeIterations;
time_stats_t ts_deinterleave;
time_stats_t ts_rate_unmatch;
time_stats_t ts_ldpc_decode;
} ldpcDecode_ue_t; } ldpcDecode_ue_t;
#include "SIMULATION/ETH_TRANSPORT/defs.h" #include "SIMULATION/ETH_TRANSPORT/defs.h"
......
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