Commit 66323e0b authored by Sakthivel Velumani's avatar Sakthivel Velumani

BG selection bug fix

The BG was set to its default for rounds > 0. This is now fixed by adding it to harq structure.
Also a fix for wrong I_lbrm set in dlsch decoding.
parent 3d60e953
......@@ -333,7 +333,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
uint8_t mod_order = rel15->qamModOrder[0];
uint16_t Kr=0,r;
uint32_t r_offset=0;
uint8_t BG=1;
uint32_t E;
uint8_t Ilbrm = 1;
uint32_t Tbslbrm = 950984; //max tbs
......@@ -431,9 +430,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
Coderate = (float) R /(float) 2048;
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25)
BG = 2;
dlsch->harq_processes[harq_pid]->BG = 2;
else
BG = 1;
dlsch->harq_processes[harq_pid]->BG = 1;
start_meas(dlsch_segmentation_stats);
Kb = nr_segmentation(dlsch->harq_processes[harq_pid]->b,
......@@ -443,7 +442,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
&dlsch->harq_processes[harq_pid]->K,
Zc,
&dlsch->harq_processes[harq_pid]->F,
BG);
dlsch->harq_processes[harq_pid]->BG);
stop_meas(dlsch_segmentation_stats);
F = dlsch->harq_processes[harq_pid]->F;
......@@ -480,7 +479,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
for(int j=0;j<(dlsch->harq_processes[harq_pid]->C/8+1);j++) {
impp.macro_num=j;
nrLDPC_encoder(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,BG,&impp);
nrLDPC_encoder(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,dlsch->harq_processes[harq_pid]->BG,&impp);
}
......@@ -532,7 +531,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
start_meas(dlsch_rate_matching_stats);
nr_rate_matching_ldpc(Ilbrm,
Tbslbrm,
BG,
dlsch->harq_processes[harq_pid]->BG,
*Zc,
dlsch->harq_processes[harq_pid]->d[r],
dlsch->harq_processes[harq_pid]->e+r_offset,
......
......@@ -259,7 +259,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
//__m128i l;
//int16_t inv_d [68*384];
uint8_t kc;
uint8_t Ilbrm = 0;
uint8_t Ilbrm = 1;
uint32_t Tbslbrm;// = 950984;
uint16_t nb_rb;// = 30;
......
......@@ -110,6 +110,8 @@ typedef struct {
uint32_t K;
/// Number of "Filler" bits
uint32_t F;
/// Encoder BG
uint8_t BG;
} NR_DL_gNB_HARQ_t;
typedef struct {
......
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