Commit bad01725 authored by Sakthivel Velumani's avatar Sakthivel Velumani

The same BG related updates are added to UL

parent 8b9146ec
...@@ -139,6 +139,8 @@ typedef struct { ...@@ -139,6 +139,8 @@ typedef struct {
uint32_t num_of_mod_symbols; uint32_t num_of_mod_symbols;
// decode phich // decode phich
uint8_t decode_phich; uint8_t decode_phich;
// Encoder BG
uint8_t BG;
} NR_UL_UE_HARQ_t; } NR_UL_UE_HARQ_t;
typedef struct { typedef struct {
......
...@@ -232,7 +232,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -232,7 +232,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
uint8_t mod_order; uint8_t mod_order;
uint16_t Kr,r; uint16_t Kr,r;
uint32_t r_offset; uint32_t r_offset;
uint8_t BG;
uint32_t E,Kb; uint32_t E,Kb;
uint8_t Ilbrm; uint8_t Ilbrm;
uint32_t Tbslbrm; uint32_t Tbslbrm;
...@@ -255,7 +254,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -255,7 +254,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
Kr=0; Kr=0;
r_offset=0; r_offset=0;
BG = 1;
F=0; F=0;
Ilbrm = 0; Ilbrm = 0;
Tbslbrm = 950984; //max tbs Tbslbrm = 950984; //max tbs
...@@ -327,10 +325,10 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -327,10 +325,10 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
Coderate = (float) R /(float) 2048; Coderate = (float) R /(float) 2048;
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25){ if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25){
BG = 2; harq_process->BG = 2;
} }
else{ else{
BG = 1; harq_process->BG = 1;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
...@@ -341,7 +339,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -341,7 +339,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
&harq_process->K, &harq_process->K,
pz, pz,
&harq_process->F, &harq_process->F,
BG); harq_process->BG);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
F = harq_process->F; F = harq_process->F;
...@@ -399,7 +397,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -399,7 +397,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,BG,&impp); nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT);
...@@ -448,7 +446,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -448,7 +446,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
nr_rate_matching_ldpc(Ilbrm, nr_rate_matching_ldpc(Ilbrm,
Tbslbrm, Tbslbrm,
BG, harq_process->BG,
*pz, *pz,
harq_process->d[r], harq_process->d[r],
harq_process->e+r_offset, harq_process->e+r_offset,
......
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