From 7feaea00c27b46f46e20786be6a1e243cb3cffc5 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 10 Jul 2025 20:40:46 -0400 Subject: [PATCH] Fix counting error bits in nr_dlsim Recently f buffer was changed to hold packed bits and the correspoinding change in dlsim was not done so the number of error bits before decoding was incorrectly reported. This commit fixes it. --- openair1/SIMULATION/NR_PHY/dlsim.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index f1fa7885a4..36f69041cc 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1253,9 +1253,8 @@ printf("%d\n", slot); } for (i = 0; i < available_bits; i++) { - if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) || - ((gNB_dlsch->harq_process.f[i] == 1) && (UE_llr[i] >= 0))) - { + const uint8_t current_bit = (gNB_dlsch->harq_process.f[i / 8] & (1 << (i & 7))) >> (i & 7); + if (((current_bit == 0) && (UE_llr[i] <= 0)) || ((current_bit == 1) && (UE_llr[i] >= 0))) { if (errors_scrambling[round] == 0) { LOG_D(PHY,"First bit in error in unscrambling = %d\n",i); }