Commit a3c622ff authored by wang's avatar wang

update ldpc decoder packed bits + more sizes

parent 8b66f588
This diff is collapsed.
This diff is collapsed.
...@@ -18,146 +18,166 @@ ...@@ -18,146 +18,166 @@
#include "nrLDPC_cnProc.h" #include "nrLDPC_cnProc.h"
#include "nrLDPC_bnProc.h" #include "nrLDPC_bnProc.h"
#ifdef MEAS_TIME static inline void nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler);
#include <time.h>
#include <string.h>
#endif
static inline void nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_llrOut, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_proc_time* p_procTime);
void nrLDPC_decoder(t_nrLDPC_dec_params* p_decParams, int16_t* p_llr, int8_t* p_llrOut, t_nrLDPC_proc_time* p_procTime) void nrLDPC_decoder(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out, t_nrLDPC_time_stats* p_profiler)
{ {
uint32_t numLLR; uint32_t numLLR;
t_nrLDPC_lut lut; t_nrLDPC_lut lut;
t_nrLDPC_lut* p_lut = &lut; t_nrLDPC_lut* p_lut = &lut;
//int8_t llrOut_inter;
//int8_t* p_llrOut_inter=&llrOut_inter;
// Initialize decoder core(s) with correct LUTs // Initialize decoder core(s) with correct LUTs
numLLR = nrLDPC_init(p_decParams, p_lut); numLLR = nrLDPC_init(p_decParams, p_lut);
// Launch LDPC decoder core for one segment // Launch LDPC decoder core for one segment
nrLDPC_decoder_core((int8_t *)p_llr, p_llrOut, numLLR, p_lut, p_decParams, p_procTime); nrLDPC_decoder_core(p_llr, p_out, numLLR, p_lut, p_decParams, p_profiler);
//nrLDPC_decoder_core((int8_t *) p_llr, p_llrOut_inter, numLLR, p_lut, p_decParams, p_procTime);
//p_llrOut = (uint8_t *) p_llrOut_inter;
} }
static inline void nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_llrOut, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_proc_time* p_procTime) static inline void nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler)
{ {
printf("LDPC core p_llr %d\n",*p_llr);
uint16_t Z = p_decParams->Z; uint16_t Z = p_decParams->Z;
uint8_t BG = p_decParams->BG;
uint8_t numMaxIter = p_decParams->numMaxIter; uint8_t numMaxIter = p_decParams->numMaxIter;
e_nrLDPC_outMode outMode = p_decParams->outMode;
uint32_t i = 0; uint32_t i = 1;
int8_t* p_llrOut;
#ifdef MEAS_TIME if (outMode == nrLDPC_outMode_LLRINT8)
clock_t start_all, end_all, start, end; {
memset(p_procTime, 0, sizeof(t_nrLDPC_proc_time)); p_llrOut = p_out;
#endif }
else
{
// Use LLR processing buffer as temporary output buffer
p_llrOut = (int8_t*) llrProcBuf;
}
#ifdef MEAS_TIME
start_all = clock();
#endif
// Initialization // Initialization
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->llr2llrProcBuf);
#endif #endif
nrLDPC_llr2llrProcBuf(p_lut, p_llr, numLLR); nrLDPC_llr2llrProcBuf(p_lut, p_llr, Z, BG);
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
end = clock(); stop_meas(&p_profiler->llr2llrProcBuf);
p_procTime->llr2llrProcBuf += ((double) (end - start));
#endif #endif
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->llr2CnProcBuf);
#endif #endif
nrLDPC_llr2CnProcBuf(p_lut, p_llr, numLLR); nrLDPC_llr2CnProcBuf(p_lut, p_llr, numLLR, Z, BG);
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
end = clock(); stop_meas(&p_profiler->llr2CnProcBuf);
p_procTime->llr2CnProcBuf += ((double) (end - start));
#endif #endif
// First iteration // First iteration
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->cnProc);
#endif #endif
nrLDPC_cnProc(p_lut, Z); if (BG == 1)
{
#ifdef MEAS_TIME nrLDPC_cnProc_BG1(p_lut, Z);
end = clock(); }
p_procTime->cnProc += ((double) (end - start)); else
{
nrLDPC_cnProc(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cnProc);
#endif #endif
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->cn2bnProcBuf);
#endif #endif
nrLDPC_cn2bnProcBuf(p_lut, Z); if (BG == 1)
#ifdef MEAS_TIME {
end = clock(); nrLDPC_cn2bnProcBuf_BG1(p_lut, Z);
p_procTime->cn2bnProcBuf += ((double) (end - start)); }
else
{
nrLDPC_cn2bnProcBuf(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
#endif #endif
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->bnProcPc);
#endif #endif
nrLDPC_bnProcPc(p_lut, Z); nrLDPC_bnProcPc(p_lut, Z);
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
end = clock(); stop_meas(&p_profiler->bnProcPc);
p_procTime->bnProcPc += ((double) (end - start));
#endif #endif
// Parity check should occur here // Parity check should occur here
// First iteration finished
while (i < numMaxIter) while (i < numMaxIter)
{ {
// BN processing // BN processing
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->bnProc);
#endif #endif
nrLDPC_bnProc(p_lut, Z); nrLDPC_bnProc(p_lut, Z);
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
end = clock(); stop_meas(&p_profiler->bnProc);
p_procTime->bnProc += ((double) (end - start));
#endif #endif
// BN results to CN processing buffer // BN results to CN processing buffer
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->bn2cnProcBuf);
#endif #endif
nrLDPC_bn2cnProcBuf(p_lut, Z); if (BG == 1)
#ifdef MEAS_TIME {
end = clock(); nrLDPC_bn2cnProcBuf_BG1(p_lut, Z);
p_procTime->bn2cnProcBuf += ((double) (end - start)); }
else
{
nrLDPC_bn2cnProcBuf(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bn2cnProcBuf);
#endif #endif
// CN processing // CN processing
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->cnProc);
#endif #endif
nrLDPC_cnProc(p_lut, Z); if (BG == 1)
#ifdef MEAS_TIME {
end = clock(); nrLDPC_cnProc_BG1(p_lut, Z);
p_procTime->cnProc += ((double) (end - start)); }
else
{
nrLDPC_cnProc(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cnProc);
#endif #endif
// Send CN results back to BNs // Send CN results back to BNs
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->cn2bnProcBuf);
#endif #endif
nrLDPC_cn2bnProcBuf(p_lut, Z); if (BG == 1)
#ifdef MEAS_TIME {
end = clock(); nrLDPC_cn2bnProcBuf_BG1(p_lut, Z);
p_procTime->cn2bnProcBuf += ((double) (end - start)); }
else
{
nrLDPC_cn2bnProcBuf(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
#endif #endif
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->bnProcPc);
#endif #endif
nrLDPC_bnProcPc(p_lut, Z); nrLDPC_bnProcPc(p_lut, Z);
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
end = clock(); stop_meas(&p_profiler->bnProcPc);
p_procTime->bnProcPc += ((double) (end - start));
#endif #endif
// Do parity check // Do parity check
...@@ -166,40 +186,29 @@ static inline void nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_llrOut, uint32_t ...@@ -166,40 +186,29 @@ static inline void nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_llrOut, uint32_t
} }
// Assign results from processing buffer to output // Assign results from processing buffer to output
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->llrRes2llrOut);
#endif #endif
nrLDPC_llrRes2llrOut(p_lut, p_llrOut, numLLR); nrLDPC_llrRes2llrOut(p_lut, p_llrOut, numLLR);
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
end = clock(); stop_meas(&p_profiler->llrRes2llrOut);
p_procTime->llrRes2llrOut += ((double) (end - start));
#endif #endif
// Hard-decision // Hard-decision
#ifdef MEAS_TIME #ifdef NR_LDPC_PROFILER_DETAIL
start = clock(); start_meas(&p_profiler->llr2bit);
#endif #endif
nrLDPC_llr2bit(p_llrOut, numLLR); if (outMode == nrLDPC_outMode_BIT)
#ifdef MEAS_TIME {
end = clock(); nrLDPC_llr2bitPacked(p_out, p_llrOut, numLLR);
p_procTime->llr2bit += ((double) (end - start)); }
#endif else if (outMode == nrLDPC_outMode_BITINT8)
{
nrLDPC_llr2bit(p_out, p_llrOut, numLLR);
#ifdef MEAS_TIME }
end_all = clock();
p_procTime->total = ((double) (end_all - start_all)); #ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llr2bit);
p_procTime->llr2llrProcBuf /= CLOCKS_PER_SEC;
p_procTime->llr2CnProcBuf /= CLOCKS_PER_SEC;
p_procTime->cnProc /= CLOCKS_PER_SEC;
p_procTime->bnProcPc /= CLOCKS_PER_SEC;
p_procTime->bnProc /= CLOCKS_PER_SEC;
p_procTime->cn2bnProcBuf /= CLOCKS_PER_SEC;
p_procTime->bn2cnProcBuf /= CLOCKS_PER_SEC;
p_procTime->llrRes2llrOut /= CLOCKS_PER_SEC;
p_procTime->llr2bit /= CLOCKS_PER_SEC;
p_procTime->total /= CLOCKS_PER_SEC;
#endif #endif
} }
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
* *
===============================================================================*/ ===============================================================================*/
#ifndef _NR_LDPC_DECODER_ #ifndef __NR_LDPC_DECODER__H__
#define _NR_LDPC_DECODER_ #define __NR_LDPC_DECODER__H__
#include "nrLDPC_types.h" #include "nrLDPC_types.h"
void nrLDPC_decoder(t_nrLDPC_dec_params* p_decParams, int16_t* p_llr, int8_t* p_llrOut, t_nrLDPC_proc_time* p_procTime); void nrLDPC_decoder(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_llrOut, t_nrLDPC_time_stats* p_profiler);
#endif #endif
...@@ -8,38 +8,52 @@ ...@@ -8,38 +8,52 @@
* *
===============================================================================*/ ===============================================================================*/
#ifndef _NR_LDPC_DEFS_ #ifndef __NR_LDPC_DEFS__H__
#define _NR_LDPC_DEFS_ #define __NR_LDPC_DEFS__H__
// ============================================================================== // ==============================================================================
// DEFINES // DEFINES
// Maximum lifting size // Maximum lifting size
#define NR_LDPC_ZMAX 384 #define NR_LDPC_ZMAX 384
// Row and column dimensions of BG1 and BG2
// BG1
#define NR_LDPC_NCOL_BG1 68 #define NR_LDPC_NCOL_BG1 68
#define NR_LDPC_NROW_BG1 46 #define NR_LDPC_NROW_BG1 46
#define NR_LDPC_NUM_EDGE_BG1 316
#define NR_LDPC_NUM_CN_GROUPS_BG1 9
#define NR_LDPC_START_COL_PARITY_BG1 26
#define NR_LDPC_NCOL_BG1_R13 NR_LDPC_NCOL_BG1
#define NR_LDPC_NCOL_BG1_R23 35
#define NR_LDPC_NCOL_BG1_R89 27
#define NR_LDPC_NUM_BN_GROUPS_BG1_R13 30
#define NR_LDPC_NUM_BN_GROUPS_BG1_R23 8
#define NR_LDPC_NUM_BN_GROUPS_BG1_R89 5
// BG2
#define NR_LDPC_NROW_BG2 42 #define NR_LDPC_NROW_BG2 42
#define NR_LDPC_NCOL_BG2 52 #define NR_LDPC_NCOL_BG2 52
#define NR_LDPC_NUM_EDGE_BG1 316
#define NR_LDPC_NUM_EDGE_BG2 197 #define NR_LDPC_NUM_EDGE_BG2 197
#define NR_LDPC_NUM_CN_GROUPS_BG1 9
#define NR_LDPC_NUM_CN_GROUPS_BG2 6 #define NR_LDPC_NUM_CN_GROUPS_BG2 6
#define NR_LDPC_START_COL_PARITY_BG2 14
#define NR_LDPC_NCOL_BG2_R15 NR_LDPC_NCOL_BG2 #define NR_LDPC_NCOL_BG2_R15 NR_LDPC_NCOL_BG2
#define NR_LDPC_NCOL_BG2_R13 32 #define NR_LDPC_NCOL_BG2_R13 32
#define NR_LDPC_NCOL_BG2_R23 17 #define NR_LDPC_NCOL_BG2_R23 17
#define NR_LDPC_NUM_BN_GROUPS_BG1 13 #define NR_LDPC_NUM_BN_GROUPS_BG2_R15 23
#define NR_LDPC_NUM_BN_GROUPS_BG2 23 #define NR_LDPC_NUM_BN_GROUPS_BG2_R13 10
#define NR_LDPC_NUM_BN_GROUPS_BG2_R23 6
// Worst case CN and BN processing buffer sizes
#define NR_LDPC_SIZE_CN_PROC_BUF NR_LDPC_NUM_EDGE_BG1*NR_LDPC_ZMAX #define NR_LDPC_SIZE_CN_PROC_BUF NR_LDPC_NUM_EDGE_BG1*NR_LDPC_ZMAX
#define NR_LDPC_SIZE_BN_PROC_BUF NR_LDPC_NUM_EDGE_BG1*NR_LDPC_ZMAX #define NR_LDPC_SIZE_BN_PROC_BUF NR_LDPC_NUM_EDGE_BG1*NR_LDPC_ZMAX
#define NR_LDPC_MAX_NUM_LLR 26112 // NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX #define NR_LDPC_MAX_NUM_LLR 26112 // NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX
#define NR_LDPC_NUM_MAX_ITER 1 #define NR_LDPC_NUM_MAX_ITER 1
#define MEAS_TIME
// ============================================================================== // ==============================================================================
// GLOBAL VARIABLES // GLOBAL VARIABLES
...@@ -59,32 +73,56 @@ static const uint32_t lut_startAddrCnGroups_BG1[NR_LDPC_NUM_CN_GROUPS_BG1] = {0, ...@@ -59,32 +73,56 @@ static const uint32_t lut_startAddrCnGroups_BG1[NR_LDPC_NUM_CN_GROUPS_BG1] = {0,
static const uint32_t lut_startAddrCnGroups_BG2[NR_LDPC_NUM_CN_GROUPS_BG2] = {0, 6912, 37632, 54912, 61824, 67968}; static const uint32_t lut_startAddrCnGroups_BG2[NR_LDPC_NUM_CN_GROUPS_BG2] = {0, 6912, 37632, 54912, 61824, 67968};
// Number of groups for check node processing // Number of groups for check node processing
static const uint8_t lut_numCnInCnGroups_BG1[NR_LDPC_NUM_CN_GROUPS_BG1] = {1, 5, 18, 8, 5, 2, 2, 1, 4}; // BG1
static const uint8_t lut_numBnInCnGroups_BG1_R13[NR_LDPC_NUM_CN_GROUPS_BG1] = {3, 4, 5, 6, 7, 8, 9, 10, 19};
static const uint8_t lut_numCnInCnGroups_BG1_R13[NR_LDPC_NUM_CN_GROUPS_BG1] = {1, 5, 18, 8, 5, 2, 2, 1, 4};
static const uint8_t lut_numCnInCnGroups_BG1_R23[NR_LDPC_NUM_CN_GROUPS_BG1] = {1, 0, 0, 0, 3, 2, 2, 1, 4};
static const uint8_t lut_numCnInCnGroups_BG1_R89[NR_LDPC_NUM_CN_GROUPS_BG1] = {1, 0, 0, 0, 0, 0, 0, 0, 4};
static const uint8_t lut_numEdgesPerBn_BG1_R13[NR_LDPC_START_COL_PARITY_BG1] = {30, 28, 7, 11, 9, 4, 8, 12, 8, 7, 12, 10, 12, 11, 10, 7, 10, 10, 13, 7, 8, 11, 12, 5, 6, 6};
static const uint8_t lut_numEdgesPerBn_BG1_R23[NR_LDPC_START_COL_PARITY_BG1] = {12, 11, 4, 5, 5, 3, 4, 5, 5, 3, 6, 6, 6, 6, 5, 3, 6, 5, 6, 4, 5, 6, 6, 3, 3, 2};
static const uint8_t lut_numEdgesPerBn_BG1_R89[NR_LDPC_START_COL_PARITY_BG1] = {5, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2};
// BG2
static const uint8_t lut_numBnInCnGroups_BG2_R15[NR_LDPC_NUM_CN_GROUPS_BG2] = {3, 4, 5, 6, 8, 10}; static const uint8_t lut_numBnInCnGroups_BG2_R15[NR_LDPC_NUM_CN_GROUPS_BG2] = {3, 4, 5, 6, 8, 10};
static const uint8_t lut_numCnInCnGroups_BG2_R15[NR_LDPC_NUM_CN_GROUPS_BG2] = {6, 20, 9, 3, 2, 2}; static const uint8_t lut_numCnInCnGroups_BG2_R15[NR_LDPC_NUM_CN_GROUPS_BG2] = {6, 20, 9, 3, 2, 2};
static const uint8_t lut_numCnInCnGroups_BG2_R23[NR_LDPC_NUM_CN_GROUPS_BG2] = {0, 1, 0, 2, 2, 2};
static const uint8_t lut_numCnInCnGroups_BG2_R13[NR_LDPC_NUM_CN_GROUPS_BG2] = {0, 8, 7, 3, 2, 2}; static const uint8_t lut_numCnInCnGroups_BG2_R13[NR_LDPC_NUM_CN_GROUPS_BG2] = {0, 8, 7, 3, 2, 2};
static const uint8_t lut_numCnInCnGroups_BG2_R23[NR_LDPC_NUM_CN_GROUPS_BG2] = {0, 1, 0, 2, 2, 2};
// Number of groups for bit node processing static const uint8_t lut_numEdgesPerBn_BG2_R15[NR_LDPC_START_COL_PARITY_BG2] = {22, 23, 10, 5, 5, 14, 7, 13, 6, 8, 9, 16, 9, 12};
static const uint8_t lut_numBnInBnGroups_BG1[NR_LDPC_NUM_BN_GROUPS_BG1] = {42, 1, 1, 2, 4, 3, 1, 4, 3, 4, 1, 1, 1}; static const uint8_t lut_numEdgesPerBn_BG2_R13[NR_LDPC_START_COL_PARITY_BG2] = {14, 16, 2, 4, 4, 6, 6, 8, 6, 6, 6, 13, 5, 7};
static const uint8_t lut_numEdgesPerBn_BG2_R23[NR_LDPC_START_COL_PARITY_BG2] = { 6, 5, 2, 3, 3, 4, 3, 4, 3, 4, 3, 5, 2, 2};
// BG2: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 // Number of groups for bit node processing
static const uint8_t lut_numBnInBnGroups_BG2_R15[NR_LDPC_NUM_BN_GROUPS_BG2] = {38, 0, 0, 0, 2, 1, 1, 1, 2, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1}; // Worst case is BG1 with up to 30 CNs connected to one BN
static const uint8_t lut_numBnInBnGroups_BG2_R13[NR_LDPC_NUM_BN_GROUPS_BG2] = {18, 1, 0, 2, 1, 5, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0}; // BG1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
static const uint8_t lut_numBnInBnGroups_BG2_R23[NR_LDPC_NUM_BN_GROUPS_BG2] = { 3, 3, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static const uint8_t lut_numBnInBnGroups_BG1_R13[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = {42, 0, 0, 1, 1, 2, 4, 3, 1, 4, 3, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1};
static const uint8_t lut_numBnInBnGroups_BG1_R23[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = { 9, 1, 5, 3, 7, 8, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const uint8_t lut_numBnInBnGroups_BG1_R89[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = { 1, 3,21, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// BG2: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
static const uint8_t lut_numBnInBnGroups_BG2_R15[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = {38, 0, 0, 0, 2, 1, 1, 1, 2, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0};
static const uint8_t lut_numBnInBnGroups_BG2_R13[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = {18, 1, 0, 2, 1, 5, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const uint8_t lut_numBnInBnGroups_BG2_R23[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = { 3, 3, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// Start addresses for the bnProcBuf for each BN group // Start addresses for the bnProcBuf for each BN group
static const uint32_t lut_startAddrBnGroups_BG1[NR_LDPC_NUM_BN_GROUPS_BG1] = {0, 16128, 17664, 19584, 24192, 34944, 44160, 47616, 62976, 75648, 94080, 99072, 109824}; // BG1
static const uint32_t lut_startAddrBnGroups_BG2_R15[NR_LDPC_NUM_BN_GROUPS_BG2] = {0, 14592, 18432, 20736, 23424, 26496, 33408, 37248, 41856, 46848, 52224, 58368, 66816}; static const uint32_t lut_startAddrBnGroups_BG1_R13[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = {0, 16128, 17664, 19584, 24192, 34944, 44160, 47616, 62976, 75648, 94080, 99072, 109824};
static const uint32_t lut_startAddrBnGroups_BG2_R13[NR_LDPC_NUM_BN_GROUPS_BG2] = {0, 6912, 7680, 10752, 12672, 24192, 26880, 29952, 34944, 40320}; static const uint32_t lut_startAddrBnGroups_BG1_R23[NR_LDPC_NUM_BN_GROUPS_BG1_R23] = {0, 3456, 4224, 9984, 14592, 28032, 46464, 50688};
static const uint32_t lut_startAddrBnGroups_BG2_R23[NR_LDPC_NUM_BN_GROUPS_BG2] = {0, 1152, 3456, 9216, 13824, 17664}; static const uint32_t lut_startAddrBnGroups_BG1_R89[NR_LDPC_NUM_BN_GROUPS_BG1_R89] = {0, 384, 2688, 26880, 28416};
static const uint16_t lut_startAddrBnGroupsLlr_BG2_R15[NR_LDPC_NUM_BN_GROUPS_BG2] = {0, 14592, 15360, 15744, 16128, 16512, 17280, 17664, 18048, 18432, 18816, 19200, 19584}; static const uint16_t lut_startAddrBnGroupsLlr_BG1_R13[NR_LDPC_NUM_BN_GROUPS_BG1_R13] = {0, 16128, 16512, 16896, 17664, 19200, 20352, 20736, 22272, 23424, 24960, 25344, 25728};
static const uint16_t lut_startAddrBnGroupsLlr_BG2_R13[NR_LDPC_NUM_BN_GROUPS_BG2] = {0, 6912, 7296, 8064, 8448, 10368, 10752, 11136, 11520, 11904}; static const uint16_t lut_startAddrBnGroupsLlr_BG1_R23[NR_LDPC_NUM_BN_GROUPS_BG1_R23] = {0, 3456, 3840, 5760, 6912, 9600, 12672, 13056};
static const uint16_t lut_startAddrBnGroupsLlr_BG2_R23[NR_LDPC_NUM_BN_GROUPS_BG2] = {0, 1152, 2304, 4224, 5376, 6144}; static const uint16_t lut_startAddrBnGroupsLlr_BG1_R89[NR_LDPC_NUM_BN_GROUPS_BG1_R89] = {0, 384, 1536, 9600, 9984};
// BG2
static const uint32_t lut_startAddrBnGroups_BG2_R15[NR_LDPC_NUM_BN_GROUPS_BG2_R15] = {0, 14592, 18432, 20736, 23424, 26496, 33408, 37248, 41856, 46848, 52224, 58368, 66816};
static const uint32_t lut_startAddrBnGroups_BG2_R13[NR_LDPC_NUM_BN_GROUPS_BG2_R13] = {0, 6912, 7680, 10752, 12672, 24192, 26880, 29952, 34944, 40320};
static const uint32_t lut_startAddrBnGroups_BG2_R23[NR_LDPC_NUM_BN_GROUPS_BG2_R23] = {0, 1152, 3456, 9216, 13824, 17664};
static const uint16_t lut_startAddrBnGroupsLlr_BG2_R15[NR_LDPC_NUM_BN_GROUPS_BG2_R15] = {0, 14592, 15360, 15744, 16128, 16512, 17280, 17664, 18048, 18432, 18816, 19200, 19584};
static const uint16_t lut_startAddrBnGroupsLlr_BG2_R13[NR_LDPC_NUM_BN_GROUPS_BG2_R13] = {0, 6912, 7296, 8064, 8448, 10368, 10752, 11136, 11520, 11904};
static const uint16_t lut_startAddrBnGroupsLlr_BG2_R23[NR_LDPC_NUM_BN_GROUPS_BG2_R23] = {0, 1152, 2304, 4224, 5376, 6144};
static const int8_t ones256_epi8[32] __attribute__ ((aligned(32))) = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; static const int8_t ones256_epi8[32] __attribute__ ((aligned(32))) = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
static const int8_t zeros256_epi8[32] __attribute__ ((aligned(32))) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; static const int8_t zeros256_epi8[32] __attribute__ ((aligned(32))) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* *
===============================================================================*/ ===============================================================================*/
#ifndef _NR_LDPC_INIT_ #ifndef __NR_LDPC_INIT__H__
#define _NR_LDPC_INIT_ #define __NR_LDPC_INIT__H__
#include "./nrLDPC_lut/nrLDPC_lut.h" #include "./nrLDPC_lut/nrLDPC_lut.h"
#include "nrLDPC_defs.h" #include "nrLDPC_defs.h"
...@@ -20,7 +20,7 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu ...@@ -20,7 +20,7 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu
uint32_t numLLR = 0; uint32_t numLLR = 0;
uint8_t BG = p_decParams->BG; uint8_t BG = p_decParams->BG;
uint16_t Z = p_decParams->Z; uint16_t Z = p_decParams->Z;
uint8_t R = p_decParams->R; uint8_t R = p_decParams->R;
if (BG == 2) if (BG == 2)
{ {
...@@ -34,6 +34,7 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu ...@@ -34,6 +34,7 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R15; p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R15;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R15; p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R15;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R15; p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R15;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_R15;
numLLR = NR_LDPC_NCOL_BG2_R15*Z; numLLR = NR_LDPC_NCOL_BG2_R15*Z;
} }
else if (R == 13) else if (R == 13)
...@@ -42,6 +43,7 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu ...@@ -42,6 +43,7 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R13; p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R13;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R13; p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R13;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R13; p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R13;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_R13;
numLLR = NR_LDPC_NCOL_BG2_R13*Z; numLLR = NR_LDPC_NCOL_BG2_R13*Z;
} }
else if (R == 23) else if (R == 23)
...@@ -50,30 +52,72 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu ...@@ -50,30 +52,72 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R23; p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R23;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R23; p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R23;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R23; p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R23;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_R23;
numLLR = NR_LDPC_NCOL_BG2_R23*Z; numLLR = NR_LDPC_NCOL_BG2_R23*Z;
} }
// LUT that depend on Z and R // LUT that depend on Z and R
if (Z == 128) if (Z == 2)
{
if (R == 15)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z2_R15;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z2_R15;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z2_R15;
}
else if (R == 13)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z2_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z2_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z2_R13;
}
else if (R == 23)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z2_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z2_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z2_R23;
}
}
else if (Z == 80)
{
if (R == 15)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z80_R15;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z80_R15;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z80_R15;
}
else if (R == 13)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z80_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z80_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z80_R13;
}
else if (R == 23)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z80_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z80_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z80_R23;
}
}
else if (Z == 128)
{ {
if (R == 15) if (R == 15)
{ {
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R15; p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R15;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_Z128_R15;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R15; p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R15;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R15; p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R15;
} }
else if (R == 13) else if (R == 13)
{ {
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R13; p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R13;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_Z128_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R13; p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R13; p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R13;
} }
else if (R == 23) else if (R == 23)
{ {
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R23; p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R23;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_Z128_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R23; p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R23; p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R23;
} }
...@@ -84,26 +128,102 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu ...@@ -84,26 +128,102 @@ static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lu
if (R == 15) if (R == 15)
{ {
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R15; p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R15;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_Z384_R15;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R15; p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R15;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R15; p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R15;
} }
else if (R == 13) else if (R == 13)
{ {
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R13; p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R13;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_Z384_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R13; p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R13; p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R13;
} }
else if (R == 23) else if (R == 23)
{ {
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R23; p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R23;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_Z384_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R23; p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R23; p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R23;
} }
} }
} }
else
{ // BG == 1
// LUT that only depend on BG
p_lut->startAddrCnGroups = lut_startAddrCnGroups_BG1;
// LUT that only depend on R
if (R == 13)
{
p_lut->numCnInCnGroups = lut_numCnInCnGroups_BG1_R13;
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG1_R13;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG1_R13;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R13;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG1_R13;
numLLR = NR_LDPC_NCOL_BG1_R13*Z;
}
else if (R == 23)
{
p_lut->numCnInCnGroups = lut_numCnInCnGroups_BG1_R23;
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG1_R23;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG1_R23;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R23;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG1_R23;
numLLR = NR_LDPC_NCOL_BG1_R23*Z;
}
else if (R == 89)
{
p_lut->numCnInCnGroups = lut_numCnInCnGroups_BG1_R89;
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG1_R89;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG1_R89;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG1_R89;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG1_R89;
numLLR = NR_LDPC_NCOL_BG1_R89*Z;
}
// LUT that depend on Z and R
if (Z == 128)
{
if (R == 13)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG1_Z128_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG1_Z128_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG1_Z128_R13;
}
else if (R == 23)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG1_Z128_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG1_Z128_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG1_Z128_R23;
}
else if (R == 89)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG1_Z128_R89;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG1_Z128_R89;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG1_Z128_R89;
}
}
else if (Z == 384)
{
if (R == 13)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG1_Z384_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG1_Z384_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG1_Z384_R13;
}
else if (R == 23)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG1_Z384_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG1_Z384_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG1_Z384_R23;
}
else if (R == 89)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG1_Z384_R89;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG1_Z384_R89;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG1_Z384_R89;
}
}
}
return numLLR; return numLLR;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
static const uint32_t lut_cn2bnProcBuf_BG2_Z2_R13[242] = {36097, 36096, 37248, 37249, 43777, 43776, 38785, 38784, 39168, 39169, 39553, 39552, 46080, 46081, 39936, 39937, 41472, 41473, 42624, 42625, 9985, 9984, 20361, 20360, 22274, 22275, 45696, 45697, 9987, 9986, 22276, 22277, 30721, 30720, 11520, 11521, 32640, 32641, 33409, 33408, 29568, 29569, 22281, 22280, 34561, 34560, 26496, 26497, 0, 1, 8, 9, 16, 17, 22, 23, 28, 29, 30, 31, 32, 33, 34, 35, 43009, 43008, 37633, 37632, 38017, 38016, 38401, 38400, 44545, 44544, 44929, 44928, 45312, 45313, 18437, 18436, 43393, 43392, 29184, 29185, 44160, 44161, 20355, 20354, 22278, 22279, 22272, 22273, 18441, 18440, 18434, 18435, 20358, 20359, 20356, 20357, 33025, 33024, 33792, 33793, 34176, 34177, 32257, 32256, 28801, 28800, 25344, 25345, 25728, 25729, 26112, 26113, 11904, 11905, 12288, 12289, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 24, 25, 26, 27, 36481, 36480, 36865, 36864, 42241, 42240, 41857, 41856, 18432, 18433, 20353, 20352, 16512, 16513, 28033, 28032, 28416, 28417, 27649, 27648, 18438, 18439, 31873, 31872, 31105, 31104, 31488, 31489, 24960, 24961, 2, 3, 4, 5, 6, 7, 34945, 34944, 35713, 35712, 40321, 40320, 40704, 40705, 6912, 6913, 9216, 9217, 7680, 7681, 8450, 8451, 12675, 12674, 14596, 14597, 12679, 12678, 14601, 14600, 12680, 12681, 11136, 11137, 29952, 29953, 24192, 24193, 35329, 35328, 41088, 41089, 8448, 8449, 7296, 7297, 7683, 7682, 9218, 9219, 12673, 12672, 14592, 14593, 14594, 14595, 16515, 16514, 26880, 26881, 27264, 27265, 12676, 12677, 16516, 16517, 14598, 14599, 16518, 16519, 30336, 30337, 16520, 16521, 10752, 10753, 24576, 24577};
\ No newline at end of file
static const uint32_t lut_cn2bnProcBuf_BG2_Z2_R15[394] = {72960, 72961, 64128, 64129, 64512, 64513, 64896, 64897, 74112, 74113, 31873, 31872, 34177, 34176, 49536, 49537, 23041, 23040, 17666, 17667, 40321, 40320, 41089, 41088, 36, 37, 42, 43, 46, 47, 50, 51, 54, 55, 66, 67, 59521, 59520, 60672, 60673, 70273, 70272, 62209, 62208, 62592, 62593, 62977, 62976, 72576, 72577, 63360, 63361, 63745, 63744, 73344, 73345, 73728, 73729, 65280, 65281, 36096, 36097, 65665, 65664, 74497, 74496, 66048, 66049, 74881, 74880, 66433, 66432, 36864, 36865, 75265, 75264, 67968, 67969, 69120, 69121, 16897, 16896, 29569, 29568, 22656, 22657, 72192, 72193, 16899, 16898, 20352, 20353, 17665, 17664, 34561, 34560, 35329, 35328, 50688, 50689, 45696, 45697, 31875, 31874, 51072, 51073, 36480, 36481, 51456, 51457, 46464, 46465, 32641, 32640, 51841, 51840, 52993, 52992, 28034, 28035, 54912, 54913, 55681, 55680, 44544, 44545, 30337, 30336, 56833, 56832, 39552, 39553, 49152, 49153, 25728, 25729, 49921, 49920, 31106, 31107, 31105, 31104, 40704, 40705, 57217, 57216, 46080, 46081, 57600, 57601, 32642, 32643, 41472, 41473, 57984, 57985, 0, 1, 8, 9, 16, 17, 22, 23, 28, 29, 30, 31, 32, 33, 34, 35, 38, 39, 40, 41, 48, 49, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 68, 69, 70, 71, 72, 73, 74, 75, 69505, 69504, 61057, 61056, 61441, 61440, 61825, 61824, 71041, 71040, 71425, 71424, 71808, 71809, 34945, 34944, 35713, 35712, 19585, 19584, 69889, 69888, 44160, 44161, 70656, 70657, 22273, 22272, 25344, 25345, 48768, 48769, 44929, 44928, 50304, 50305, 28801, 28800, 21888, 21889, 24960, 24961, 19968, 19969, 55297, 55296, 56064, 56065, 56448, 56449, 30338, 30339, 45313, 45312, 54529, 54528, 43777, 43776, 38400, 38401, 38784, 38785, 39168, 39169, 28802, 28803, 29570, 29571, 39936, 39937, 26112, 26113, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 24, 25, 26, 27, 44, 45, 52, 53, 59905, 59904, 60289, 60288, 68737, 68736, 68353, 68352, 48000, 48001, 48385, 48384, 47616, 47617, 43009, 43008, 43392, 43393, 42625, 42624, 24576, 24577, 54145, 54144, 53377, 53376, 53760, 53761, 38016, 38017, 2, 3, 4, 5, 6, 7, 58369, 58368, 59137, 59136, 66817, 66816, 67200, 67201, 33408, 33409, 16128, 16129, 14592, 14593, 15362, 15363, 20737, 20736, 18816, 18817, 23425, 23424, 27265, 27264, 26496, 26497, 27266, 27267, 52224, 52225, 37248, 37249, 58753, 58752, 67584, 67585, 15360, 15361, 33792, 33793, 14595, 14594, 16130, 16131, 46849, 46848, 47232, 47233, 21120, 21121, 21505, 21504, 41856, 41857, 42240, 42241, 18432, 18433, 19200, 19201, 23808, 23809, 24192, 24193, 52608, 52609, 28032, 28033, 26498, 26499, 37632, 37633};
\ No newline at end of file
static const uint32_t lut_cn2bnProcBuf_BG2_Z2_R23[104] = {18817, 18816, 16128, 16129, 15363, 15362, 0, 1, 19201, 19200, 19585, 19584, 16897, 16896, 12672, 12673, 11520, 11521, 12675, 12674, 11523, 11522, 12676, 12677, 16131, 16130, 16898, 16899, 2, 3, 4, 5, 17665, 17664, 18433, 18432, 13825, 13824, 14592, 14593, 1152, 1153, 7296, 7297, 3456, 3457, 5378, 5379, 3461, 3460, 5382, 5383, 9221, 9220, 5385, 5384, 3464, 3465, 2306, 2307, 13826, 13827, 1156, 1157, 18049, 18048, 15360, 15361, 5376, 5377, 2304, 2305, 3459, 3458, 7298, 7299, 9217, 9216, 10368, 10369, 5380, 5381, 7301, 7300, 9218, 9219, 10370, 10371, 3462, 3463, 7302, 7303, 10372, 10373, 11524, 11525, 14594, 14595, 7304, 7305, 1154, 1155, 2308, 2309};
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
static const uint32_t lut_llr2CnProcBuf_BG2_Z2_R13[242] = {61825, 67969, 61827, 6913, 54913, 54915, 6914, 37635, 37637, 37639, 6919, 6920, 6923, 6926, 61824, 67968, 61826, 6912, 54912, 54914, 6915, 37634, 37636, 37638, 6918, 6921, 6922, 6927, 62593, 62594, 67970, 14592, 56065, 54917, 14594, 37633, 41091, 6917, 41094, 37641, 37643, 37644, 14602, 6924, 62592, 62595, 67971, 14593, 56064, 54916, 14595, 37632, 41090, 6916, 41095, 37640, 37642, 37645, 14603, 6925, 63360, 68738, 63361, 68739, 64128, 68736, 63362, 14597, 64129, 68737, 63363, 14596, 69505, 64130, 69506, 14605, 69504, 64131, 69507, 14604, 70273, 70274, 57216, 56066, 56069, 41100, 70272, 70275, 57217, 56067, 56068, 41101, 64897, 71040, 71043, 44546, 41097, 14600, 64896, 71041, 71042, 44547, 41096, 14601, 71808, 71810, 58369, 57219, 57220, 48003, 41092, 22280, 71809, 71811, 58368, 57218, 57221, 48002, 41093, 22281, 72576, 64898, 72578, 41089, 44550, 14606, 72577, 64899, 72579, 41088, 44551, 14607, 65665, 73344, 73346, 58370, 44548, 41098, 65664, 73345, 73347, 58371, 44549, 41099, 66432, 65667, 74114, 44545, 14599, 22283, 66433, 65666, 74115, 44544, 14598, 22282, 67200, 74112, 22273, 59521, 59522, 58373, 48001, 22276, 44553, 22279, 44554, 44556, 22285, 67201, 74113, 22272, 59520, 59523, 58372, 48000, 22277, 44552, 22278, 44555, 44557, 22284, 74880, 66434, 22274, 48010, 48012, 74881, 66435, 22275, 48011, 48013, 67202, 74882, 59524, 48004, 48006, 48008, 22286, 67203, 74883, 59525, 48005, 48007, 48009, 22287, 29952, 29953, 60672, 60673, 60674, 60675, 60676, 60677, 29954, 29955, 51456, 51457, 51458, 51459, 51460, 51461, 29956, 29957, 51462, 51463, 51464, 51465, 29958, 29959, 51466, 51467, 51468, 51469, 29960, 29961, 29962, 29963, 29964, 29965, 29966, 29967};
\ No newline at end of file
static const uint32_t lut_llr2CnProcBuf_BG2_Z2_R15[394] = {61825, 67969, 61827, 6913, 54913, 54915, 6914, 37635, 37637, 37639, 6919, 6920, 6923, 6926, 6929, 2, 4, 6, 6934, 6939, 6942, 6947, 61824, 67968, 61826, 6912, 54912, 54914, 6915, 37634, 37636, 37638, 6918, 6921, 6922, 6927, 6928, 3, 5, 7, 6935, 6938, 6943, 6946, 62593, 62594, 67970, 14592, 56065, 54917, 14594, 37633, 41091, 6917, 41094, 37641, 37643, 37644, 14602, 6924, 0, 6930, 6932, 8, 6941, 6945, 6951, 62592, 62595, 67971, 14593, 56064, 54916, 14595, 37632, 41090, 6916, 41095, 37640, 37642, 37645, 14603, 6925, 1, 6931, 6933, 9, 6940, 6944, 6950, 63360, 68738, 2305, 14611, 37647, 14613, 37649, 6936, 14622, 6948, 63361, 68739, 2304, 14610, 37646, 14612, 37648, 6937, 14623, 6949, 64128, 68736, 63362, 14597, 14609, 64129, 68737, 63363, 14596, 14608, 69505, 64130, 69506, 14605, 2310, 69504, 64131, 69507, 14604, 2311, 70273, 70274, 57216, 56066, 56069, 41100, 22288, 2306, 22293, 41104, 14614, 14620, 14624, 14631, 70272, 70275, 57217, 56067, 56068, 41101, 22289, 2307, 22292, 41105, 14615, 14621, 14625, 14630, 64897, 71040, 71043, 44546, 41097, 14600, 2309, 64896, 71041, 71042, 44547, 41096, 14601, 2308, 71808, 71810, 58369, 57219, 57220, 48003, 41092, 22280, 41103, 44561, 14616, 22302, 14626, 71809, 71811, 58368, 57218, 57221, 48002, 41093, 22281, 41102, 44560, 14617, 22303, 14627, 72576, 64898, 72578, 41089, 44550, 14606, 72577, 64899, 72579, 41088, 44551, 14607, 65665, 73344, 73346, 58370, 44548, 41098, 22290, 48016, 65664, 73345, 73347, 58371, 44549, 41099, 22291, 48017, 66432, 65667, 74114, 44545, 14599, 22283, 22297, 11, 14629, 66433, 65666, 74115, 44544, 14598, 22282, 22296, 10, 14628, 67200, 74112, 22273, 59521, 59522, 58373, 48001, 22276, 44553, 22279, 44554, 44556, 22285, 22301, 22304, 22310, 67201, 74113, 22272, 59520, 59523, 58372, 48000, 22277, 44552, 22278, 44555, 44557, 22284, 22300, 22305, 22311, 74880, 66434, 22274, 48010, 48012, 44558, 22294, 14619, 22306, 74881, 66435, 22275, 48011, 48013, 44559, 22295, 14618, 22307, 67202, 74882, 59524, 48004, 48006, 48008, 22286, 48014, 2313, 22298, 2315, 22308, 67203, 74883, 59525, 48005, 48007, 48009, 22287, 48015, 2312, 22299, 2314, 22309, 29952, 29953, 60672, 60673, 60674, 60675, 60676, 60677, 29954, 29955, 51456, 51457, 51458, 51459, 51460, 51461, 29956, 29957, 51462, 51463, 51464, 51465, 29958, 29959, 51466, 51467, 51468, 51469, 29960, 29961, 29962, 29963, 29964, 29965, 29966, 29967, 4608, 4609, 29968, 29969, 29970, 29971, 4610, 4611, 51470, 51471, 4612, 4613, 29972, 29973, 4614, 4615, 51472, 51473, 4616, 4617, 29974, 29975, 29976, 29977, 29978, 29979, 29980, 29981, 29982, 29983, 4618, 4619, 29984, 29985, 29986, 29987, 29988, 29989, 29990, 29991};
\ No newline at end of file
static const uint32_t lut_llr2CnProcBuf_BG2_Z2_R23[104] = {61825, 67969, 61827, 6913, 54913, 54915, 61824, 67968, 61826, 6912, 54912, 54914, 62593, 62594, 67970, 14592, 56065, 62592, 62595, 67971, 14593, 56064, 63360, 68738, 63361, 68739, 64128, 68736, 63362, 64129, 68737, 63363, 69505, 64130, 69506, 69504, 64131, 69507, 70273, 70274, 57216, 56066, 70272, 70275, 57217, 56067, 64897, 71040, 71043, 64896, 71041, 71042, 71808, 71810, 58369, 57219, 71809, 71811, 58368, 57218, 72576, 64898, 72578, 72577, 64899, 72579, 65665, 73344, 73346, 58370, 65664, 73345, 73347, 58371, 66432, 65667, 74114, 66433, 65666, 74115, 67200, 74112, 22273, 59521, 59522, 67201, 74113, 22272, 59520, 59523, 74880, 66434, 74881, 66435, 67202, 74882, 67203, 74883, 29952, 29953, 60672, 60673, 60674, 60675};
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
static const uint16_t lut_llr2llrProcBuf_BG2_Z2_R13[64] = {11520, 11521, 11904, 11905, 6912, 6913, 7296, 7297, 7298, 7299, 8448, 8449, 8450, 8451, 10752, 10753, 8452, 8453, 8454, 8455, 8456, 8457, 11136, 11137, 8064, 8065, 10368, 10369, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35};
\ No newline at end of file
static const uint16_t lut_llr2llrProcBuf_BG2_Z2_R15[104] = {19200, 19201, 19584, 19585, 17280, 17281, 14592, 14593, 14594, 14595, 18432, 18433, 15744, 15745, 18048, 18049, 15360, 15361, 16128, 16129, 16512, 16513, 18816, 18817, 16514, 16515, 17664, 17665, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75};
\ No newline at end of file
static const uint16_t lut_llr2llrProcBuf_BG2_Z2_R23[34] = {6144, 6145, 5376, 5377, 1152, 1153, 2304, 2305, 2306, 2307, 4224, 4225, 2308, 2309, 4226, 4227, 2310, 2311, 4228, 4229, 2312, 2313, 5378, 5379, 1154, 1155, 1156, 1157, 0, 1, 2, 3, 4, 5};
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*============================================================================== /*==============================================================================
* nrLDPC_defs.h * nrLDPC_defs.h
* *
* Defines all constant variables for the LDPC decoder * Defines LDPC decoder types
* *
* Author: Sebastian Wagner * Author: Sebastian Wagner
* Date: 17-11-2017 * Date: 17-11-2017
* *
===============================================================================*/ ===============================================================================*/
#ifndef _NR_LDPC_TYPES_ #ifndef __NR_LDPC_TYPES__H__
#define _NR_LDPC_TYPES_ #define __NR_LDPC_TYPES__H__
#include "./nrLDPC_tools/time_meas.h"
// ============================================================================== // ==============================================================================
// TYPES // TYPES
...@@ -26,24 +28,31 @@ typedef struct nrLDPC_lut { ...@@ -26,24 +28,31 @@ typedef struct nrLDPC_lut {
const uint16_t* llr2llrProcBuf; const uint16_t* llr2llrProcBuf;
} t_nrLDPC_lut; } t_nrLDPC_lut;
typedef enum nrLDPC_outMode {
nrLDPC_outMode_BIT,
nrLDPC_outMode_BITINT8,
nrLDPC_outMode_LLRINT8
} e_nrLDPC_outMode;
typedef struct nrLDPC_dec_params { typedef struct nrLDPC_dec_params {
uint8_t BG; uint8_t BG;
uint16_t Z; uint16_t Z;
uint8_t R; // Format 15,13,... for code rates 1/5, 1/3,... uint8_t R; // Format 15,13,... for code rates 1/5, 1/3,...
uint8_t numMaxIter; uint8_t numMaxIter;
e_nrLDPC_outMode outMode;
} t_nrLDPC_dec_params; } t_nrLDPC_dec_params;
typedef struct nrLDPC_proc_time { typedef struct nrLDPC_time_stats {
double llr2llrProcBuf; time_stats_t llr2llrProcBuf;
double llr2CnProcBuf; time_stats_t llr2CnProcBuf;
double cnProc; time_stats_t cnProc;
double bnProcPc; time_stats_t bnProcPc;
double bnProc; time_stats_t bnProc;
double cn2bnProcBuf; time_stats_t cn2bnProcBuf;
double bn2cnProcBuf; time_stats_t bn2cnProcBuf;
double llrRes2llrOut; time_stats_t llrRes2llrOut;
double llr2bit; time_stats_t llr2bit;
double total; time_stats_t total;
} t_nrLDPC_proc_time; } t_nrLDPC_time_stats;
#endif #endif
This diff is collapsed.
This diff is collapsed.
...@@ -1325,7 +1325,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -1325,7 +1325,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe, uint8_t subframe,
uint8_t harq_pid, uint8_t harq_pid,
uint8_t is_crnti, uint8_t is_crnti,
uint8_t decoder_switch, //uint8_t decoder_switch,
uint8_t llr8_flag); uint8_t llr8_flag);
/* /*
uint32_t dlsch_decoding_mthread(PHY_VARS_UE *phy_vars_ue, uint32_t dlsch_decoding_mthread(PHY_VARS_UE *phy_vars_ue,
......
...@@ -3572,7 +3572,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs ...@@ -3572,7 +3572,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
frame_rx, frame_rx,
nr_tti_rx, nr_tti_rx,
0, 0,
0,0,1); 0,1);
printf("start pmch dlsch decoding\n"); printf("start pmch dlsch decoding\n");
#endif #endif
} else { // abstraction } else { // abstraction
...@@ -4007,7 +4007,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, ...@@ -4007,7 +4007,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
frame_rx, frame_rx,
nr_tti_rx, nr_tti_rx,
harq_pid, harq_pid,
pdsch==PDSCH?1:0,proc->decoder_switch, pdsch==PDSCH?1:0,//proc->decoder_switch,
dlsch0->harq_processes[harq_pid]->TBS>256?1:0); dlsch0->harq_processes[harq_pid]->TBS>256?1:0);
printf("start cW0 dlsch decoding\n"); printf("start cW0 dlsch decoding\n");
#endif #endif
...@@ -4088,7 +4088,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, ...@@ -4088,7 +4088,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
frame_rx, frame_rx,
nr_tti_rx, nr_tti_rx,
harq_pid, harq_pid,
pdsch==PDSCH?1:0,proc->decoder_switch, pdsch==PDSCH?1:0,//proc->decoder_switch,
dlsch1->harq_processes[harq_pid]->TBS>256?1:0); dlsch1->harq_processes[harq_pid]->TBS>256?1:0);
printf("start cw1 dlsch decoding\n"); printf("start cw1 dlsch decoding\n");
#endif #endif
......
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