|
|
|
@@ -257,6 +257,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
|
|
|
|
|
__m128i *pv = (__m128i*)&z;
|
|
|
|
|
__m128i *pl = (__m128i*)&l;
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_IN);
|
|
|
|
|
|
|
|
|
|
//NR_DL_UE_HARQ_t *harq_process = dlsch->harq_processes[0];
|
|
|
|
|
|
|
|
|
@@ -312,8 +314,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
|
|
|
|
|
LOG_I(PHY,"DLSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_IN);
|
|
|
|
|
|
|
|
|
|
if ((harq_process->R)<1024)
|
|
|
|
|
Coderate = (float) (harq_process->R) /(float) 1024;
|
|
|
|
|
else
|
|
|
|
@@ -374,7 +374,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
p_decParams->Z = harq_process->Z;
|
|
|
|
|
//printf("dlsch decoding nr segmentation Z %d\n", p_decParams->Z);
|
|
|
|
@@ -424,14 +424,14 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
start_meas(dlsch_deinterleaving_stats);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
nr_deinterleaving_ldpc(E,
|
|
|
|
|
harq_process->Qm,
|
|
|
|
|
harq_process->w[r], // [hna] w is e
|
|
|
|
|
dlsch_llr+r_offset);
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
|
|
|
|
|
|
|
|
|
|
//for (int i =0; i<16; i++)
|
|
|
|
|
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
|
|
|
@@ -456,7 +456,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
harq_process->round);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN);
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN);
|
|
|
|
|
|
|
|
|
|
if ((harq_process->Nl)<4)
|
|
|
|
|
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,harq_process->Nl,harq_process->C);
|
|
|
|
@@ -473,7 +473,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
harq_process->rvidx,
|
|
|
|
|
(harq_process->round==0)?1:0,
|
|
|
|
|
E)==-1) {
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
|
|
|
|
|
#if UE_TIMING_TRACE
|
|
|
|
|
stop_meas(dlsch_rate_unmatching_stats);
|
|
|
|
|
#endif
|
|
|
|
@@ -481,7 +481,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
return(dlsch->max_ldpc_iterations + 1);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
|
|
|
|
|
#if UE_TIMING_TRACE
|
|
|
|
|
stop_meas(dlsch_rate_unmatching_stats);
|
|
|
|
|
#endif
|
|
|
|
@@ -552,7 +551,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
pl[j] = _mm_packs_epi16(pv[i],pv[i+1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN);
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN);
|
|
|
|
|
|
|
|
|
|
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
|
|
|
|
|
(int8_t*)&pl[0],
|
|
|
|
@@ -560,7 +559,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
p_nrLDPC_procBuf[r],
|
|
|
|
|
p_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);
|
|
|
|
|
|
|
|
|
|
// 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)) {
|
|
|
|
@@ -686,7 +685,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
printf("C %d\n",harq_process->C);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_IN);
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_IN);
|
|
|
|
|
|
|
|
|
|
for (r=0; r<harq_process->C; r++) {
|
|
|
|
|
|
|
|
|
@@ -721,7 +720,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_OUT);
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_OUT);
|
|
|
|
|
|
|
|
|
|
dlsch->last_iteration_cnt = ret;
|
|
|
|
|
|
|
|
|
@@ -794,6 +793,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
notifiedFIFO_t nf;
|
|
|
|
|
initNotifiedFIFO(&nf);
|
|
|
|
|
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_IN);
|
|
|
|
|
|
|
|
|
|
if (!dlsch_llr) {
|
|
|
|
|
printf("dlsch_decoding.c: NULL dlsch_llr pointer\n");
|
|
|
|
@@ -845,7 +845,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
|
|
|
|
|
G = harq_process->G;
|
|
|
|
|
|
|
|
|
|
LOG_I(PHY,"DLSCH Decoding main, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
|
|
|
|
LOG_D(PHY,"DLSCH Decoding main, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc->decoder_main_available = 1;
|
|
|
|
@@ -1112,7 +1112,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
#if UE_TIMING_TRACE
|
|
|
|
|
start_meas(dlsch_turbo_decoding_stats);
|
|
|
|
|
#endif
|
|
|
|
|
LOG_I(PHY,"mthread AbsSubframe %d.%d Start LDPC segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1);
|
|
|
|
|
LOG_D(PHY,"mthread AbsSubframe %d.%d Start LDPC segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1);
|
|
|
|
|
|
|
|
|
|
/*for (int cnt =0; cnt < (kc-2)*p_decParams->Z; cnt++){
|
|
|
|
|
inv_d[cnt] = (1)*harq_process->d[r][cnt];
|
|
|
|
@@ -1162,9 +1162,9 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
ret = 1+dlsch->max_ldpc_iterations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (!nb_total_decod%10000){
|
|
|
|
|
printf("Error number of iteration LPDC %d %lu/%lu \n", no_iteration_ldpc, nb_error_decod,nb_total_decod);fflush(stdout);
|
|
|
|
|
//}
|
|
|
|
|
if (!nb_total_decod%10000){
|
|
|
|
|
printf("Error number of iteration LPDC %d %ld/%ld \n", no_iteration_ldpc, nb_error_decod,nb_total_decod);fflush(stdout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//else
|
|
|
|
|
//printf("OK number of iteration LPDC %d\n", no_iteration_ldpc);
|
|
|
|
@@ -1269,21 +1269,13 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
printf("F %d, Fbytes %d\n",harq_process->F,harq_process->F>>3);
|
|
|
|
|
printf("C %d\n",harq_process->C);
|
|
|
|
|
*/
|
|
|
|
|
uint32_t wait = 0;
|
|
|
|
|
/*if (harq_process->C==2){
|
|
|
|
|
while((proc->decoder_thread_available == 0) )
|
|
|
|
|
//uint32_t wait = 0;
|
|
|
|
|
|
|
|
|
|
/* while((proc->decoder_thread_available == 0) )
|
|
|
|
|
{
|
|
|
|
|
usleep(1);
|
|
|
|
|
wait++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ((harq_process->C==3) ){
|
|
|
|
|
while((proc->decoder_thread_available == 0) || (proc->decoder_thread_available1 == 0))
|
|
|
|
|
{
|
|
|
|
|
usleep(1);
|
|
|
|
|
wait++;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
proc->decoder_thread_available == 0;*/
|
|
|
|
|
|
|
|
|
|
/*notifiedFIFO_elt_t *res1=tryPullTpool(&nf, Tpool);
|
|
|
|
|
if (!res1) {
|
|
|
|
@@ -1291,6 +1283,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
usleep(1);
|
|
|
|
|
wait++;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
//usleep(50);
|
|
|
|
|
|
|
|
|
|
proc->decoder_main_available = 0;
|
|
|
|
|
Kr = harq_process->K; //to check if same K in all segments
|
|
|
|
@@ -1313,6 +1307,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
|
|
|
|
harq_process->c[r]);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION, VCD_FUNCTION_OUT);
|
|
|
|
|
|
|
|
|
|
dlsch->last_iteration_cnt = ret;
|
|
|
|
|
//proc->decoder_thread_available = 0;
|
|
|
|
|