Merge remote-tracking branch 'origin/fix_numIter' into integration_2025_w11 (!3296)
fix(nrLDPC_decoder): fix numIter increment The logs of ./nr_ulsim -n100 -m19 -s12 -S12 -z2 -L4 were showing that sometimes the decoding of one segment was failing while the CRC check succeeded. This was happening because the iteration counter numIter was not properly managed so that when the last iteration was successful to decode the segment still numIter at the exit was equal to numMaxIter plus 1 so that decoding was considered to have failed. In other words the last iteration if it occured was always wasted. This commit offers to solve this problem by simply moving the iteration counter increment at the end of the iteration loop while remaining careful at fixing the tests relying on this counter. Post-Scriptum: After a first review, we decided to make the counter more standard from a C code perspective. The counter now counts from 0 to numMaxIter minus 1. If it reaches numMaxIter, it means that decoding was unsuccessful.
This commit is contained in:
@@ -123,7 +123,6 @@ int main(int argc, char **argv)
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
double sigma;
|
||||
unsigned char qbits = 8;
|
||||
int ret;
|
||||
int loglvl = OAILOG_WARNING;
|
||||
uint8_t dlsch_threads = 0;
|
||||
float target_error_rate = 0.01;
|
||||
@@ -577,18 +576,18 @@ int main(int argc, char **argv)
|
||||
short *p_channel_output_fixed = channel_output_fixed;
|
||||
uint8_t *p_b = b;
|
||||
int available_bits_array[1] = { available_bits };
|
||||
ret = nr_dlsch_decoding(UE,
|
||||
&proc,
|
||||
dlsch0_ue,
|
||||
&p_channel_output_fixed,
|
||||
&p_b,
|
||||
available_bits_array,
|
||||
1,
|
||||
DLSCH_ids);
|
||||
nr_dlsch_decoding(UE,
|
||||
&proc,
|
||||
dlsch0_ue,
|
||||
&p_channel_output_fixed,
|
||||
&p_b,
|
||||
available_bits_array,
|
||||
1,
|
||||
DLSCH_ids);
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING0, VCD_FUNCTION_OUT);
|
||||
|
||||
if (ret > dlsch0_ue->max_ldpc_iterations)
|
||||
if (dlsch0_ue->last_iteration_cnt > dlsch0_ue->max_ldpc_iterations)
|
||||
n_errors++;
|
||||
|
||||
//count errors
|
||||
|
||||
@@ -1163,7 +1163,7 @@ printf("%d\n", slot);
|
||||
//---------------------- count errors ----------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
if (dlsch0->last_iteration_cnt >= dlsch0->max_ldpc_iterations+1)
|
||||
if (dlsch0->last_iteration_cnt >= dlsch0->max_ldpc_iterations)
|
||||
n_errors[round]++;
|
||||
|
||||
int16_t *UE_llr = (int16_t*)UE->phy_sim_pdsch_llr;
|
||||
|
||||
@@ -1420,7 +1420,7 @@ int main(int argc, char *argv[])
|
||||
0);
|
||||
}
|
||||
|
||||
if ((ulsch_gNB->last_iteration_cnt >= ulsch_gNB->max_ldpc_iterations + 1) || ul_proc_error == 1) {
|
||||
if ((ulsch_gNB->last_iteration_cnt >= ulsch_gNB->max_ldpc_iterations) || ul_proc_error == 1) {
|
||||
error_flag = 1;
|
||||
n_errors[round]++;
|
||||
crc_status = 1;
|
||||
|
||||
Reference in New Issue
Block a user