Commit 5c2a411a authored by Raymond Knopp's avatar Raymond Knopp

added optimized polar decoding to UE DCI processing. Still to be tested....

added optimized polar decoding to UE DCI processing. Still to be tested. Changed decoder API to return XOR(CRC,rxCRC) which can be used to check for RNTI at receiver. For PBCH it returns 0 on positive CRC, !=0 on CRC mismatch.
parent 2da40731
...@@ -32,7 +32,7 @@ int main(int argc, char *argv[]) { ...@@ -32,7 +32,7 @@ int main(int argc, char *argv[]) {
double SNR, SNR_lin; double SNR, SNR_lin;
int16_t nBitError = 0; // -1 = Decoding failed (All list entries have failed the CRC checks). int16_t nBitError = 0; // -1 = Decoding failed (All list entries have failed the CRC checks).
int8_t decoderState=0, blockErrorState=0; //0 = Success, -1 = Decoding failed, 1 = Block Error. uint32_t decoderState=0, blockErrorState=0; //0 = Success, -1 = Decoding failed, 1 = Block Error.
uint16_t testLength = 0, coderLength = 0, blockErrorCumulative=0, bitErrorCumulative=0; uint16_t testLength = 0, coderLength = 0, blockErrorCumulative=0, bitErrorCumulative=0;
double timeEncoderCumulative = 0, timeDecoderCumulative = 0; double timeEncoderCumulative = 0, timeDecoderCumulative = 0;
uint8_t aggregation_level = 8, decoderListSize = 8, pathMetricAppr = 0; uint8_t aggregation_level = 8, decoderListSize = 8, pathMetricAppr = 0;
...@@ -385,7 +385,7 @@ int main(int argc, char *argv[]) { ...@@ -385,7 +385,7 @@ int main(int argc, char *argv[]) {
//calculate errors //calculate errors
if (decoderState==-1) { if (decoderState!=0) {
blockErrorState=-1; blockErrorState=-1;
nBitError=-1; nBitError=-1;
} else { } else {
......
...@@ -1070,9 +1070,9 @@ void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) { ...@@ -1070,9 +1070,9 @@ void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) {
} }
int8_t polar_decoder_int16(int16_t *input, uint32_t polar_decoder_int16(int16_t *input,
uint64_t *out, uint64_t *out,
t_nrPolar_params *polarParams) t_nrPolar_params *polarParams)
{ {
...@@ -1137,15 +1137,14 @@ int8_t polar_decoder_int16(int16_t *input, ...@@ -1137,15 +1137,14 @@ int8_t polar_decoder_int16(int16_t *input,
B[1],B[0],Cprime[1],Cprime[0],crc, B[1],B[0],Cprime[1],Cprime[0],crc,
rxcrc,polarParams->payloadBits); rxcrc,polarParams->payloadBits);
#endif #endif
if (((uint64_t)crc) == rxcrc) { int k=0;
int k=0; // copy quadwords without CRC directly
// copy quadwords without CRC directly for (k=0;k<polarParams->payloadBits/64;k++) out[k]=B[k];
for (k=0;k<polarParams->payloadBits/64;k++) out[k]=B[k];
// copy last one // copy last one
out[k] = B[k] & (((uint64_t)1<<(polarParams->payloadBits&63))-1); out[k] = B[k] & (((uint64_t)1<<(polarParams->payloadBits&63))-1);
return(0);
} return(crc^rxcrc);
else return(-1);
} }
...@@ -148,9 +148,9 @@ void polar_encoder_dci(uint32_t *in, ...@@ -148,9 +148,9 @@ void polar_encoder_dci(uint32_t *in,
uint16_t n_RNTI); uint16_t n_RNTI);
void polar_encoder_fast(uint64_t *A, void polar_encoder_fast(uint64_t *A,
uint32_t *out, uint32_t *out,
int32_t crcmask, int32_t crcmask,
t_nrPolar_paramsPtr polarParams); t_nrPolar_paramsPtr polarParams);
int8_t polar_decoder(double *input, int8_t polar_decoder(double *input,
uint8_t *output, uint8_t *output,
...@@ -158,9 +158,9 @@ int8_t polar_decoder(double *input, ...@@ -158,9 +158,9 @@ int8_t polar_decoder(double *input,
uint8_t listSize, uint8_t listSize,
uint8_t pathMetricAppr); uint8_t pathMetricAppr);
int8_t polar_decoder_int16(int16_t *input, uint32_t polar_decoder_int16(int16_t *input,
uint64_t *out, uint64_t *out,
t_nrPolar_params *polarParams); t_nrPolar_params *polarParams);
int8_t polar_decoder_aPriori(double *input, int8_t polar_decoder_aPriori(double *input,
uint32_t *output, uint32_t *output,
......
...@@ -222,7 +222,8 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars, ...@@ -222,7 +222,8 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
t_nrPolar_paramsPtr currentPtr = nr_polar_params(*nrPolar_params, NR_POLAR_DCI_MESSAGE_TYPE, dci_alloc.size, dci_alloc.L); t_nrPolar_paramsPtr currentPtr = nr_polar_params(*nrPolar_params, NR_POLAR_DCI_MESSAGE_TYPE, dci_alloc.size, dci_alloc.L);
#endif #endif
polar_encoder_dci(dci_alloc.dci_pdu, encoder_output, currentPtr, pdcch_params.rnti); //polar_encoder_dci(dci_alloc.dci_pdu, encoder_output, currentPtr, pdcch_params.rnti);
polar_encoder_fast(dci_alloc.dci_pdu, encoder_output, pdcch_params.rnti,currentPtr);
#ifdef DEBUG_CHANNEL_CODING #ifdef DEBUG_CHANNEL_CODING
printf("polar rnti %d\n",pdcch_params.rnti); printf("polar rnti %d\n",pdcch_params.rnti);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -661,8 +661,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, ...@@ -661,8 +661,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
decoderState = polar_decoder_int16(pbch_e_rx,(uint8_t*)&nr_ue_pbch_vars->pbch_a_prime,currentPtr); decoderState = polar_decoder_int16(pbch_e_rx,(uint8_t*)&nr_ue_pbch_vars->pbch_a_prime,currentPtr);
if(decoderState == -1) if(decoderState > 0) return(decoderState);
return(decoderState);
//printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime); //printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime);
......
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