Commit d023da4c authored by francescomani's avatar francescomani

fix dl retransmissions

parent 38a8f9a4
...@@ -1093,10 +1093,10 @@ ...@@ -1093,10 +1093,10 @@
(Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset), (Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
(Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27), (Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27),
(Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16), (Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16),
(Test11: 106 MCS-TABLE 256 QAM MCS Index 26), (Test11: 106 MCS-TABLE 256 QAM MCS Index 27),
(Test12: HARQ test 25% TP (4 rounds), (Test12: HARQ test 25% TP 4 rounds),
(Test13: HARQ test 33% TP (3 rounds), (Test13: HARQ test 33% TP 3 rounds),
(Test14: HARQ test 50% TP (2 rounds), (Test14: HARQ test 50% TP 2 rounds),
(Test15: 3 PTRS, 8 Interpolated Symbols), (Test15: 3 PTRS, 8 Interpolated Symbols),
(Test16: 6 PTRS, 5 Interpolated Symbols), (Test16: 6 PTRS, 5 Interpolated Symbols),
(Test17: 11 PTRS, 0 Interpolated Symbols), (Test17: 11 PTRS, 0 Interpolated Symbols),
......
...@@ -102,9 +102,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) { ...@@ -102,9 +102,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
for (int r=0; r<a_segments; r++) { for (int r=0; r<a_segments; r++) {
free16(dlsch->harq_processes[i]->c[r],1056); free16(dlsch->harq_processes[i]->c[r],1056);
dlsch->harq_processes[i]->c[r] = NULL; dlsch->harq_processes[i]->c[r] = NULL;
free16(dlsch->harq_processes[i]->d[r],5*8448);
dlsch->harq_processes[i]->d[r] = NULL;
nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]); nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
} }
free16(dlsch->harq_processes[i]->c,a_segments); free16(dlsch->harq_processes[i]->c,a_segments);
free16(dlsch->harq_processes[i]->d,a_segments);
free16(dlsch->harq_processes[i]->p_nrLDPC_procBuf,a_segments); free16(dlsch->harq_processes[i]->p_nrLDPC_procBuf,a_segments);
free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t)); free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t));
...@@ -157,13 +160,16 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint ...@@ -157,13 +160,16 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
exit_flag=3; exit_flag=3;
dlsch->harq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); dlsch->harq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *));
dlsch->harq_processes[i]->d = (int16_t **)malloc16(a_segments*sizeof(int16_t *));
dlsch->harq_processes[i]->p_nrLDPC_procBuf = (t_nrLDPC_procBuf **)malloc16(a_segments*sizeof(t_nrLDPC_procBuf *)); dlsch->harq_processes[i]->p_nrLDPC_procBuf = (t_nrLDPC_procBuf **)malloc16(a_segments*sizeof(t_nrLDPC_procBuf *));
for (int r=0; r<a_segments; r++) { for (int r=0; r<a_segments; r++) {
dlsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); dlsch->harq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056);
dlsch->harq_processes[i]->d[r] = (int16_t *)malloc16(5*8448*sizeof(int16_t));
if (dlsch->harq_processes[i]->c[r]) if (dlsch->harq_processes[i]->c[r])
memset(dlsch->harq_processes[i]->c[r],0,1056); memset(dlsch->harq_processes[i]->c[r],0,1056);
if (dlsch->harq_processes[i]->d[r])
memset(dlsch->harq_processes[i]->d[r],0,5*8448);
else else
exit_flag=2; exit_flag=2;
} }
...@@ -323,13 +329,11 @@ void nr_processDLSegment(void* arg) { ...@@ -323,13 +329,11 @@ void nr_processDLSegment(void* arg) {
harq_process->round); */ harq_process->round); */
//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);
int16_t d[5*8448];
memset(d,0,(5*8448)*sizeof(short));
if (nr_rate_matching_ldpc_rx(Ilbrm, if (nr_rate_matching_ldpc_rx(Ilbrm,
Tbslbrm, Tbslbrm,
p_decoderParms->BG, p_decoderParms->BG,
p_decoderParms->Z, p_decoderParms->Z,
d, harq_process->d[r],
w, w,
harq_process->C, harq_process->C,
harq_process->rvidx, harq_process->rvidx,
...@@ -351,7 +355,7 @@ void nr_processDLSegment(void* arg) { ...@@ -351,7 +355,7 @@ void nr_processDLSegment(void* arg) {
LOG_D(PHY,"decoder input(segment %u) :",r); LOG_D(PHY,"decoder input(segment %u) :",r);
for (int i=0; i<E; i++) for (int i=0; i<E; i++)
LOG_D(PHY,"%d : %d\n",i,d[i]); LOG_D(PHY,"%d : %d\n",i,harq_process->d[r][i]);
LOG_D(PHY,"\n"); LOG_D(PHY,"\n");
} }
...@@ -377,9 +381,9 @@ void nr_processDLSegment(void* arg) { ...@@ -377,9 +381,9 @@ void nr_processDLSegment(void* arg) {
//set Filler bits //set Filler bits
memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t));
//Move coded bits before filler bits //Move coded bits before filler bits
memcpy((&z[0]+2*harq_process->Z),d,(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t));
//skip filler bits //skip filler bits
memcpy((&z[0]+Kr),d+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t));
//Saturate coded bits before decoding into 8 bits values //Saturate coded bits before decoding into 8 bits values
for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) {
......
...@@ -180,6 +180,8 @@ typedef struct { ...@@ -180,6 +180,8 @@ typedef struct {
uint8_t *b; uint8_t *b;
/// Pointers to transport block segments /// Pointers to transport block segments
uint8_t **c; uint8_t **c;
/// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15)
int16_t **d;
/// Index of current HARQ round for this DLSCH /// Index of current HARQ round for this DLSCH
uint8_t round; uint8_t round;
/// MCS table for this DLSCH /// MCS table for this DLSCH
......
...@@ -656,7 +656,7 @@ int main(int argc, char **argv) ...@@ -656,7 +656,7 @@ int main(int argc, char **argv)
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n",
argv[0]); argv[0]);
printf("-h This message\n"); printf("-h This message\n");
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n"); printf("-L <log level, 0(errors), 1(warning), 2(analysis), 3(info), 4(debug), 5(trace)>\n");
//printf("-p Use extended prefix mode\n"); //printf("-p Use extended prefix mode\n");
//printf("-d Use TDD\n"); //printf("-d Use TDD\n");
printf("-n Number of frames to simulate\n"); printf("-n Number of frames to simulate\n");
...@@ -1324,7 +1324,8 @@ int main(int argc, char **argv) ...@@ -1324,7 +1324,8 @@ int main(int argc, char **argv)
printf("*****************************************\n"); printf("*****************************************\n");
printf("\n"); printf("\n");
dump_pdsch_stats(stdout,gNB); dump_pdsch_stats(stdout,gNB);
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS); printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n",
SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
printf("\n"); printf("\n");
if (print_perf==1) { if (print_perf==1) {
......
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