Commit 18500674 authored by Thomas Schlichter's avatar Thomas Schlichter

improve nr_dlsch_decoding

parent 11693b16
...@@ -259,7 +259,6 @@ void nr_processDLSegment(void* arg) { ...@@ -259,7 +259,6 @@ void nr_processDLSegment(void* arg) {
int length_dec; int length_dec;
int no_iteration_ldpc; int no_iteration_ldpc;
int Kr; int Kr;
int Kr_bytes;
int K_bits_F; int K_bits_F;
uint8_t crc_type; uint8_t crc_type;
int i; int i;
...@@ -282,8 +281,7 @@ void nr_processDLSegment(void* arg) { ...@@ -282,8 +281,7 @@ void nr_processDLSegment(void* arg) {
__m128i *pv = (__m128i*)&z; __m128i *pv = (__m128i*)&z;
__m128i *pl = (__m128i*)&l; __m128i *pl = (__m128i*)&l;
Kr = harq_process->K; // [hna] overwrites this line "Kr = p_decParams->Z*kb" Kr = harq_process->K;
Kr_bytes = Kr>>3;
K_bits_F = Kr-harq_process->F; K_bits_F = Kr-harq_process->F;
t_nrLDPC_time_stats procTime = {0}; t_nrLDPC_time_stats procTime = {0};
...@@ -293,8 +291,7 @@ void nr_processDLSegment(void* arg) { ...@@ -293,8 +291,7 @@ void nr_processDLSegment(void* arg) {
start_meas(&rdata->ts_deinterleave); start_meas(&rdata->ts_deinterleave);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
int16_t w[E]; int16_t w[E];
memset(w, 0, sizeof(w));
nr_deinterleaving_ldpc(E, nr_deinterleaving_ldpc(E,
Qm, Qm,
w, // [hna] w is e w, // [hna] w is e
...@@ -321,7 +318,7 @@ void nr_processDLSegment(void* arg) { ...@@ -321,7 +318,7 @@ void nr_processDLSegment(void* arg) {
w, w,
harq_process->C, harq_process->C,
harq_process->rvidx, harq_process->rvidx,
(harq_process->first_rx==1)?1:0, harq_process->first_rx,
E, E,
harq_process->F, harq_process->F,
Kr-harq_process->F-2*(p_decoderParms->Z))==-1) { Kr-harq_process->F-2*(p_decoderParms->Z))==-1) {
...@@ -333,8 +330,6 @@ void nr_processDLSegment(void* arg) { ...@@ -333,8 +330,6 @@ void nr_processDLSegment(void* arg) {
} }
stop_meas(&rdata->ts_rate_unmatch); stop_meas(&rdata->ts_rate_unmatch);
r_offset += E;
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) { if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) {
LOG_D(PHY,"decoder input(segment %u) :",r); LOG_D(PHY,"decoder input(segment %u) :",r);
...@@ -344,8 +339,6 @@ void nr_processDLSegment(void* arg) { ...@@ -344,8 +339,6 @@ void nr_processDLSegment(void* arg) {
LOG_D(PHY,"\n"); LOG_D(PHY,"\n");
} }
memset(harq_process->c[r],0,Kr_bytes);
if (harq_process->C == 1) { if (harq_process->C == 1) {
if (A > NR_MAX_PDSCH_TBS) if (A > NR_MAX_PDSCH_TBS)
crc_type = CRC24_A; crc_type = CRC24_A;
...@@ -383,21 +376,23 @@ void nr_processDLSegment(void* arg) { ...@@ -383,21 +376,23 @@ void nr_processDLSegment(void* arg) {
&procTime); &procTime);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT);
LOG_D(PHY,"no_iteration_ldpc = %d\n", no_iteration_ldpc);
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) { if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) {
LOG_D(PHY,"Segment %u CRC OK\n",r); LOG_D(PHY,"Segment %u CRC OK\n",r);
if (no_iteration_ldpc > dlsch->max_ldpc_iterations)
if (r==0) { no_iteration_ldpc = dlsch->max_ldpc_iterations;
for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]);
}
//Temporary hack
no_iteration_ldpc = dlsch->max_ldpc_iterations;
rdata->decodeIterations = no_iteration_ldpc;
} else { } else {
LOG_D(PHY,"CRC NOT OK\n"); LOG_D(PHY,"CRC NOT OK\n");
no_iteration_ldpc = dlsch->max_ldpc_iterations + 1;
} }
if (r==0) {
for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]);
}
rdata->decodeIterations = no_iteration_ldpc;
nb_total_decod++; nb_total_decod++;
if (no_iteration_ldpc > dlsch->max_ldpc_iterations) { if (no_iteration_ldpc > dlsch->max_ldpc_iterations) {
...@@ -547,7 +542,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -547,7 +542,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
} }
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD) && (!frame%100)) if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD) && (!frame%100))
LOG_I(PHY,"K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, p_decParams->Z, harq_process->Nl); LOG_I(PHY,"K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, harq_process->Z, harq_process->Nl);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_OUT);
......
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