Commit 5a7f2275 authored by Sakthivel Velumani's avatar Sakthivel Velumani Committed by Robert Schmidt

Change LDPC decoder rate based on round/rv

parent a1de5e3d
...@@ -472,6 +472,13 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f); ...@@ -472,6 +472,13 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f);
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f); void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f);
int nr_get_R_ldpc_decoder(int rvidx,
int E,
int BG,
int Z,
int *llrLen,
int round);
int nr_rate_matching_ldpc(uint32_t Tbslbrm, int nr_rate_matching_ldpc(uint32_t Tbslbrm,
uint8_t BG, uint8_t BG,
uint16_t Z, uint16_t Z,
......
...@@ -386,6 +386,39 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) ...@@ -386,6 +386,39 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
} }
int nr_get_R_ldpc_decoder(int rvidx,
int E,
int BG,
int Z,
int *llrLen,
int round) {
AssertFatal(BG == 1 || BG == 2, "Unknown BG %d\n", BG);
int Ncb = (BG==1)?(66*Z):(50*Z);
int infoBits = (index_k0[BG-1][rvidx] * Z + E);
if (round == 0) *llrLen = infoBits;
if (infoBits > Ncb) infoBits = Ncb;
if (infoBits > *llrLen) *llrLen = infoBits;
int sysBits = (BG==1)?(22*Z):(10*Z);
float decoderR = (float)sysBits/(infoBits + 2*Z);
if (BG == 2)
if (decoderR < 0.3333)
return 15;
else if (decoderR < 0.6667)
return 13;
else
return 23;
else
if (decoderR < 0.6667)
return 13;
else if (decoderR < 0.8889)
return 23;
else
return 89;
}
int nr_rate_matching_ldpc(uint32_t Tbslbrm, int nr_rate_matching_ldpc(uint32_t Tbslbrm,
uint8_t BG, uint8_t BG,
......
...@@ -234,6 +234,12 @@ void nr_processULSegment(void* arg) { ...@@ -234,6 +234,12 @@ void nr_processULSegment(void* arg) {
short* ulsch_llr = rdata->ulsch_llr; short* ulsch_llr = rdata->ulsch_llr;
int max_ldpc_iterations = p_decoderParms->numMaxIter; int max_ldpc_iterations = p_decoderParms->numMaxIter;
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))); int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
p_decoderParms->R = nr_get_R_ldpc_decoder(rv_index,
E,
p_decoderParms->BG,
p_decoderParms->Z,
&ulsch_harq->llrLen,
ulsch_harq->round);
int16_t z [68*384 + 16] __attribute__ ((aligned(16))); int16_t z [68*384 + 16] __attribute__ ((aligned(16)));
int8_t l [68*384 + 16] __attribute__ ((aligned(16))); int8_t l [68*384 + 16] __attribute__ ((aligned(16)));
......
...@@ -251,6 +251,12 @@ void nr_processDLSegment(void* arg) { ...@@ -251,6 +251,12 @@ void nr_processDLSegment(void* arg) {
short* dlsch_llr = rdata->dlsch_llr; short* dlsch_llr = rdata->dlsch_llr;
rdata->decodeIterations = dlsch->max_ldpc_iterations + 1; rdata->decodeIterations = dlsch->max_ldpc_iterations + 1;
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))); int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
p_decoderParms->R = nr_get_R_ldpc_decoder(rdata->rv_index,
E,
p_decoderParms->BG,
p_decoderParms->Z,
&harq_process->llrLen,
harq_process->DLround);
int16_t z [68*384 + 16] __attribute__ ((aligned(16))); int16_t z [68*384 + 16] __attribute__ ((aligned(16)));
int8_t l [68*384 + 16] __attribute__ ((aligned(16))); int8_t l [68*384 + 16] __attribute__ ((aligned(16)));
......
...@@ -259,6 +259,9 @@ typedef struct { ...@@ -259,6 +259,9 @@ typedef struct {
uint16_t dlDmrsScramblingId; uint16_t dlDmrsScramblingId;
/// PDU BITMAP /// PDU BITMAP
uint16_t pduBitmap; uint16_t pduBitmap;
/// Last index of LLR buffer that contains information.
/// Used for computing LDPC decoder R
int llrLen;
} NR_DL_UE_HARQ_t; } NR_DL_UE_HARQ_t;
typedef struct { typedef struct {
......
...@@ -337,6 +337,9 @@ typedef struct { ...@@ -337,6 +337,9 @@ typedef struct {
int16_t q_RI[MAX_RI_PAYLOAD]; int16_t q_RI[MAX_RI_PAYLOAD];
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled /// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS]; uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Last index of LLR buffer that contains information.
/// Used for computing LDPC decoder R
int llrLen;
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
} NR_UL_gNB_HARQ_t; } NR_UL_gNB_HARQ_t;
......
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