Commit 800f66b3 authored by Elena_Lukashova's avatar Elena_Lukashova

Fixing a bug in HARQ for SIC.

Now the llrs after SIC procedure are updated.
In dlsim_tm in case of TB0_active==-1,
the llr were taken from the wrong buffer, and in dlsch_demodulation
the SIC llrs were written into the wrong buffer in the same case.
parent e05a417c
......@@ -175,7 +175,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
dlsch1_harq = NULL;
codeword_TB0 = -1;
#ifdef DEBUG_HARQ
printf("[DEMOD] I am assuming only TB1 is active\n");
printf("[DEMOD] I am assuming only TB1 is active, it is in cw %d\n", dlsch0_harq->codeword);
#endif
}
else {
......@@ -750,7 +750,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
switch (dlsch0_harq->Qm) {
case 2 :
if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
......@@ -760,6 +760,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
} else if (codeword_TB0 == -1){
dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[1],
symbol,
first_symbol_flag,
nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
......@@ -829,7 +841,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
}
break;
case 4 :
if ((rx_type==rx_standard ) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
if ((rx_type==rx_standard ) || (codeword_TB1 == -1)) {
dlsch_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
......@@ -838,6 +850,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol),
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
} else if (codeword_TB0 == -1){
dlsch_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[1],
pdsch_vars[eNB_id]->dl_ch_mag0,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
......@@ -913,7 +934,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
}
break;
case 6 :
if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
......@@ -923,6 +944,16 @@ int rx_pdsch(PHY_VARS_UE *ue,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol),
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
} else if (codeword_TB0 == -1){
dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[1],
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
......
......@@ -4133,21 +4133,25 @@ int main(int argc, char **argv)
0,
UE->dlsch[subframe&0x1][0][TB],
coded_bits_per_codeword[TB],
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword],
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[TB],
TB,
subframe<<1);
stop_meas(&UE->dlsch_unscrambling_stats);
start_meas(&UE->dlsch_decoding_stats[subframe&0x1]);
#ifdef DEBUG_HARQ
//printf("non-SIC decoding TB %d LLR is %d\n", TB, UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword);
#endif
ret[TB] = dlsch_decoding(UE,
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid]->codeword],
UE->pdsch_vars[subframe&0x1][eNB_id]->llr[TB],
&UE->frame_parms,
UE->dlsch[subframe&0x1][0][TB],
UE->dlsch[subframe&0x1][0][TB]->harq_processes[UE->dlsch[subframe&0x1][0][TB]->current_harq_pid],
0,
subframe,
UE->dlsch[subframe&0x1][0][TB]->current_harq_pid,
1,llr8_flag);
subframe,
UE->dlsch[subframe&0x1][0][TB]->current_harq_pid,
1,
llr8_flag);
stop_meas(&UE->dlsch_decoding_stats[subframe&0x1]);
#ifdef DEBUG_HARQ
printf("[DLSIM] ret[%d] = %d\n", TB, ret[TB]);
......
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