Commit 7ac95dae authored by Florian Kaltenberger's avatar Florian Kaltenberger

adding LDPC encoder and decoder

parent cfec3ffd
......@@ -1078,10 +1078,15 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_mbsfn.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_ul_ref.c
${OPENAIR1_DIR}/PHY/CODING/lte_segmentation.c
${OPENAIR1_DIR}/PHY/CODING/nr_segmentation.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/ldpc_encoder.c
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte.c
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_lte.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_sse.c
${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
${OPENAIR1_DIR}/PHY/CODING/ldpc_decoder.c
${OPENAIR1_DIR}/PHY/CODING/ldpc_encoder.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
......@@ -1988,6 +1993,9 @@ target_link_libraries (dlsim_tm4
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB}
)
add_executable(ldpctest ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c)
target_link_libraries(ldpctest m SIMU PHY ${ATLAS_LIBRARIES})
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
add_executable(${myExe}
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "SIMULATION/TOOLS/defs.h"
// 4-bit quantizer
char quantize4bit(double D,double x)
{
double qxd;
qxd = floor(x/D);
// printf("x=%f,qxd=%f\n",x,qxd);
if (qxd <= -8)
qxd = -8;
else if (qxd > 7)
qxd = 7;
return((char)qxd);
}
char quantize(double D,double x,unsigned char B)
{
double qxd;
char maxlev;
qxd = floor(x/D);
// printf("x=%f,qxd=%f\n",x,qxd);
maxlev = 1<<(B-1);
if (qxd <= -maxlev)
qxd = -maxlev;
else if (qxd >= maxlev)
qxd = maxlev-1;
return((char)qxd);
}
#define MAX_BLOCK_LENGTH 8448
int test_ldpc(short No_iteration,
double rate,
double SNR,
unsigned char qbits,
short block_length,
unsigned int ntrials,
unsigned int *errors,
unsigned int *crc_misses)
{
//clock initiate
time_stats_t time;
opp_enabled=1;
cpu_freq_GHz = get_cpu_freq_GHz();
//short test_input[block_length];
unsigned char *test_input;
//short *c; //padded codeword
short *esimated_output;
unsigned char *channel_input;
double *channel_output;
double *modulated_input;
short *channel_output_fixed;
unsigned int i,trial=0;
short BG,Zc,Kb,nrows,ncols,channel_temp;
int no_punctured_columns,removed_bit;
int i1;
//Table of possible lifting sizes
short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
*errors=0;
*crc_misses=0;
// generate input block
test_input=(unsigned char *)malloc(sizeof(unsigned char) * block_length/8);
channel_input = (unsigned char *)malloc(sizeof(unsigned char) * 68*384);
modulated_input = (double *)malloc(sizeof(double) * 68*384);
channel_output = (double *)malloc(sizeof(double) * 68*384);
reset_meas(&time);
while (trial++ < ntrials)
{
for (i=0; i<block_length/8; i++)
{
//test_input[i]=(unsigned char) rand();
test_input[i]=217;
}
//determine number of bits in codeword
//if (block_length>3840)
//{
BG=1;
Kb = 22;
nrows=46; //parity check bits
ncols=22; //info bits
// }
/*
else if (block_length<=3840)
{
BG=2;
nrows=42; //parity check bits
ncols=10; // info bits
if (block_length>640)
Kb = 10;
else if (block_length>560)
Kb = 9;
else if (block_length>192)
Kb = 8;
else
Kb = 6;
}
*/
//find minimum value in all sets of lifting size
for (i1=0; i1 < 51; i1++)
{
if (lift_size[i1] >= (double) block_length/Kb)
{
Zc = lift_size[i1];
// printf("%d\n",Zc);
break;
}
}
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length/rate)/Zc;
//printf("%d\n",no_punctured_columns);
start_meas(&time);
//// encoder
ldpc_encoder(test_input, channel_input,block_length,rate);
stop_meas(&time);
print_meas_now(&time, "", stdout);
for (i=0; i<10; i++)
printf("channel_input[%d]=%d\n",i,channel_input[i]);
ldpc_encoder_orig(test_input, channel_input,block_length,rate);
for (i=0; i<10; i++)
printf("channel_input[%d]=%d\n",i,channel_input[i]);
if ((BG==2) && (Zc==128||Zc==256))
{
channel_output_fixed = (short *)malloc( (Kb+nrows) * Zc*sizeof(short));
memset(channel_output_fixed,0,(Kb+nrows) * Zc*sizeof(short));
removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/rate);
//printf("removed_bit:%d\n",removed_bit);
for (i = 2*Zc; i < (Kb+nrows-no_punctured_columns) * Zc-removed_bit; i++)
{
#ifdef DEBUG_CODER
if ((i&0xf)==0)
printf("\ne %d..%d: ",i,i+15);
#endif
if (channel_input[i-2*Zc]==0)
modulated_input[i]=1/sqrt(2); //QPSK
else
modulated_input[i]=-1/sqrt(2);
channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
channel_output_fixed[i] = (short) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
}
//for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++)
//{
// printf("channel_input[%d]=%d\n",i,channel_input[i]);
//printf("%lf %d\n",channel_output[i], channel_output_fixed[i]);
//printf("v[%d]=%lf\n",i,modulated_input[i]);}
#ifdef DEBUG_CODER
printf("\n");
exit(-1);
#endif
// decode the sequence
// decoder supports BG2, Z=128 & 256
esimated_output=ldpc_decoder(channel_output_fixed, block_length, No_iteration, rate);
//for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++)
// printf("esimated_output[%d]=%d\n",i,esimated_output[i]);
//count errors
for (i=2*Zc; i<(Kb+nrows-no_punctured_columns) * Zc-removed_bit; i++)
{
if (esimated_output[i] != channel_input[i-2*Zc])
{
*errors = (*errors) + 1;
break;
}
}
free(channel_output_fixed);
}
else
printf("decoder is not supported\n");
}
print_meas(&time, "ldpc encoder", NULL, NULL);
return *errors;
}
int main(int argc, char *argv[])
{
unsigned int errors,crc_misses;
short block_length=22*128; // decoder supports length: 1201 -> 1280, 2401 -> 2560
short No_iteration=25;
double rate=0.333;
double SNR,SNR_lin;
unsigned char qbits=4;
unsigned int decoded_errors[100]; // initiate the size of matrix equivalent to size of SNR
int c,i=0;
int ntrials = 100;
randominit(0);
while ((c = getopt (argc, argv, "q:r:l:n:")) != -1)
switch (c)
{
case 'q':
qbits = atoi(optarg);
break;
case 'r':
rate = atof(optarg);
break;
case 'l':
block_length = atoi(optarg);
break;
case 'n':
ntrials = atoi(optarg);
break;
default:
abort ();
}
printf("the decoder supports BG2, Kb=10, Z=128 & 256\n");
printf(" range of blocklength: 1201 -> 1280, 2401 -> 2560\n");
printf("block length %d: \n", block_length);
printf("rate: %f\n",rate);
for (SNR=-2.1; SNR<-2; SNR+=.1)
{
SNR_lin = pow(10,SNR/10);
decoded_errors[i]=test_ldpc(No_iteration,
rate,
SNR_lin, // noise standard deviation
qbits,
block_length, // block length bytes
ntrials,
&errors,
&crc_misses);
printf("SNR %f, BLER %f (%d/%d)\n",SNR,(float)decoded_errors[i]/(float)ntrials,decoded_errors[i],ntrials);
i=i+1;
}
return(0);
}
......@@ -34,6 +34,7 @@
#else
#include "PHY/TOOLS/time_meas.h"
#endif
#include "nrLDPC_decoder.h"
#define CRC24_A 0
#define CRC24_B 1
......@@ -79,6 +80,15 @@ int32_t lte_segmentation(uint8_t *input_buffer,
uint32_t *Kminus,
uint32_t *F);
int32_t nr_segmentation(unsigned char *input_buffer,
unsigned char **output_buffers,
unsigned int B,
unsigned int *C,
unsigned int *Kplus,
unsigned int *Kminus,
unsigned int *Zout,
unsigned int *F);
/** \fn int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs)
\brief this functions calculates the delta MCS in dB based on the lte_segmentation function
\param tbs transport block size
......@@ -561,4 +571,7 @@ uint32_t crcbit (uint8_t * ,
int16_t reverseBits(int32_t ,int32_t);
void phy_viterbi_dot11(int8_t *,uint8_t *,uint16_t);
short *ldpc_decoder(short *msgChannel,short block_length,short No_iteration,double rate);
int ldpc_encoder(unsigned char *test_input,unsigned char* channel_input,short block_length,double rate);
#endif
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.
This diff is collapsed.
/*==============================================================================
* nrLDPC_decoder.c
*
* Defines the LDPC decoder
* p_llrOut = output LLRs aligned on 32 byte boundaries
*
* Author: Sebastian Wagner
* Date: 17-11-2017
*
===============================================================================*/
#include <stdint.h>
#include <immintrin.h>
#include "nrLDPC_defs.h"
#include "nrLDPC_types.h"
#include "nrLDPC_init.h"
#include "nrLDPC_mPass.h"
#include "nrLDPC_cnProc.h"
#include "nrLDPC_bnProc.h"
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);
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;
t_nrLDPC_lut lut;
t_nrLDPC_lut* p_lut = &lut;
// Initialize decoder core(s) with correct LUTs
numLLR = nrLDPC_init(p_decParams, p_lut);
// Launch LDPC decoder core for one segment
nrLDPC_decoder_core(p_llr, p_out, numLLR, p_lut, p_decParams, p_profiler);
}
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)
{
uint16_t Z = p_decParams->Z;
uint8_t BG = p_decParams->BG;
uint8_t numMaxIter = p_decParams->numMaxIter;
e_nrLDPC_outMode outMode = p_decParams->outMode;
uint32_t i = 1;
int8_t* p_llrOut;
if (outMode == nrLDPC_outMode_LLRINT8)
{
p_llrOut = p_out;
}
else
{
// Use LLR processing buffer as temporary output buffer
p_llrOut = (int8_t*) llrProcBuf;
}
// Initialization
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->llr2llrProcBuf);
#endif
nrLDPC_llr2llrProcBuf(p_lut, p_llr, Z, BG);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llr2llrProcBuf);
#endif
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->llr2CnProcBuf);
#endif
nrLDPC_llr2CnProcBuf(p_lut, p_llr, numLLR, Z, BG);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llr2CnProcBuf);
#endif
// First iteration
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->cnProc);
#endif
if (BG == 1)
{
nrLDPC_cnProc_BG1(p_lut, Z);
}
else
{
nrLDPC_cnProc(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cnProc);
#endif
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->cn2bnProcBuf);
#endif
if (BG == 1)
{
nrLDPC_cn2bnProcBuf_BG1(p_lut, Z);
}
else
{
nrLDPC_cn2bnProcBuf(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
#endif
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->bnProcPc);
#endif
nrLDPC_bnProcPc(p_lut, Z);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bnProcPc);
#endif
// Parity check should occur here
// First iteration finished
while (i < numMaxIter)
{
// BN processing
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->bnProc);
#endif
nrLDPC_bnProc(p_lut, Z);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bnProc);
#endif
// BN results to CN processing buffer
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->bn2cnProcBuf);
#endif
if (BG == 1)
{
nrLDPC_bn2cnProcBuf_BG1(p_lut, Z);
}
else
{
nrLDPC_bn2cnProcBuf(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bn2cnProcBuf);
#endif
// CN processing
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->cnProc);
#endif
if (BG == 1)
{
nrLDPC_cnProc_BG1(p_lut, Z);
}
else
{
nrLDPC_cnProc(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cnProc);
#endif
// Send CN results back to BNs
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->cn2bnProcBuf);
#endif
if (BG == 1)
{
nrLDPC_cn2bnProcBuf_BG1(p_lut, Z);
}
else
{
nrLDPC_cn2bnProcBuf(p_lut, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
#endif
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->bnProcPc);
#endif
nrLDPC_bnProcPc(p_lut, Z);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bnProcPc);
#endif
// Do parity check
i++;
}
// Assign results from processing buffer to output
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->llrRes2llrOut);
#endif
nrLDPC_llrRes2llrOut(p_lut, p_llrOut, numLLR);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llrRes2llrOut);
#endif
// Hard-decision
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->llr2bit);
#endif
if (outMode == nrLDPC_outMode_BIT)
{
nrLDPC_llr2bitPacked(p_out, p_llrOut, numLLR);
}
else if (outMode == nrLDPC_outMode_BITINT8)
{
nrLDPC_llr2bit(p_out, p_llrOut, numLLR);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llr2bit);
#endif
}
/*==============================================================================
* nrLDPC_decoder.h
*
* Defines the LDPC decoder core prototypes
*
* Author: Sebastian Wagner
* Date: 17-11-2017
*
===============================================================================*/
#ifndef __NR_LDPC_DECODER__H__
#define __NR_LDPC_DECODER__H__
#include "nrLDPC_types.h"
void nrLDPC_decoder(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_llrOut, t_nrLDPC_time_stats* p_profiler);
#endif
/*==============================================================================
* nrLDPC_defs.h
*
* Defines all constant variables for the LDPC decoder
*
* Author: Sebastian Wagner
* Date: 17-11-2017
*
===============================================================================*/
#ifndef __NR_LDPC_DEFS__H__
#define __NR_LDPC_DEFS__H__
// ==============================================================================
// DEFINES
// Maximum lifting size
#define NR_LDPC_ZMAX 384
// BG1
#define NR_LDPC_NCOL_BG1 68
#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_NCOL_BG2 52
#define NR_LDPC_NUM_EDGE_BG2 197
#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_R13 32
#define NR_LDPC_NCOL_BG2_R23 17
#define NR_LDPC_NUM_BN_GROUPS_BG2_R15 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_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_NUM_MAX_ITER 1
// ==============================================================================
// GLOBAL VARIABLES
// Aligned on 32 bytes = 256 bits for AVX2
static int8_t cnProcBuf [NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(32)));
static int8_t cnProcBufRes[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(32)));
static int8_t bnProcBuf [NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(32)));
static int8_t bnProcBufRes[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(32)));
static int8_t llrRes [NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
static int8_t llrProcBuf[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
// Start addresses for the cnProcBuf for each CN group
static const uint32_t lut_startAddrCnGroups_BG1[NR_LDPC_NUM_CN_GROUPS_BG1] = {0, 1152, 8832, 43392, 61824, 75264, 81408, 88320, 92160};
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
// 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_numCnInCnGroups_BG2_R15[NR_LDPC_NUM_CN_GROUPS_BG2] = {6, 20, 9, 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};
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_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};
// Number of groups for bit node processing
// Worst case is BG1 with up to 30 CNs connected to one BN
// 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_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
// BG1
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_BG1_R23[NR_LDPC_NUM_BN_GROUPS_BG1_R23] = {0, 3456, 4224, 9984, 14592, 28032, 46464, 50688};
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_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_BG1_R23[NR_LDPC_NUM_BN_GROUPS_BG1_R23] = {0, 3456, 3840, 5760, 6912, 9600, 12672, 13056};
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 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 maxLLR256_epi8[32] __attribute__ ((aligned(32))) = {127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127};
#endif
/*==============================================================================
* nrLDPC_init.h
*
* Defines the function to initialize the LDPC decoder.
* Set correct LUTs
*
* Author: Sebastian Wagner
* Date: 17-11-2017
*
===============================================================================*/
#ifndef __NR_LDPC_INIT__H__
#define __NR_LDPC_INIT__H__
#include "./nrLDPC_lut/nrLDPC_lut.h"
#include "nrLDPC_defs.h"
static inline uint32_t nrLDPC_init(t_nrLDPC_dec_params* p_decParams, t_nrLDPC_lut* p_lut)
{
uint32_t numLLR = 0;
uint8_t BG = p_decParams->BG;
uint16_t Z = p_decParams->Z;
uint8_t R = p_decParams->R;
if (BG == 2)
{
// LUT that only depend on BG
p_lut->startAddrCnGroups = lut_startAddrCnGroups_BG2;
// LUT that only depend on R
if (R == 15)
{
p_lut->numCnInCnGroups = lut_numCnInCnGroups_BG2_R15;
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R15;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R15;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R15;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_R15;
numLLR = NR_LDPC_NCOL_BG2_R15*Z;
}
else if (R == 13)
{
p_lut->numCnInCnGroups = lut_numCnInCnGroups_BG2_R13;
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R13;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R13;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R13;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_R13;
numLLR = NR_LDPC_NCOL_BG2_R13*Z;
}
else if (R == 23)
{
p_lut->numCnInCnGroups = lut_numCnInCnGroups_BG2_R23;
p_lut->numBnInBnGroups = lut_numBnInBnGroups_BG2_R23;
p_lut->startAddrBnGroups = lut_startAddrBnGroups_BG2_R23;
p_lut->startAddrBnGroupsLlr = lut_startAddrBnGroupsLlr_BG2_R23;
p_lut->numEdgesPerBn = lut_numEdgesPerBn_BG2_R23;
numLLR = NR_LDPC_NCOL_BG2_R23*Z;
}
// LUT that depend on Z and R
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)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R15;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R15;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R15;
}
else if (R == 13)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R13;
}
else if (R == 23)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z128_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z128_R23;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z128_R23;
}
}
else if (Z == 384)
{
if (R == 15)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R15;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R15;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R15;
}
else if (R == 13)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R13;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_BG2_Z384_R13;
p_lut->llr2llrProcBuf = lut_llr2llrProcBuf_BG2_Z384_R13;
}
else if (R == 23)
{
p_lut->llr2CnProcBuf = lut_llr2CnProcBuf_BG2_Z384_R23;
p_lut->cn2bnProcBuf = lut_cn2bnProcBuf_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;
}
#endif
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.
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.
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 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.
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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -677,6 +677,8 @@ typedef struct {
uint32_t Kplus;
/// Number of "Filler" bits (for definition see 36-212 V8.6 2009-03, p.10)
uint32_t F;
/// LDPC lifting factor
uint32_t Z;
/// Number of MIMO layers (streams) (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Nl;
/// current delta_pucch
......
This diff is collapsed.
This diff is collapsed.
......@@ -1342,6 +1342,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe,
uint8_t harq_pid,
uint8_t is_crnti,
//uint8_t decoder_switch,
uint8_t llr8_flag);
uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
......
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