Commit 08ff33a0 authored by sfn's avatar sfn Committed by Thomas Schlichter

Fix llr calculation to support multiple layers

parent 77a450d0
...@@ -110,6 +110,8 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw, ...@@ -110,6 +110,8 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw,
uint8_t Nl, uint8_t Nl,
uint8_t mod_order, uint8_t mod_order,
uint16_t length, uint16_t length,
int32_t codeword_TB0,
int32_t codeword_TB1,
int16_t **llr_layers); int16_t **llr_layers);
...@@ -662,16 +664,30 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -662,16 +664,30 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
pdsch_vars[gNB_id]->dl_valid_re[i-1], pdsch_vars[gNB_id]->dl_valid_re[i-1],
nr_slot_rx, beamforming_mode); nr_slot_rx, beamforming_mode);
} }
}
//nr_dlsch_deinterleaving(symbol,bundle_L,(int16_t*)pllr_symbol_cw0,(int16_t*)pllr_symbol_cw0_deint, nb_rb_pdsch);
if (rx_type==rx_IC_dual_stream) { int dmrs_type = dlsch[0]->harq_processes[harq_pid]->dmrsConfigType;
uint8_t nb_re_dmrs;
uint16_t dmrs_len = get_num_dmrs(dlsch[0]->harq_processes[harq_pid]->dlDmrsSymbPos);
if (dmrs_type==NFAPI_NR_DMRS_TYPE1) {
nb_re_dmrs = 6*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
} else {
nb_re_dmrs = 4*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
}
dlsch[0]->harq_processes[harq_pid]->G = nr_get_G(dlsch[0]->harq_processes[harq_pid]->nb_rb,
dlsch[0]->harq_processes[harq_pid]->nb_symbols,
nb_re_dmrs,
dmrs_len,
dlsch[0]->harq_processes[harq_pid]->Qm,
dlsch[0]->harq_processes[harq_pid]->Nl);
printf("nr_dlsch_layer_demapping Nl%d G %d\n",dlsch[0]->harq_processes[harq_pid]->Nl,dlsch[0]->harq_processes[harq_pid]->G);
nr_dlsch_layer_demapping(pdsch_vars[gNB_id]->llr, nr_dlsch_layer_demapping(pdsch_vars[gNB_id]->llr,
dlsch[0]->harq_processes[harq_pid]->Nl, dlsch[0]->harq_processes[harq_pid]->Nl,
dlsch[0]->harq_processes[harq_pid]->Qm, dlsch[0]->harq_processes[harq_pid]->Qm,
dlsch[0]->harq_processes[harq_pid]->G, dlsch[0]->harq_processes[harq_pid]->G,
codeword_TB0,
codeword_TB1,
pdsch_vars[gNB_id]->layer_llr); pdsch_vars[gNB_id]->layer_llr);
} }
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
...@@ -2924,12 +2940,17 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw, ...@@ -2924,12 +2940,17 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw,
uint8_t Nl, uint8_t Nl,
uint8_t mod_order, uint8_t mod_order,
uint16_t length, uint16_t length,
int32_t codeword_TB0,
int32_t codeword_TB1,
int16_t **llr_layers) { int16_t **llr_layers) {
switch (Nl) { switch (Nl) {
case 1: case 1:
memcpy((void*)llr_layers[0], (void*)llr_cw[0], (length)*sizeof(int16_t)); if (codeword_TB1 == -1)
memcpy((void*)llr_cw[0], (void*)llr_layers[0], (length)*sizeof(int16_t));
else if (codeword_TB0 == -1)
memcpy((void*)llr_cw[1], (void*)llr_layers[0], (length)*sizeof(int16_t));
break; break;
case 2: case 2:
...@@ -2937,11 +2958,15 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw, ...@@ -2937,11 +2958,15 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw,
case 4: case 4:
for (int i=0; i<(length/Nl/mod_order); i++){ for (int i=0; i<(length/Nl/mod_order); i++){
for (int l=0; l<Nl; l++) { for (int l=0; l<Nl; l++) {
for (int m=0; m<mod_order; m++){ for (int m=0; m<mod_order; m++){
llr_cw[0][Nl*i+l*mod_order+m] = llr_layers[l][i*mod_order+m]; if (codeword_TB1 == -1)
} llr_cw[0][Nl*mod_order*i+l*mod_order+m] = llr_layers[l][i*mod_order+m];//i:0 -->0 1 2 3
else if (codeword_TB0 == -1)
llr_cw[1][Nl*mod_order*i+l*mod_order+m] = llr_layers[l][i*mod_order+m];//i:0 -->0 1 2 3
//if (i<4) printf("length%d: llr_layers[l%d][m%d]=%d: \n",length,l,m,llr_layers[l][i*mod_order+m]);
}
}
} }
}
break; break;
default: default:
...@@ -3009,299 +3034,110 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, ...@@ -3009,299 +3034,110 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
switch (dlsch0_harq->Qm) { switch (dlsch0_harq->Qm) {
case 2 : case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { switch (rx_type) {
nr_dlsch_qpsk_llr(frame_parms, case rx_standard :
pdsch_vars[gNB_id]->rxdataF_comp0, for(int l =0; l<dlsch0_harq->Nl; l++)
pllr_symbol_cw0, nr_dlsch_qpsk_llr(frame_parms,
symbol, pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
len, pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
first_symbol_flag, symbol,
nb_rb, len,
beamforming_mode); first_symbol_flag,
nb_rb,
} else if (codeword_TB0 == -1){ beamforming_mode);
break;
nr_dlsch_qpsk_llr(frame_parms, case rx_IC_single_stream ://not implemented yet
pdsch_vars[gNB_id]->rxdataF_comp0, /*nr_dlsch_qpsk_qpsk_llr(frame_parms,
pllr_symbol_cw1,
symbol,
len,
first_symbol_flag,
nb_rb,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
nr_dlsch_qpsk_qpsk_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr, rxdataF_comp_ptr,
pdsch_vars[gNB_id]->dl_ch_rho2_ext, pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0], pdsch_vars[gNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb, symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol), adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128); pdsch_vars[gNB_id]->llr128);*/
if (rx_type==rx_IC_dual_stream) { break;
nr_dlsch_qpsk_qpsk_llr(frame_parms, case rx_IC_dual_stream ://not implemented yet
rxdataF_comp_ptr, /*nr_dlsch_qpsk_qpsk_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0, rxdataF_comp_ptr,
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[gNB_id]->rxdataF_comp0,
pdsch_vars[gNB_id]->layer_llr[1], pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
symbol,len,first_symbol_flag,nb_rb, pdsch_vars[gNB_id]->layer_llr[1],
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol), symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[gNB_id]->llr128_2ndstream); adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
} pdsch_vars[gNB_id]->llr128_2ndstream);*/
} break;
else if (dlsch1_harq->Qm == 4) { case rx_SIC_dual_stream ://not implemented yet
nr_dlsch_qpsk_16qam_llr(frame_parms, break;
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
dl_ch_mag_ptr,//i
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_qpsk_64qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
dl_ch_mag_ptr,//i
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
} }
break; break;
case 4 : case 4 :
if ((rx_type==rx_standard ) || (codeword_TB1 == -1)) { switch (rx_type) {
nr_dlsch_16qam_llr(frame_parms, case rx_standard :
pdsch_vars[gNB_id]->rxdataF_comp0, for(int l =0; l<dlsch0_harq->Nl; l++)
pdsch_vars[gNB_id]->llr[0], nr_dlsch_16qam_llr(frame_parms,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
symbol,len,first_symbol_flag,nb_rb, pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
pdsch_vars[gNB_id]->llr128, pdsch_vars[gNB_id]->dl_ch_mag0[l*frame_parms->nb_antennas_rx],
beamforming_mode); symbol,
} else if (codeword_TB0 == -1){ len,
nr_dlsch_16qam_llr(frame_parms, first_symbol_flag,
pdsch_vars[gNB_id]->rxdataF_comp0, nb_rb,
pdsch_vars[gNB_id]->llr[1], beamforming_mode);
pdsch_vars[gNB_id]->dl_ch_mag0, break;
symbol,len,first_symbol_flag,nb_rb, case rx_IC_single_stream ://not implemented yet
pdsch_vars[gNB_id]->llr128_2ndstream, break;
beamforming_mode); case rx_IC_dual_stream ://not implemented yet
} break;
else if (rx_type >= rx_IC_single_stream) { case rx_SIC_dual_stream ://not implemented yet
if (dlsch1_harq->Qm == 2) { break;
nr_dlsch_16qam_qpsk_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
pdsch_vars[gNB_id]->dl_ch_mag0,//i
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_16qam_16qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[gNB_id]->dl_ch_mag0,//i
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_16qam_64qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,
dl_ch_mag_ptr,
pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
} }
break; break;
case 6 : case 6 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { switch (rx_type) {
nr_dlsch_64qam_llr(frame_parms, case rx_standard :
pdsch_vars[gNB_id]->rxdataF_comp0, for(int l =0; l<dlsch0_harq->Nl; l++)
(int16_t*)pllr_symbol_cw0, nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
symbol,len,first_symbol_flag,nb_rb, pdsch_vars[gNB_id]->dl_ch_mag0[l*frame_parms->nb_antennas_rx],
pdsch_vars[gNB_id]->llr_offset[symbol], pdsch_vars[gNB_id]->dl_ch_magb0[l*frame_parms->nb_antennas_rx],
beamforming_mode); symbol,
} else if (codeword_TB0 == -1){ len,
nr_dlsch_64qam_llr(frame_parms, first_symbol_flag,
pdsch_vars[gNB_id]->rxdataF_comp0, nb_rb,
pllr_symbol_cw1, beamforming_mode);
pdsch_vars[gNB_id]->dl_ch_mag0, break;
pdsch_vars[gNB_id]->dl_ch_magb0, case rx_IC_single_stream ://not implemented yet
symbol,len,first_symbol_flag,nb_rb, break;
pdsch_vars[gNB_id]->llr_offset[symbol], case rx_IC_dual_stream ://not implemented yet
beamforming_mode); break;
} case rx_SIC_dual_stream ://not implemented yet
else if (rx_type >= rx_IC_single_stream) { break;
if (dlsch1_harq->Qm == 2) {
nr_dlsch_64qam_qpsk_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_64qam_16qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
pdsch_vars[gNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[gNB_id]->dl_ch_mag0,//i
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[gNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_64qam_64qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[gNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[gNB_id]->dl_ch_rho2_ext,
(int16_t*)pllr_symbol_layer0,
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr_offset[symbol]);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[gNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[gNB_id]->dl_ch_mag0,//i
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
pllr_symbol_layer1,
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_slot_rx,symbol),
pdsch_vars[gNB_id]->llr_offset[symbol]);
}
}
} }
break; break;
case 8: case 8:
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) { switch (rx_type) {
nr_dlsch_256qam_llr(frame_parms, case rx_standard :
pdsch_vars[gNB_id]->rxdataF_comp0, for(int l =0; l<dlsch0_harq->Nl; l++)
(int16_t*)pllr_symbol_cw0, nr_dlsch_256qam_llr(frame_parms,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->rxdataF_comp0[l*frame_parms->nb_antennas_rx],
pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->layer_llr[l]+llr_offset_symbol,
pdsch_vars[gNB_id]->dl_ch_magr0, pdsch_vars[gNB_id]->dl_ch_mag0[l*frame_parms->nb_antennas_rx],
symbol,len,first_symbol_flag,nb_rb, pdsch_vars[gNB_id]->dl_ch_magb0[l*frame_parms->nb_antennas_rx],
pdsch_vars[gNB_id]->llr_offset[symbol], pdsch_vars[gNB_id]->dl_ch_magr0[l*frame_parms->nb_antennas_rx],
beamforming_mode); symbol,
} else if (codeword_TB0 == -1){ len,
nr_dlsch_256qam_llr(frame_parms, first_symbol_flag,
pdsch_vars[gNB_id]->rxdataF_comp0, nb_rb,
pllr_symbol_cw1, beamforming_mode);
pdsch_vars[gNB_id]->dl_ch_mag0, break;
pdsch_vars[gNB_id]->dl_ch_magb0, case rx_IC_single_stream ://not implemented yet
pdsch_vars[gNB_id]->dl_ch_magr0, break;
symbol,len,first_symbol_flag,nb_rb, case rx_IC_dual_stream ://not implemented yet
pdsch_vars[gNB_id]->llr_offset[symbol], break;
beamforming_mode); case rx_SIC_dual_stream ://not implemented yet
break;
} }
break; break;
default: default:
...@@ -3315,45 +3151,54 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, ...@@ -3315,45 +3151,54 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
case 2 : case 2 :
if (rx_type==rx_standard) { if (rx_type==rx_standard) {
nr_dlsch_qpsk_llr(frame_parms, nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->rxdataF_comp0[0],
pllr_symbol_cw0, pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
symbol,len,first_symbol_flag,nb_rb, symbol,
len,
first_symbol_flag,
nb_rb,
beamforming_mode); beamforming_mode);
} }
break; break;
case 4: case 4:
if (rx_type==rx_standard) { if (rx_type==rx_standard) {
nr_dlsch_16qam_llr(frame_parms, nr_dlsch_16qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->rxdataF_comp0[0],
pdsch_vars[gNB_id]->llr[0], pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_mag0[0],
symbol,len,first_symbol_flag,nb_rb, symbol,
pdsch_vars[gNB_id]->llr128, len,
first_symbol_flag,
nb_rb,
beamforming_mode); beamforming_mode);
} }
break; break;
case 6 : case 6 :
if (rx_type==rx_standard) { if (rx_type==rx_standard) {
nr_dlsch_64qam_llr(frame_parms, nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->rxdataF_comp0[0],
pllr_symbol_cw0, pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_mag0[0],
pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->dl_ch_magb0[0],
symbol,len,first_symbol_flag,nb_rb, symbol,
pdsch_vars[gNB_id]->llr_offset[symbol], len,
beamforming_mode); first_symbol_flag,
nb_rb,
beamforming_mode);
} }
break; break;
case 8 : case 8 :
if (rx_type==rx_standard) { if (rx_type==rx_standard) {
nr_dlsch_256qam_llr(frame_parms, nr_dlsch_256qam_llr(frame_parms,
pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->rxdataF_comp0[0],
pllr_symbol_cw0, pdsch_vars[gNB_id]->layer_llr[0]+llr_offset_symbol,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_mag0[0],
pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->dl_ch_magb0[0],
pdsch_vars[gNB_id]->dl_ch_magr0, pdsch_vars[gNB_id]->dl_ch_magr0[0],
symbol,len,first_symbol_flag,nb_rb, symbol,
pdsch_vars[gNB_id]->llr_offset[symbol], len,
first_symbol_flag,
nb_rb,
beamforming_mode); beamforming_mode);
} }
break; break;
......
...@@ -629,16 +629,16 @@ __m128i tmp_result4 __attribute__ ((aligned(16))); ...@@ -629,16 +629,16 @@ __m128i tmp_result4 __attribute__ ((aligned(16)));
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
uint8_t beamforming_mode) uint8_t beamforming_mode)
{ {
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*nb_rb*12)]; uint32_t *rxF = (uint32_t *)&rxdataF_comp[((int32_t)symbol*nb_rb*12)];
uint32_t *llr32; uint32_t *llr32;
int i; int i;
...@@ -670,24 +670,23 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -670,24 +670,23 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
int32_t **dl_ch_mag, int32_t *dl_ch_mag,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
int16_t **llr32p,
uint8_t beamforming_mode) uint8_t beamforming_mode)
{ {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*nb_rb*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag; __m128i *ch_mag;
__m128i llr128[2]; __m128i llr128[2];
uint32_t *llr32; uint32_t *llr32;
#elif defined(__arm__) #elif defined(__arm__)
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*nb_rb*12)]; int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[(symbol*nb_rb*12)];
int16x8_t *ch_mag; int16x8_t *ch_mag;
int16x8_t xmm0; int16x8_t xmm0;
int16_t *llr16; int16_t *llr16;
...@@ -699,30 +698,17 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -699,30 +698,17 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr; llr32 = (uint32_t*)dlsch_llr;
} else {
llr32 = (uint32_t*)*llr32p;
}
#elif defined(__arm__) #elif defined(__arm__)
if (first_symbol_flag==1) {
llr16 = (int16_t*)dlsch_llr; llr16 = (int16_t*)dlsch_llr;
} else {
llr16 = (int16_t*)*llr32p;
}
#endif #endif
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
#elif defined(__arm__) #elif defined(__arm__)
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (int16x8_t*)&dl_ch_mag[(symbol*nb_rb*12)];
#endif #endif
// update output pointer according to number of REs in this symbol (<<2 because 4 bits per RE)
if (first_symbol_flag == 1)
*llr32p = dlsch_llr + (len<<2);
else
*llr32p += (len<<2);
// printf("len=%d\n", len); // printf("len=%d\n", len);
len_mod4 = len&3; len_mod4 = len&3;
...@@ -786,47 +772,35 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -786,47 +772,35 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
int32_t **dl_ch_mag, int32_t *dl_ch_mag,
int32_t **dl_ch_magb, int32_t *dl_ch_magb,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
uint32_t llr_offset,
uint8_t beamforming_mode) uint8_t beamforming_mode)
{ {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*nb_rb*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag,*ch_magb; __m128i *ch_mag,*ch_magb;
#elif defined(__arm__) #elif defined(__arm__)
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*nb_rb*12)]; int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[(symbol*nb_rb*12)];
int16x8_t *ch_mag,*ch_magb,xmm1,xmm2; int16x8_t *ch_mag,*ch_magb,xmm1,xmm2;
#endif #endif
int i,len2; int i,len2;
unsigned char len_mod4; unsigned char len_mod4;
short *llr;
int16_t *llr2; int16_t *llr2;
int8_t *pllr_symbol;
/*
if (first_symbol_flag==1)
llr = dlsch_llr;
else
llr = *llr_save;
*/
llr = dlsch_llr;
pllr_symbol = (int8_t*)dlsch_llr; llr2 = dlsch_llr;
pllr_symbol += llr_offset;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (__m128i*)&dl_ch_magb[(symbol*nb_rb*12)];
#elif defined(__arm__) #elif defined(__arm__)
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (int16x8_t*)&dl_ch_mag[(symbol*nb_rb*12)];
ch_magb = (int16x8_t*)&dl_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (int16x8_t*)&dl_ch_magb[(symbol*nb_rb*12)];
#endif #endif
// printf("nr_dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); // printf("nr_dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
...@@ -838,9 +812,6 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -838,9 +812,6 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
dlsch_llr, dlsch_llr,
pllr_symbol);*/ pllr_symbol);*/
llr2 = llr;
llr += (len*6);
len_mod4 =len&3; len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs) len2=len>>2; // length in quad words (4 REs)
len2+=((len_mod4==0)?0:1); len2+=((len_mod4==0)?0:1);
...@@ -1095,43 +1066,29 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, ...@@ -1095,43 +1066,29 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
int32_t **dl_ch_mag, int32_t *dl_ch_mag,
int32_t **dl_ch_magb, int32_t *dl_ch_magb,
int32_t **dl_ch_magr, int32_t *dl_ch_magr,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
uint32_t llr_offset,
uint8_t beamforming_mode) uint8_t beamforming_mode)
{ {
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*nb_rb*12)]; __m128i *rxF = (__m128i*)&rxdataF_comp[(symbol*nb_rb*12)];
__m128i *ch_mag,*ch_magb,*ch_magr; __m128i *ch_mag,*ch_magb,*ch_magr;
int i,len2; int i,len2;
unsigned char len_mod4; unsigned char len_mod4;
short *llr;
int16_t *llr2; int16_t *llr2;
int8_t *pllr_symbol;
/*
if (first_symbol_flag==1)
llr = dlsch_llr;
else
llr = *llr_save;
*/
llr = dlsch_llr;
pllr_symbol = (int8_t*)dlsch_llr; llr2 = dlsch_llr;
pllr_symbol += llr_offset;
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (__m128i*)&dl_ch_mag[(symbol*nb_rb*12)];
ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (__m128i*)&dl_ch_magb[(symbol*nb_rb*12)];
ch_magr = (__m128i*)&dl_ch_magr[0][(symbol*nb_rb*12)]; ch_magr = (__m128i*)&dl_ch_magr[(symbol*nb_rb*12)];
llr2 = llr;
llr += (len*8);
len_mod4 =len&3; len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs) len2=len>>2; // length in quad words (4 REs)
......
...@@ -471,7 +471,7 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, ...@@ -471,7 +471,7 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
@param beamforming_mode beamforming mode @param beamforming_mode beamforming mode
*/ */
int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
...@@ -505,14 +505,13 @@ int32_t nr_dlsch_qpsk_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, ...@@ -505,14 +505,13 @@ int32_t nr_dlsch_qpsk_llr_SIC(NR_DL_FRAME_PARMS *frame_parms,
uint32_t rb_alloc); uint32_t rb_alloc);
void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
int32_t **dl_ch_mag, int32_t *dl_ch_mag,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
int16_t **llr32p,
uint8_t beamforming_mode); uint8_t beamforming_mode);
/** /**
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms \brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
...@@ -553,28 +552,26 @@ void dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, ...@@ -553,28 +552,26 @@ void dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms,
uint32_t rb_alloc); uint32_t rb_alloc);
void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
int32_t **dl_ch_mag, int32_t *dl_ch_mag,
int32_t **dl_ch_magb, int32_t *dl_ch_magb,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
uint32_t llr_offset,
uint8_t beamforming_mode); uint8_t beamforming_mode);
void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms, void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t *rxdataF_comp,
int16_t *dlsch_llr, int16_t *dlsch_llr,
int32_t **dl_ch_mag, int32_t *dl_ch_mag,
int32_t **dl_ch_magb, int32_t *dl_ch_magb,
int32_t **dl_ch_magr, int32_t *dl_ch_magr,
uint8_t symbol, uint8_t symbol,
uint32_t len, uint32_t len,
uint8_t first_symbol_flag, uint8_t first_symbol_flag,
uint16_t nb_rb, uint16_t nb_rb,
uint32_t llr_offset,
uint8_t beamforming_mode); uint8_t beamforming_mode);
/** \fn dlsch_siso(NR_DL_FRAME_PARMS *frame_parms, /** \fn dlsch_siso(NR_DL_FRAME_PARMS *frame_parms,
......
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