Commit 1bdf31c5 authored by knopp's avatar knopp

some more additions for TM3

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6264 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5c154c15
......@@ -880,7 +880,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
LTE_UE_PDCCH **ue_pdcch_vars = phy_vars_ue->lte_ue_pdcch_vars;
LTE_UE_PRACH **ue_prach_vars = phy_vars_ue->lte_ue_prach_vars;
int i,j;
int i,j,k;
unsigned char eNB_id;
msg("Initializing UE vars (abstraction %d) for eNB TXant %d, UE RXant %d\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);
......@@ -908,11 +908,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_common_vars->txdata[i] = (int *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
bzero(ue_common_vars->txdata[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
#else //USER_MODE
#ifdef IFFT_FPGA
ue_common_vars->txdata[i] = NULL;
#else //IFFT_FPGA
ue_common_vars->txdata[i] = TX_DMA_BUFFER[0][i];
#endif //IFFT_FPGA
#endif //USER_MODE
}
......@@ -922,12 +918,8 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
bzero(ue_common_vars->txdataF[i],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
#else //USER_MODE
#ifdef IFFT_FPGA
ue_common_vars->txdataF[i] = (mod_sym_t*) TX_DMA_BUFFER[0][i];
#else //IFFT_FPGA
ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
bzero(ue_common_vars->txdataF[i],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
#endif //IFFT_FPGA
#endif //USER_MODE
}
......@@ -1112,11 +1104,13 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_pdsch_vars[eNB_id]->rxdataF_ext[(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->N_RB_DL*12*14));
ue_pdsch_vars[eNB_id]->rxdataF_comp0 = (int **)malloc16(8*sizeof(int*));
ue_pdsch_vars[eNB_id]->rxdataF_comp1 = (int **)malloc16(8*sizeof(int*));
for (k=0;k<8;k++)
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k] = (int **)malloc16(8*sizeof(int*));
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4;j++){
ue_pdsch_vars[eNB_id]->rxdataF_comp0[(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->N_RB_DL*12*14));
ue_pdsch_vars[eNB_id]->rxdataF_comp1[(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->N_RB_DL*12*14));
for (k=0;k<8;k++)
ue_pdsch_vars[eNB_id]->rxdataF_comp1[(j<<1)+i][k] = (int *)malloc16(sizeof(int)*(frame_parms->N_RB_DL*12*14));
}
// printf("rxdataF_comp[0] %p\n",ue_pdsch_vars[eNB_id]->rxdataF_comp[0]);
......@@ -1601,11 +1595,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
eNB_common_vars->txdata[eNB_id][i] = (int *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
bzero(eNB_common_vars->txdata[eNB_id][i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
#else // USER_MODE
#ifdef IFFT_FPGA
eNB_common_vars->txdata[eNB_id][i] = NULL;
#else //IFFT_FPGA
eNB_common_vars->txdata[eNB_id][i] = TX_DMA_BUFFER[eNB_id][i];
#endif //IFFT_FPGA
#endif //USER_MODE
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,eNB_common_vars->txdata[eNB_id][i]);
......@@ -1629,12 +1619,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
bzero(eNB_common_vars->txdataF[eNB_id][i],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
#else //USER_MODE
#ifdef IFFT_FPGA
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)TX_DMA_BUFFER[eNB_id][i];
#else
eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16(FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
bzero(eNB_common_vars->txdataF[eNB_id][i],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
#endif //IFFT_FPGA
#endif //USER_MODE
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
......
......@@ -3611,10 +3611,11 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
if ((ndi!=dlsch0_harq->DCINdi)|| // DCI has been toggled or this is the first transmission
(dlsch0_harq->first_tx==1)) {
dlsch0_harq->round = 0;
if (dlsch0_harq->first_tx==1)
if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 1A DCI First TX: Clearing flag\n");
dlsch0_harq->first_tx = 0;
}
}
dlsch0_harq->DCINdi = ndi;
dlsch0_harq->mcs = mcs;
......@@ -3740,13 +3741,15 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
if ((ndi!=dlsch0_harq->DCINdi)||
(dlsch0_harq->first_tx==1)) {
// printf("Rate: setting round to zero (ndi %d, DCINdi %d,first_tx %d)\n",ndi,dlsch0_harq->DCINdi,dlsch0_harq->first_tx);
dlsch0_harq->round=0;
dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi;
if (dlsch0_harq->first_tx==1)
if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n");
dlsch0_harq->first_tx = 0;
}
}
else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process,
// this happens if either another harq process in the same
// is NAK or an ACK was not received
......@@ -4449,11 +4452,14 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
if (dlsch0->active == 1) {
if ((ndi1!=dlsch0_harq->DCINdi)||
(dlsch0_harq->first_tx==1)) {
// printf("Rate: setting round to zero (ndi %d, DCINdi %d,first_tx %d)\n",ndi,dlsch0_harq->DCINdi,dlsch0_harq->first_tx);
dlsch0_harq->round=0;
dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi1;
if (dlsch0_harq->first_tx==1)
if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 2A DCI First TX0: Clearing flag\n");
dlsch0_harq->first_tx = 0;
}
}
else if (dlsch0_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process,
// this happens if either another harq process in the same
......@@ -4474,8 +4480,11 @@ int generate_ue_dlsch_params_from_dci(uint8_t subframe,
dlsch1_harq->status = ACTIVE;
dlsch1_harq->DCINdi = ndi2;
if (dlsch1_harq->first_tx==1)
if (dlsch1_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 2A DCI First TX1: Clearing flag\n",rnti,harq_pid);
dlsch1_harq->first_tx = 0;
}
}
else if (dlsch1_harq->status == SCH_IDLE) { // we got an Ndi = 0 for a previously decoded process,
// this happens if either another harq process in the same
......@@ -5498,7 +5507,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
ulsch->harq_processes[harq_pid]->first_rb = RIV2first_rb_LUT100[rballoc];
ulsch->harq_processes[harq_pid]->nb_rb = RIV2nb_rb_LUT100[rballoc];
printf("rb_alloc (20 MHz dci) %d\n",rballoc);
// printf("rb_alloc (20 MHz dci) %d\n",rballoc);
break;
default:
......
......@@ -291,13 +291,15 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
(r==0) ? harq_process->F : 0);
#ifdef DEBUG_DLSCH_DECODING
msg("HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d)...\n",
msg("HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,
Kr*3,
harq_process->TBS,
get_Qm(harq_process->mcs),
harq_process->nb_rb,
harq_process->Nl);
harq_process->Nl,
harq_process->rvidx,
harq_process->round);
#endif
......@@ -410,7 +412,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
dlsch->harq_ack[subframe].harq_id = harq_pid;
dlsch->harq_ack[subframe].send_harq_status = 1;
harq_process->round++;
LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
// LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
// printf("Rate: [UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
if (harq_process->round >= dlsch->Mdlharq) {
harq_process->status = SCH_IDLE;
}
......
......@@ -395,6 +395,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
symbol,
get_Qm(dlsch0_harq->mcs),
get_Qm(dlsch1_harq->mcs),
dlsch0_harq->round,
nb_rb,
lte_ue_pdsch_vars[eNB_id]->log2_maxh);
// compute correlation between signal and interference channels
......@@ -524,7 +525,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
if (frame_parms->nb_antennas_tx_eNB == 2) {
dlsch_detection_mrc(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext,
lte_ue_pdsch_vars[eNB_id]->rho,
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0,
......@@ -640,7 +641,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
*/
dlsch_qpsk_qpsk_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext,
lte_ue_pdsch_vars[eNB_id]->llr[0],
symbol,first_symbol_flag,nb_rb,
......@@ -650,7 +651,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
else if (get_Qm(dlsch1_harq->mcs) == 4) {
dlsch_qpsk_16qam_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag1,
lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext,
lte_ue_pdsch_vars[eNB_id]->llr[0],
......@@ -661,7 +662,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
else {
dlsch_qpsk_64qam_llr(frame_parms,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1,
lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[dlsch0_harq->round],
lte_ue_pdsch_vars[eNB_id]->dl_ch_mag1,
lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext,
lte_ue_pdsch_vars[eNB_id]->llr[0],
......@@ -1368,6 +1369,7 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char symbol,
unsigned char mod_order0,
unsigned char mod_order1,
int round,
unsigned short nb_rb,
unsigned char output_shift) {
......@@ -1383,7 +1385,7 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
int **dl_ch_magb0 = lte_ue_pdsch_vars->dl_ch_magb0;
int **dl_ch_magb1 = lte_ue_pdsch_vars->dl_ch_magb1;
int **rxdataF_comp0 = lte_ue_pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 = lte_ue_pdsch_vars->rxdataF_comp1;
int **rxdataF_comp1 = lte_ue_pdsch_vars->rxdataF_comp1[0];
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128,QAM_amp0_128b,QAM_amp1_128,QAM_amp1_128b;
......@@ -3350,35 +3352,35 @@ unsigned short dlsch_extract_rbs_dual(int **rxdataF,
#ifdef USER_MODE
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword) {
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round) {
unsigned int nsymb = (phy_vars_ue->lte_frame_parms.Ncp == 0) ? 14 : 12;
char fname[32],vname[32];
int N_RB_DL=phy_vars_ue->lte_frame_parms.N_RB_DL;
sprintf(fname,"dlsch%d_rxF_ext0.m",eNB_id);
sprintf(vname,"dl%d_rxF_ext0",eNB_id);
sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
if (phy_vars_ue->lte_frame_parms.nb_antennas_rx >1) {
sprintf(fname,"dlsch%d_rxF_ext1.m",eNB_id);
sprintf(vname,"dl%d_rxF_ext1",eNB_id);
sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
}
sprintf(fname,"dlsch%d_ch_ext00.m",eNB_id);
sprintf(vname,"dl%d_ch_ext00",eNB_id);
sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
if (phy_vars_ue->lte_frame_parms.nb_antennas_rx == 2) {
sprintf(fname,"dlsch%d_ch_ext01.m",eNB_id);
sprintf(vname,"dl%d_ch_ext01",eNB_id);
sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
}
if (phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB == 2) {
sprintf(fname,"dlsch%d_ch_ext10.m",eNB_id);
sprintf(vname,"dl%d_ch_ext10",eNB_id);
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
if (phy_vars_ue->lte_frame_parms.nb_antennas_rx == 2) {
sprintf(fname,"dlsch%d_ch_ext11.m",eNB_id);
sprintf(vname,"dl%d_ch_ext11",eNB_id);
sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round);
sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
}
}
......@@ -3387,31 +3389,31 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per
write_output("dlsch%d_ch_ext10.m","dl10_ch0_ext",lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
write_output("dlsch%d_ch_ext11.m","dl11_ch0_ext",lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
*/
sprintf(fname,"dlsch%d_rho.m",eNB_id);
sprintf(vname,"dl_rho%d",eNB_id);
sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round);
sprintf(vname,"dl_rho_r%d_%d",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[0],12*N_RB_DL*nsymb,1,1);
sprintf(fname,"dlsch%d_rxF_comp0.m",eNB_id);
sprintf(vname,"dl%d_rxF_comp0",eNB_id);
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
if (phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB == 2) {
sprintf(fname,"dlsch%d_rxF_comp1.m",eNB_id);
sprintf(vname,"dl%d_rxF_comp1",eNB_id);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[0],12*N_RB_DL*nsymb,1,1);
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[0][round],12*N_RB_DL*nsymb,1,1);
}
sprintf(fname,"dlsch%d_rxF_llr.m",eNB_id);
sprintf(vname,"dl%d_llr",eNB_id);
sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round);
sprintf(vname,"dl%d_r%d_llr",eNB_id,round);
write_output(fname,vname, phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->llr[0],coded_bits_per_codeword,1,0);
sprintf(fname,"dlsch%d_mag1.m",eNB_id);
sprintf(vname,"dl%d_mag1",eNB_id);
sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round);
sprintf(vname,"dl%d_r%d_mag1",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
sprintf(fname,"dlsch%d_mag2.m",eNB_id);
sprintf(vname,"dl%d_mag2",eNB_id);
sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round);
sprintf(vname,"dl%d_r%d_mag2",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
printf("log2_maxh = %d\n",phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->log2_maxh);
// printf("log2_maxh = %d\n",phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->log2_maxh);
}
#endif
......
......@@ -545,8 +545,8 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
qam64_table_offset_im0+=1;
*jj=*jj+1;
xx0_re = qam_table_s0[qam16_table_offset_re0];
xx0_im = qam_table_s0[qam16_table_offset_im0];
xx0_re = qam_table_s0[qam64_table_offset_re0];
xx0_im = qam_table_s0[qam64_table_offset_im0];
break;
......@@ -594,7 +594,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
qam64_table_offset_im1 = 0;
if (x1[*jj2] == 1)
qam64_table_offset_re0+=4;
qam64_table_offset_re1+=4;
*jj2 = *jj2 + 1;
if (x1[*jj2] == 1)
qam64_table_offset_im1+=4;
......@@ -612,8 +612,8 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
qam64_table_offset_im1+=1;
*jj2 = *jj2 + 1;
xx1_re = qam_table_s1[qam16_table_offset_re1];
xx1_im = qam_table_s1[qam16_table_offset_im1];
xx1_re = qam_table_s1[qam64_table_offset_re1];
xx1_im = qam_table_s1[qam64_table_offset_im1];
break;
......@@ -1054,7 +1054,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
qam16_table_a1[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_a)>>15);
qam16_table_b1[i] = (int16_t)(((int32_t)qam16_table[i]*amp_rho_b)>>15);
}
else if (mod_order0 == 6)
else if (mod_order1 == 6)
for (i=0;i<8;i++) {
qam64_table_a1[i] = (int16_t)(((int32_t)qam64_table[i]*amp_rho_a)>>15);
qam64_table_b1[i] = (int16_t)(((int32_t)qam64_table[i]*amp_rho_b)>>15);
......
......@@ -963,6 +963,7 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char symbol,
unsigned char mod_order0,
unsigned char mod_order1,
int round,
unsigned short nb_rb,
unsigned char output_shift);
......@@ -1406,7 +1407,7 @@ void dump_dlsch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint8_t
void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch_ra(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe);
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword);
void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_codeword,int round);
#endif
int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci);
......
This diff is collapsed.
......@@ -412,6 +412,9 @@ typedef struct
LTE_UE_DLSCH_t *ulsch_ue_col[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_ue_SI[NUMBER_OF_CONNECTED_eNB_MAX],*dlsch_ue_ra[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_ue_MCH[NUMBER_OF_CONNECTED_eNB_MAX];
// This is for SIC in the UE, to store the reencoded data
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX];
// For abstraction-purposes only
uint8_t sr[10];
uint8_t pucch_sel[10];
......@@ -555,6 +558,9 @@ typedef struct
time_stats_t dlsch_deinterleaving_stats;
time_stats_t dlsch_llr_stats;
time_stats_t dlsch_unscrambling_stats;
time_stats_t dlsch_rate_matching_stats;
time_stats_t dlsch_turbo_encoding_stats;
time_stats_t dlsch_interleaving_stats;
time_stats_t dlsch_tc_init_stats;
time_stats_t dlsch_tc_alpha_stats;
time_stats_t dlsch_tc_beta_stats;
......
......@@ -638,7 +638,7 @@ typedef struct {
/// Received frequency-domain signal after extraction and channel compensation
int32_t **rxdataF_comp0;
/// Received frequency-domain signal after extraction and channel compensation
int32_t **rxdataF_comp1;
int32_t **rxdataF_comp1[8];
/// Downlink channel estimates extracted in PRBS
int32_t **dl_ch_estimates_ext;
/// Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS
......
......@@ -270,6 +270,7 @@ int main(int argc, char **argv) {
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]={0,0,0,0},round_trials[4]={0,0,0,0},dci_errors=0,dlsch_active=0,num_layers;
int re_allocated;
char fname[32],vname[32];
FILE *bler_fd;
char bler_fname[256];
FILE *time_meas_fd;
......@@ -344,6 +345,11 @@ int main(int argc, char **argv) {
int TB0_active = 1;
LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
opp_enabled=1; // to enable the time meas
cpu_freq_GHz = (double)get_cpu_freq_GHz();
......@@ -890,6 +896,8 @@ int main(int argc, char **argv) {
PHY_vars_eNB->dlsch_eNB[k][i]->rnti = n_rnti+k;
}
}
// structure for SIC at UE
PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(1,8,N_RB_DL,0);
for (i=0;i<2;i++) {
PHY_vars_UE->dlsch_ue[0][i] = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
......@@ -1970,7 +1978,7 @@ int main(int argc, char **argv) {
hold_channel = 1;
}
else
hold_channel = 0;
hold_channel = 0;//(round==0) ? 0 : 1;
PMI_FEEDBACK:
......@@ -2810,7 +2818,7 @@ int main(int argc, char **argv) {
for (i=0;i<dci_cnt;i++) {
// printf("Generating dlsch parameters for RNTI %x\n",dci_alloc_rx[i].rnti);
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->first_tx=1;
if (round == 0) PHY_vars_UE->dlsch_ue[0][0]->harq_processes[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid]->first_tx=1;
if ((dci_alloc_rx[i].rnti == n_rnti) &&
(generate_ue_dlsch_params_from_dci(0,
dci_alloc_rx[i].dci_pdu,
......@@ -2860,7 +2868,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = n_rnti;
PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->first_tx=1;
if (round == 0) PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->first_tx=1;
switch (transmission_mode) {
case 1:
case 2:
......@@ -2876,7 +2884,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
P_RNTI);
break;
case 3:
PHY_vars_UE->dlsch_ue[0][1]->harq_processes[0]->first_tx=1;
// printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round,PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->first_tx);
generate_ue_dlsch_params_from_dci(0,
&DLSCH_alloc_pdu_1[0],
(common_flag==0)? C_RNTI : SI_RNTI,
......@@ -2887,6 +2895,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
SI_RNTI,
0,
P_RNTI);
// printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round,PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->first_tx);
break;
case 4:
generate_ue_dlsch_params_from_dci(0,
......@@ -3018,24 +3027,24 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
write_output("rxsigF1.m","rxsF1", PHY_vars_UE->lte_ue_common_vars.rxdataF[1],PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
}
write_output("dlsch00_ch0.m","dl00_ch0",
write_output("dlsch00_r0.m","dl00_r0",
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1)
write_output("dlsch01_ch0.m","dl01_ch0",
write_output("dlsch01_r0.m","dl01_r0",
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
write_output("dlsch10_ch0.m","dl10_ch0",
write_output("dlsch10_r0.m","dl10_r0",
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1))
write_output("dlsch11_ch0.m","dl11_ch0",
write_output("dlsch11_r0.m","dl11_r0",
&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]),
PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
//pdsch_vars
dump_dlsch2(PHY_vars_UE,eNB_id,coded_bits_per_codeword);
dump_dlsch2(PHY_vars_UE,eNB_id,coded_bits_per_codeword,round);
//dump_dlsch2(PHY_vars_UE,eNB_id_i,coded_bits_per_codeword);
write_output("dlsch_e.m","e",PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
......@@ -3120,10 +3129,40 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
avg_iter += ret;
iter_trials++;
if (n_frames==1)
printf("No DLSCH errors found,uncoded ber %f\n",uncoded_ber);
printf("No DLSCH errors found (round %d),uncoded ber %f\n",round,uncoded_ber);
PHY_vars_UE->total_TBS[eNB_id] = PHY_vars_UE->total_TBS[eNB_id] + PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS;
TB0_active = 0;
if (PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->mimo_mode = LARGE_CDD) { //try to decode second stream
for (round = 0 ; round < PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->round ; round++) {
dlsch0_ue_harq = PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid];
dlsch0_eNB_harq = PHY_vars_UE->dlsch_eNB[eNB_id]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid];
dlsch0_eNB_harq->mimo_mode = LARGE_CDD;
dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc[0];
dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb;
dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs;
dlsch0_eNB_harq->rvidx = dlsch0_ue_harq->rvidx;
dlsch0_eNB_harq->Nl = dlsch0_ue_harq->Nl;
dlsch0_eNB_harq->TBS = dlsch0_ue_harq->TBS;
dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off;
dlsch0_eNB_harq->status = dlsch0_ue_harq->status;
PHY_vars_UE->dlsch_eNB[eNB_id]->active = PHY_vars_UE->dlsch_ue[eNB_id][0]->active;
PHY_vars_UE->dlsch_eNB[eNB_id]->rnti = PHY_vars_UE->dlsch_ue[eNB_id][0]->rnti;
dlsch_encoding(PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
&PHY_vars_UE->lte_frame_parms,
num_pdcch_symbols,
PHY_vars_UE->dlsch_eNB[0],
0,subframe,
&PHY_vars_UE->dlsch_rate_matching_stats,
&PHY_vars_UE->dlsch_turbo_encoding_stats,
&PHY_vars_UE->dlsch_interleaving_stats
);
}
}
}
else {
errs[round]++;
......@@ -3133,7 +3172,7 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
if (n_frames==1) {
//if ((n_frames==1) || (SNR>=30)) {
printf("DLSCH errors found, uncoded ber %f\n",uncoded_ber);
printf("DLSCH errors found (round %d), uncoded ber %f\n",round,uncoded_ber);
for (s=0;s<PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->C;s++) {
if (s<PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->Cminus)
Kr = PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->Kminus;
......@@ -3146,43 +3185,61 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols,
for (i=0;i<Kr_bytes;i++)
printf("%d : %x (%x)\n",i,PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->c[s][i],PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->c[s][i]^PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->c[s][i]);
}
write_output("rxsig0.m","rxs0", &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
write_output("rxsigF0.m","rxsF0", &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
sprintf(fname,"rxsig0_r%d.m",round);
sprintf(vname,"rxs0_r%d.m",round);
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
sprintf(fname,"rxsigF0_r%d.m",round);
sprintf(vname,"rxs0F_r%d.m",round);
write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
write_output("rxsig1.m","rxs1", PHY_vars_UE->lte_ue_common_vars.rxdata[1],PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
write_output("rxsigF1.m","rxsF1", PHY_vars_UE->lte_ue_common_vars.rxdataF[1],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
}
write_output("dlsch00_ch0.m","dl00_ch0",
sprintf(fname,"rxsig1_r%d.m",round);
sprintf(vname,"rxs1_r%d.m",round);
write_output(fname,vname, PHY_vars_UE->lte_ue_common_vars.rxdata[1],PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
sprintf(fname,"rxsig1F_r%d.m",round);