Commit 42e9c655 authored by Parminder Singh's avatar Parminder Singh

Moved LLR calculations inside a static function

- LLR calculations are moved inside a static function and done for a
  slot in last symbol processing
parent cf3780c0
......@@ -99,6 +99,29 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw,
uint16_t length,
int16_t **llr_layers);
/* compute LLR */
static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp_ptr,
int32_t **dl_ch_mag_ptr,
NR_DL_UE_HARQ_t *dlsch0_harq,
NR_DL_UE_HARQ_t *dlsch1_harq,
RX_type_t rx_type,
unsigned char harq_pid,
unsigned char eNB_id,
unsigned char eNB_id_i,
unsigned char first_symbol_flag,
unsigned char symbol,
unsigned short nb_rb,
unsigned short round,
int32_t codeword_TB0,
int32_t codeword_TB1,
uint32_t len,
uint8_t nr_tti_rx,
uint8_t beamforming_mode);
/* Main Function */
int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
PDSCH_t type,
unsigned char eNB_id,
......@@ -117,7 +140,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
PHY_NR_MEASUREMENTS *measurements = &ue->measurements;
NR_UE_DLSCH_t **dlsch;
uint16_t startSymbIdx=0;
uint16_t nbSymb=0;
int avg[4];
// int avg_0[2];
// int avg_1[2];
......@@ -142,13 +167,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//to be updated higher layer
unsigned short start_rb = 0;
unsigned short nb_rb_pdsch = 50;
int16_t *pllr_symbol_cw0;
int16_t *pllr_symbol_cw1;
int16_t *pllr_symbol_layer0;
int16_t *pllr_symbol_layer1;
//int16_t *pllr_symbol_cw0_deint;
//int16_t *pllr_symbol_cw1_deint;
uint32_t llr_offset_symbol;
//uint16_t bundle_L = 2;
uint8_t pilots=0;
uint16_t n_tx=1, n_rx=1;
......@@ -666,371 +686,75 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
start_meas(&ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot]);
#endif
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
// compute LLRs
// -> // compute @pointer where llrs should filled for this ofdm-symbol
if (first_symbol_flag==1) pdsch_vars[eNB_id]->llr_offset[symbol-1] = 0;
llr_offset_symbol = pdsch_vars[eNB_id]->llr_offset[symbol-1];
//pllr_symbol_cw0_deint = (int8_t*)pdsch_vars[eNB_id]->llr[0];
//pllr_symbol_cw1_deint = (int8_t*)pdsch_vars[eNB_id]->llr[1];
pllr_symbol_layer0 = pdsch_vars[eNB_id]->layer_llr[0];
pllr_symbol_layer1 = pdsch_vars[eNB_id]->layer_llr[1];
pllr_symbol_layer0 += llr_offset_symbol;
pllr_symbol_layer1 += llr_offset_symbol;
pllr_symbol_cw0 = pdsch_vars[eNB_id]->llr[0];
pllr_symbol_cw1 = pdsch_vars[eNB_id]->llr[1];
pllr_symbol_cw0 += llr_offset_symbol;
pllr_symbol_cw1 += llr_offset_symbol;
pdsch_vars[eNB_id]->llr_offset[symbol] = len*dlsch0_harq->Qm + llr_offset_symbol;
/*LOG_I(PHY,"compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
symbol,
nb_rb,dlsch0_harq->Qm,
pdsch_vars[eNB_id]->llr_length[symbol],
pdsch_vars[eNB_id]->llr_offset[symbol],
(int16_t*)pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0);*/
/*printf("compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %p @LLR Buff(symb) %p\n",
symbol,
nb_rb,dlsch0_harq->Qm,
pdsch_vars[eNB_id]->llr_length[symbol],
pdsch_vars[eNB_id]->llr_offset[symbol],
pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0);*/
/* Store the valid DL RE's */
pdsch_vars[eNB_id]->dl_valid_re[symbol-1] = len;
switch (dlsch0_harq->Qm) {
case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw0,
symbol,
len,
first_symbol_flag,
nb_rb,
beamforming_mode);
} else if (codeword_TB0 == -1){
nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
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[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_qpsk_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_qpsk_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
if(dlsch0_harq->status == ACTIVE)
{
startSymbIdx = dlsch0_harq->start_symbol;
nbSymb = dlsch0_harq->nb_symbols;
}
break;
case 4 :
if ((rx_type==rx_standard ) || (codeword_TB1 == -1)) {
nr_dlsch_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
pdsch_vars[eNB_id]->dl_ch_mag0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
} else if (codeword_TB0 == -1){
nr_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,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr128_2ndstream,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
nr_dlsch_16qam_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
if(dlsch1_harq)
{
startSymbIdx = dlsch1_harq->start_symbol;
nbSymb = dlsch1_harq->nb_symbols;
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_16qam_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
// compute LLRs
// -> // compute @pointer where llrs should filled for this ofdm-symbol
if(symbol == (startSymbIdx + nbSymb -1))
{
for(uint8_t i =startSymbIdx; i <= nbSymb;i++)
{
/* re evaluating the first symbol flag as LLR's are done in symbol loop */
if(i == startSymbIdx && i < 3)
{
first_symbol_flag =1;
}
}
else {
nr_dlsch_16qam_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
else
{
first_symbol_flag=0;
}
/* Calculate LLR's for ech symbol */
nr_dlsch_llr(pdsch_vars,
frame_parms,
rxdataF_comp_ptr,
dl_ch_mag_ptr,
dlsch0_harq,
dlsch1_harq,
rx_type,
harq_pid,
eNB_id,
eNB_id_i,
first_symbol_flag,
i,
nb_rb,
round,
codeword_TB0,
codeword_TB1,
pdsch_vars[eNB_id]->dl_valid_re[i-1],
nr_tti_rx,
beamforming_mode);
}
}
break;
case 6 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
(int16_t*)pllr_symbol_cw0,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
} else if (codeword_TB0 == -1){
nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw1,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
nr_dlsch_64qam_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
//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) {
nr_dlsch_layer_demapping(pdsch_vars[eNB_id]->llr,
dlsch[0]->harq_processes[harq_pid]->Nl,
dlsch[0]->harq_processes[harq_pid]->Qm,
dlsch[0]->harq_processes[harq_pid]->G,
pdsch_vars[eNB_id]->layer_llr);
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_64qam_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_64qam_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_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_tti_rx,symbol),
pdsch_vars[eNB_id]->llr_offset[symbol]);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_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_tti_rx,symbol),
pdsch_vars[eNB_id]->llr_offset[symbol]);
}
}
}
break;
default:
LOG_W(PHY,"rx_dlsch.c : Unknown mod_order!!!!\n");
return(-1);
break;
}
if (dlsch1_harq) {
switch (nr_get_Qm_dl(dlsch1_harq->mcs,dlsch1_harq->mcs_table)) {
case 2 :
if (rx_type==rx_standard) {
nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw0,
symbol,len,first_symbol_flag,nb_rb,
beamforming_mode);
}
break;
case 4:
if (rx_type==rx_standard) {
nr_dlsch_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
pdsch_vars[eNB_id]->dl_ch_mag0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
}
break;
case 6 :
if (rx_type==rx_standard) {
nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw0,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
}
break;
default:
LOG_W(PHY,"rx_dlsch.c : Unknown mod_order!!!!\n");
return(-1);
break;
}
}
//nr_dlsch_deinterleaving(symbol,bundle_L,(int16_t*)pllr_symbol_cw0,(int16_t*)pllr_symbol_cw0_deint, nb_rb_pdsch);
//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) {
nr_dlsch_layer_demapping(pdsch_vars[eNB_id]->llr,
dlsch[0]->harq_processes[harq_pid]->Nl,
dlsch[0]->harq_processes[harq_pid]->Qm,
dlsch[0]->harq_processes[harq_pid]->G,
pdsch_vars[eNB_id]->layer_llr);
}
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_layer_demapping(pdsch_vars[eNB_id]->llr,
dlsch[0]->harq_processes[harq_pid]->Nl,
dlsch[0]->harq_processes[harq_pid]->Qm,
dlsch[0]->harq_processes[harq_pid]->G,
pdsch_vars[eNB_id]->layer_llr);
}
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot]);
......@@ -2561,6 +2285,387 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw,
AssertFatal(0, "Not supported number of layers %d\n", Nl);
}
}
static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars,
NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp_ptr,
int32_t **dl_ch_mag_ptr,
NR_DL_UE_HARQ_t *dlsch0_harq,
NR_DL_UE_HARQ_t *dlsch1_harq,
RX_type_t rx_type,
unsigned char harq_pid,
unsigned char eNB_id,
unsigned char eNB_id_i,
unsigned char first_symbol_flag,
unsigned char symbol,
unsigned short nb_rb,
unsigned short round,
int32_t codeword_TB0,
int32_t codeword_TB1,
uint32_t len,
uint8_t nr_tti_rx,
uint8_t beamforming_mode)
{
int16_t *pllr_symbol_cw0;
int16_t *pllr_symbol_cw1;
int16_t *pllr_symbol_layer0;
int16_t *pllr_symbol_layer1;
uint32_t llr_offset_symbol;
if (first_symbol_flag==1) pdsch_vars[eNB_id]->llr_offset[symbol-1] = 0;
llr_offset_symbol = pdsch_vars[eNB_id]->llr_offset[symbol-1];
//pllr_symbol_cw0_deint = (int8_t*)pdsch_vars[eNB_id]->llr[0];
//pllr_symbol_cw1_deint = (int8_t*)pdsch_vars[eNB_id]->llr[1];
pllr_symbol_layer0 = pdsch_vars[eNB_id]->layer_llr[0];
pllr_symbol_layer1 = pdsch_vars[eNB_id]->layer_llr[1];
pllr_symbol_layer0 += llr_offset_symbol;
pllr_symbol_layer1 += llr_offset_symbol;
pllr_symbol_cw0 = pdsch_vars[eNB_id]->llr[0];
pllr_symbol_cw1 = pdsch_vars[eNB_id]->llr[1];
pllr_symbol_cw0 += llr_offset_symbol;
pllr_symbol_cw1 += llr_offset_symbol;
pdsch_vars[eNB_id]->llr_offset[symbol] = len*dlsch0_harq->Qm + llr_offset_symbol;
/*LOG_I(PHY,"compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
symbol,
nb_rb,dlsch0_harq->Qm,
pdsch_vars[eNB_id]->llr_length[symbol],
pdsch_vars[eNB_id]->llr_offset[symbol],
(int16_t*)pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0);*/
/*printf("compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %p @LLR Buff(symb) %p\n",
symbol,
nb_rb,dlsch0_harq->Qm,
pdsch_vars[eNB_id]->llr_length[symbol],
pdsch_vars[eNB_id]->llr_offset[symbol],
pdsch_vars[eNB_id]->llr[0],
pllr_symbol_cw0);*/
switch (dlsch0_harq->Qm) {
case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw0,
symbol,
len,
first_symbol_flag,
nb_rb,
beamforming_mode);
} else if (codeword_TB0 == -1){
nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
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[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_qpsk_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_qpsk_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_qpsk_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
}
break;
case 4 :
if ((rx_type==rx_standard ) || (codeword_TB1 == -1)) {
nr_dlsch_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
pdsch_vars[eNB_id]->dl_ch_mag0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
} else if (codeword_TB0 == -1){
nr_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,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr128_2ndstream,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
nr_dlsch_16qam_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_16qam_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,len,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_16qam_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_16qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
}
break;
case 6 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
(int16_t*)pllr_symbol_cw0,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
} else if (codeword_TB0 == -1){
nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw1,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
if (dlsch1_harq->Qm == 2) {
nr_dlsch_64qam_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_qpsk_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else if (dlsch1_harq->Qm == 4) {
nr_dlsch_64qam_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->layer_llr[0],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_16qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->layer_llr[1],
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,nr_tti_rx,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
}
}
else {
nr_dlsch_64qam_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
rxdataF_comp_ptr,//i
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_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_tti_rx,symbol),
pdsch_vars[eNB_id]->llr_offset[symbol]);
if (rx_type==rx_IC_dual_stream) {
nr_dlsch_64qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
pdsch_vars[eNB_id]->rxdataF_comp0,//i
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_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_tti_rx,symbol),
pdsch_vars[eNB_id]->llr_offset[symbol]);
}
}
}
break;
default:
LOG_W(PHY,"rx_dlsch.c : Unknown mod_order!!!!\n");
return(-1);
break;
}
if (dlsch1_harq) {
switch (nr_get_Qm_dl(dlsch1_harq->mcs,dlsch1_harq->mcs_table)) {
case 2 :
if (rx_type==rx_standard) {
nr_dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw0,
symbol,len,first_symbol_flag,nb_rb,
beamforming_mode);
}
break;
case 4:
if (rx_type==rx_standard) {
nr_dlsch_16qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
pdsch_vars[eNB_id]->dl_ch_mag0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
}
break;
case 6 :
if (rx_type==rx_standard) {
nr_dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pllr_symbol_cw0,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,len,first_symbol_flag,nb_rb,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
}
break;
default:
LOG_W(PHY,"rx_dlsch.c : Unknown mod_order!!!!\n");
return(-1);
break;
}
}
return 0;
}
//==============================================================================================
#ifdef USER_MODE
......
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