Commit 13483270 authored by Raymond Knopp's avatar Raymond Knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5950 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e67c9df2
......@@ -934,7 +934,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
#ifndef USER_MODE
ue_common_vars->rxdata[i] = (int*) RX_DMA_BUFFER[0][i];
#else //USER_MODE
ue_common_vars->rxdata[i] = (int*) malloc16(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
ue_common_vars->rxdata[i] = (int*) malloc16((FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int));
#endif //USER_MODE
if (ue_common_vars->rxdata[i]) {
#ifdef DEBUG_PHY
......@@ -1016,7 +1016,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) {
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates[eNB_id][(j<<1) + i] = (int *)malloc16(frame_parms->symbols_per_tti*sizeof(int)*(frame_parms->ofdm_symbol_size)+LTE_CE_FILTER_LENGTH);
if (ue_common_vars->dl_ch_estimates[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
......@@ -1048,7 +1048,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) {//frame_parms->nb_antennas_tx; j++) {
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->ofdm_symbol_size)*2);
if (ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
......
......@@ -182,11 +182,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++) {
pil = (short *)&pilot[p][0];
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+phy_vars_ue->lte_frame_parms.first_carrier_offset)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+phy_vars_ue->lte_frame_parms.first_carrier_offset))];
#endif
dl_ch = (short *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
// if (eNb_id==0)
......@@ -206,11 +202,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -221,11 +213,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=2;pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1);pilot_cnt+=2) {
......@@ -246,11 +234,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // 6 samples in replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
// printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
......@@ -265,11 +249,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -279,11 +259,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
k = (nu + nushift)%6;
if (k > 6)
k -=6;
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k))];
#endif
for (pilot_cnt=0;pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3);pilot_cnt+=2) {
// printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
// printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
......@@ -298,11 +275,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -314,11 +287,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -331,11 +300,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -368,11 +333,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -390,11 +351,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=2;pilot_cnt<24;pilot_cnt+=2) {
......@@ -418,11 +375,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -439,11 +392,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -467,11 +416,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// printf("Second half\n");
// Second half of RBs
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k))];
#endif
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
#ifdef DEBUG_CH
......@@ -486,11 +432,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=0;pilot_cnt<22;pilot_cnt+=2) {
......@@ -512,11 +454,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -533,11 +471,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -558,11 +492,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif// remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -601,12 +531,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
// remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -617,11 +542,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -638,11 +559,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
//printf("Second half\n");
//Second half of RBs
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p))<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p)))];
#endif
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
......@@ -651,11 +568,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (rb=0;rb<28;rb+=4) {
......@@ -673,11 +586,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -688,11 +597,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -795,10 +700,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
break;
}
// do ifft of channel estimate
for (aa=0;aa<phy_vars_ue->lte_frame_parms.nb_antennas_rx*phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB;aa++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],1);
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++)
for (p=0;p<phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB;p++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
}
return(0);
}
......
......@@ -302,36 +302,32 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
__m128i *dl_ch0_128,*dl_ch1_128;
int *dl_ch0,*dl_ch1;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
phy_vars_ue->PHY_measurements.nb_antennas_rx = frame_parms->nb_antennas_rx;
gain_offset = 0;
#ifndef __SSE3__
zeroPMI = _mm_xor_si128(zeroPMI,zeroPMI);
#endif
if (phy_vars_ue->init_averaging == 1) {
for (eNB_id=0;eNB_id<phy_vars_ue->n_connected_eNB;eNB_id++) {
phy_vars_ue->PHY_measurements.rx_power_avg[eNB_id] = 0;
}
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phy_vars_ue->PHY_measurements.n0_power[aarx] = 0;
phy_vars_ue->PHY_measurements.n0_power_dB[aarx] = 0;
}
phy_vars_ue->PHY_measurements.n0_power_tot = 0;
phy_vars_ue->PHY_measurements.n0_power_tot_dB = 0;
phy_vars_ue->PHY_measurements.n0_power_avg = 0;
phy_vars_ue->PHY_measurements.n0_power_avg_dB = 0;
int nb_subbands,subband_size,last_subband_size;
int N_RB_DL = frame_parms->N_RB_DL;
switch (N_RB_DL) {
case 6:
nb_subbands = 6;
subband_size = 12;
last_subband_size = 0;
break;
default:
case 25:
nb_subbands = 7;
subband_size = 4*12;
last_subband_size = 12;
break;
case 50:
nb_subbands = 9;
subband_size = 6*12;
last_subband_size = 2*12;
break;
case 100:
nb_subbands = 13;
subband_size = 8*12;
last_subband_size = 4*12;
break;
}
// noise measurements
// for abstraction we do noise measurements based on the precalculated phy_vars_ue->N0
// otherwise if there is a symbol where we can take noise measurements on, we measure there
// otherwise do not update the noise measurements
if (abstraction_flag!=0) {
phy_vars_ue->PHY_measurements.n0_power_tot = 0;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......@@ -368,7 +364,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx] =
(signal_energy_nodc(&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
(frame_parms->N_RB_DL*12)));
(N_RB_DL*12)));
//- phy_vars_ue->PHY_measurements.n0_power[aarx];
if (phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx]<0)
......@@ -432,19 +428,18 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
dl_ch0 = &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4];
dl_ch1 = &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
// cqi
if (aarx==0)
phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband]=0;
if (subband<6) {
/*
for (i=0;i<48;i++)
if ((subband<(nb_subbands-1))||(N_RB_DL==6)) {
/*for (i=0;i<48;i++)
msg("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
*/
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] =
(signal_energy_nodc(dl_ch0,48) + signal_energy_nodc(dl_ch1,48));
(signal_energy_nodc(dl_ch0,subband_size) + signal_energy_nodc(dl_ch1,subband_size));
if ( phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] < 0)
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband]=0;
/*
......@@ -456,21 +451,22 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],
phy_vars_ue->PHY_measurements.n0_power[aarx]);
}
else {
else { // this is for the last subband which is smaller in size
// for (i=0;i<12;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,12) + signal_energy_nodc(dl_ch1,12)); // - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,last_subband_size) +
signal_energy_nodc(dl_ch1,last_subband_size)); // - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband] += phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband];
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],
phy_vars_ue->PHY_measurements.n0_power[aarx]);
}
dl_ch1+=48;
dl_ch0+=48;
dl_ch1+=subband_size;
dl_ch0+=subband_size;
// msg("subband_cqi[%d][%d][%d] => %d (%d dB)\n",eNB_id,aarx,subband,phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband]);
}
}
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
// msg("subband_cqi_tot[%d][%d] => %d dB (n0 %d)\n",eNB_id,subband,phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
}
......@@ -488,7 +484,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
}
#endif
*/
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
// pmi
......@@ -497,7 +493,11 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
pmi128_im = _mm_xor_si128(pmi128_im,pmi128_im);
// limit is the number of groups of 4 REs in a subband (12 = 4 RBs, 3 = 1 RB)
// for 5 MHz channelization, there are 7 subbands, 6 of size 4 RBs and 1 of size 1 RB
limit = (subband < 6) ? 12 : 3;
if ((N_RB_DL==6) || (subband<(nb_subbands-1)))
limit = subband_size>>2;
else
limit = last_subband_size>>2;
for (i=0;i<limit;i++) {
// For each RE in subband perform ch0 * conj(ch1)
......@@ -582,13 +582,13 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
// msg("subband_cqi[%d][%d][%d] => %d (%d dB)\n",eNB_id,aarx,subband,phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband]);
}
}
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
}
}
phy_vars_ue->PHY_measurements.rank[eNB_id] = 0;
for (i=0;i<NUMBER_OF_SUBBANDS;i++) {
for (i=0;i<nb_subbands;i++) {
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB_id][i] = 0;
if (frame_parms->nb_antennas_rx>1) {
if (phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][0][i] >= phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][1][i])
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1536,21 +1536,21 @@ uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t s
*/
uint8_t phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe);;
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id);
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats,uint16_t * crnti, uint8_t * access_mode);
void fill_CQI(void *o,UCI_format_t uci_format,PHY_MEASUREMENTS *meas,uint8_t eNB_id, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id, int N_RB_DL, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
void reset_cba_uci(void *o);
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id);
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id);
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands);
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id,int nb_subbands);
uint32_t pmi2hex_2Ar1(uint16_t pmi);
uint64_t pmi2hex_2Ar1(uint32_t pmi);
uint32_t pmi2hex_2Ar2(uint8_t pmi);
uint64_t pmi2hex_2Ar2(uint32_t pmi);
uint32_t cqi2hex(uint16_t cqi);
uint64_t cqi2hex(uint32_t cqi);
uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
......
......@@ -264,10 +264,10 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
else
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch->o,ulsch->uci_format,meas,eNB_id,0, transmission_mode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL,0, transmission_mode,phy_vars_ue->sinr_eff);
if (((phy_vars_ue->frame_tx % 100) == 0) || (phy_vars_ue->frame_tx < 10))
print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
print_CQI(ulsch->o,ulsch->uci_format,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL);
}
else {
ulsch->O_RI = 0;
......
......@@ -42,6 +42,63 @@ typedef enum {
unknown_cqi//
} UCI_format_t;
// **********************************************1.5 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:16;
uint32_t pmi:12;
uint32_t cqi1:4;
} wideband_cqi_rank1_2A_1_5MHz ;
#define sizeof_wideband_cqi_rank1_2A_1_5MHz 16
typedef struct __attribute__((packed)) {
uint16_t padding:2;
uint16_t pmi:6;
uint16_t cqi2:4;
uint16_t cqi1:4;
} wideband_cqi_rank2_2A_1_5MHz ;
#define sizeof_wideband_cqi_rank2_2A_1_5MHz 14
typedef struct __attribute__((packed)) {
uint32_t padding:16;
uint32_t diffcqi1:12;
uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_1_5MHz;
#define sizeof_HLC_subband_cqi_nopmi_1_5MHz 16
typedef struct __attribute__((packed)) {
uint32_t padding:14;
uint32_t pmi:2;
uint32_t diffcqi1:12;
uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_1_5MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz 18
typedef struct __attribute__((packed)) {
uint64_t padding:31;
uint64_t pmi:1;
uint64_t diffcqi2:12;
uint64_t cqi2:4;
uint64_t diffcqi1:12;
uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_1_5MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz 33
typedef struct __attribute__((packed)) {
uint32_t padding:16;
uint32_t diffcqi1:12;
uint32_t cqi1:4;
} HLC_subband_cqi_modes123_1_5MHz;
#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t crnti:16;
uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_1_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 20
// **********************************************5 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:14;
uint32_t pmi:14;
......@@ -96,10 +153,119 @@ typedef struct __attribute__((packed)) {
} HLC_subband_cqi_mcs_CBA_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 20
// **********************************************10 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:10;
uint32_t pmi:18;
uint32_t cqi1:4;
} wideband_cqi_rank1_2A_10MHz ;
#define sizeof_wideband_cqi_rank1_2A_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:15;
uint32_t pmi:9;
uint32_t cqi2:4;
uint32_t cqi1:4;
} wideband_cqi_rank2_2A_10MHz ;
#define sizeof_wideband_cqi_rank2_2A_10MHz 17
typedef struct __attribute__((packed)) {
uint32_t padding:10;
uint32_t diffcqi1:18;
uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_10MHz;
#define sizeof_HLC_subband_cqi_nopmi_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:8;
uint32_t pmi:2;
uint32_t diffcqi1:18;
uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_10MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_10MHz 24
typedef struct __attribute__((packed)) {
uint64_t padding:19;
uint64_t pmi:1;
uint64_t diffcqi2:18;
uint64_t cqi2:4;
uint64_t diffcqi1:18;
uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_10MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_10MHz 45
typedef struct __attribute__((packed)) {
uint32_t padding:10;
uint32_t diffcqi1:18;
uint32_t cqi1:4;
} HLC_subband_cqi_modes123_10MHz;
#define sizeof_HLC_subband_cqi_modes123_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t crnti:16;
uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_10MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 20
// **********************************************20 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:2;
uint32_t pmi:26;
uint32_t cqi1:4;
} wideband_cqi_rank1_2A_20MHz ;
#define sizeof_wideband_cqi_rank1_2A_20MHz 20
typedef struct __attribute__((packed)) {
uint32_t padding:11;
uint32_t pmi:13;
uint32_t cqi2:4;
uint32_t cqi1:4;
} wideband_cqi_rank2_2A_20MHz ;
#define sizeof_wideband_cqi_rank2_2A_20MHz 21
typedef struct __attribute__((packed)) {
uint32_t padding:2;
uint32_t diffcqi1:26;
uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_20MHz;
#define sizeof_HLC_subband_cqi_nopmi_20MHz 30
typedef struct __attribute__((packed)) {
// uint32_t padding:12;
uint32_t pmi:2;
uint32_t diffcqi1:26;
uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_20MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_20MHz 32
typedef struct __attribute__((packed)) {
uint64_t padding:3;
uint64_t pmi:1;
uint64_t diffcqi2:26;
uint64_t cqi2:4;
uint64_t diffcqi1:26;
uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_20MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_20MHz 61
typedef struct __attribute__((packed)) {
uint32_t padding:2;
uint32_t diffcqi1:26;
uint32_t cqi1:4;
} HLC_subband_cqi_modes123_20MHz;
#define sizeof_HLC_subband_cqi_modes123_20MHz 30
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t crnti:16;
uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_20MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_20MHz 20
#define MAX_CQI_PAYLOAD (sizeof(HLC_subband_cqi_rank2_2A_5MHz)*8*20)
#define MAX_CQI_BITS (sizeof(HLC_subband_cqi_rank2_2A_5MHz)*8)
#define MAX_CQI_BYTES (sizeof(HLC_subband_cqi_rank2_2A_5MHz))
#define MAX_CQI_PAYLOAD (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8*20)
#define MAX_CQI_BITS (sizeof(HLC_subband_cqi_rank2_2A_20MHz)*8)
#define MAX_CQI_BYTES (sizeof(HLC_subband_cqi_rank2_2A_20MHz))
#define MAX_ACK_PAYLOAD 18
#define MAX_RI_PAYLOAD 6
This diff is collapsed.
......@@ -256,10 +256,10 @@ uint32_t ulsch_encoding(uint8_t *a,
sinr_eff = 0;
*/
rnti = phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti;
fill_CQI(ulsch->o,ulsch->uci_format,meas,0,rnti, tmode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,0,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti, tmode,phy_vars_ue->sinr_eff);
LOG_D(PHY,"UE CQI\n");
print_CQI(ulsch->o,ulsch->uci_format,0);
print_CQI(ulsch->o,ulsch->uci_format,0,phy_vars_ue->lte_frame_parms.N_RB_DL);
// save PUSCH pmi for later (transmission modes 4,5,6)
if (dlsch[0]) {
......@@ -310,9 +310,9 @@ uint32_t ulsch_encoding(uint8_t *a,
msg("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
}
if ((tmode != 4))
print_CQI(ulsch->o,wideband_cqi_rank1_2A,0);
print_CQI(ulsch->o,wideband_cqi_rank1_2A,0,phy_vars_ue->lte_frame_parms.N_RB_DL);
else
print_CQI(ulsch->o,HLC_subband_cqi_rank1_2A,0);
print_CQI(ulsch->o,HLC_subband_cqi_rank1_2A,0,phy_vars_ue->lte_frame_parms.N_RB_DL);
#endif
if (ulsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
......@@ -901,7 +901,7 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch->o,ulsch->uci_format,meas,eNB_id,rnti,tmode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti,tmode,phy_vars_ue->sinr_eff);
//LOG_D(PHY,"UE CQI\n");
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
......
......@@ -53,6 +53,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
unsigned int rx_offset;
void (*dft)(int16_t *,int16_t *, int);
int tmp_dft_in[256]; // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->log2_symbol_size) {
case 7:
......@@ -95,19 +96,21 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
return(-1);
}
#ifdef DEBUG_FEP
// if (phy_vars_ue->frame <100)
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d\n", phy_vars_ue->frame,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset);
#endif
for (aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
memset(&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
if (l==0) {
rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
// Align with 128 bit
rx_offset = rx_offset - rx_offset % 4;
#ifdef DEBUG_FEP
// if (phy_vars_ue->frame <100)
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
#endif
if (l==0) {
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
memcpy((short *)&ue_common_vars->rxdata[aa][frame_length_samples],
(short *)&ue_common_vars->rxdata[aa][0],
......@@ -119,23 +122,37 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
}
else {
rx_offset = sample_offset + slot_offset +
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) + subframe_offset - SOFFSET;
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples) +
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
rx_offset = rx_offset - (rx_offset % 4);
#ifdef DEBUG_FEP
// if (phy_vars_ue->frame <100)
msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol, nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
#endif
if (rx_offset > (frame_length_samples - frame_parms->ofdm_symbol_size))
memcpy((short *)&ue_common_vars->rxdata[aa][frame_length_samples],
(short *)&ue_common_vars->rxdata[aa][0],
memcpy((void *)&ue_common_vars->rxdata[aa][frame_length_samples],
(void *)&ue_common_vars->rxdata[aa][0],
frame_parms->ofdm_symbol_size*sizeof(int));
start_meas(&phy_vars_ue->rx_dft_stats);
if ((rx_offset&3)!=0) { // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
memcpy((void *)tmp_dft_in,
(void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in,
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
}
else // use dft input from RX buffer directly
dft((int16_t *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
stop_meas(&phy_vars_ue->rx_dft_stats);
}
}
#ifndef PERFECT_CE
if ((l==0) || (l==(4-frame_parms->Ncp))) {
for (aa=0;aa<frame_parms->nb_antennas_tx_eNB;aa++) {
......
......@@ -319,7 +319,7 @@ typedef struct {
/// Measurement Variables
#define NUMBER_OF_SUBBANDS 7
#define NUMBER_OF_SUBBANDS_MAX 13
#define NUMBER_OF_HARQ_PID_MAX 8
#if defined(CBMIMO1) || defined(EXMIMO)
......@@ -410,23 +410,23 @@ typedef struct
/// Wideband CQI (sum of all RX antennas, in dB, for precoded transmission modes (4,5,6), up to 4 spatial streams)
int precoded_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX+1][4];
/// Subband CQI per RX antenna (= SINR)
int subband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS];
int subband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX];
/// Total Subband CQI (= SINR)
int subband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS];
int subband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX];
/// Subband CQI in dB (= SINR dB)
int subband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS];
int subband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX][NUMBER_OF_SUBBANDS_MAX];
/// Total Subband CQI
int subband_cqi_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS];
int subband_cqi_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX];
/// Wideband PMI for each RX antenna
int wideband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// Wideband PMI for each RX antenna
int wideband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
///Subband PMI for each RX antenna
int subband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS][NB_ANTENNAS_RX];
int subband_pmi_re[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX][NB_ANTENNAS_RX];
///Subband PMI for each RX antenna
int subband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS][NB_ANTENNAS_RX];
int subband_pmi_im[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX][NB_ANTENNAS_RX];
/// chosen RX antennas (1=Rx antenna 1, 2=Rx antenna 2, 3=both Rx antennas)
unsigned char selected_rx_antennas[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS];
unsigned char selected_rx_antennas[NUMBER_OF_CONNECTED_eNB_MAX][NUMBER_OF_SUBBANDS_MAX];
/// Wideband Rank indication
unsigned char rank[NUMBER_OF_CONNECTED_eNB_MAX];
/// Number of RX Antennas
......
......@@ -2988,7 +2988,7 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
#ifdef DEBUG_PHY_PROC
//if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
//print_CQI(phy_vars_eNB->ulsch_eNB[i]->o,phy_vars_eNB->ulsch_eNB[i]->uci_format,0);
print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
#endif
extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,&phy_vars_eNB->eNB_UE_stats[i], &rnti, &access_mode);
phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
......@@ -3610,7 +3610,7 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
#ifdef DEBUG_PHY_PROC
//if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
// print_CQI(phy_vars_eNB->ulsch_eNB[i]->o,phy_vars_eNB->ulsch_eNB[i]->uci_format,0);
print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
#endif
extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,&phy_vars_eNB->eNB_UE_stats[i], &rnti, &access_mode);
phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
......
......@@ -1843,8 +1843,8 @@ int main(int argc, char **argv) {
// use the PMI from previous trial
if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
PHY_vars_eNB->dlsch_eNB[0][0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0);
PHY_vars_UE->dlsch_ue[0][0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0);
PHY_vars_eNB->dlsch_eNB[0][0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
PHY_vars_UE->dlsch_ue[0][0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE->PHY_measurements,0,PHY_vars_UE->lte_frame_parms.N_RB_DL);
if (n_users>1)
PHY_vars_eNB->dlsch_eNB[1][0]->pmi_alloc = (PHY_vars_eNB->dlsch_eNB[0][0]->pmi_alloc ^ 0x1555);
/*
......
......@@ -88,7 +88,7 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
lte_frame_parms->nb_antennas_tx_eNB = N_tx;
lte_frame_parms->nb_antennas_tx = N_tx;
lte_frame_parms->nb_antennas_rx = N_rx;
lte_frame_parms->phich_config_common.phich_resource = one;//oneSixth; //half
lte_frame_parms->phich_config_common.phich_resource = oneSixth; //half
lte_frame_parms->tdd_config = tdd_config;
lte_frame_parms->frame_type = frame_type;
......@@ -453,7 +453,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
}
}
/*
// add common dci
DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits;
DCI_pdu.dci_alloc[0].L = log2Lcommon;
......@@ -462,7 +462,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
DCI_pdu.dci_alloc[0].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
DCI_pdu.Num_common_dci++;
/*
// add ue specific dci
DCI_pdu.dci_alloc[1].dci_length = dci_length;
DCI_pdu.dci_alloc[1].L = log2L;
......@@ -471,7 +471,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
DCI_pdu.dci_alloc[1].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
DCI_pdu.Num_ue_spec_dci++;
*/
DCI_pdu.dci_alloc[0].dci_length = UL_pdu_size_bits;
DCI_pdu.dci_alloc[0].L = log2L;
......@@ -480,7 +480,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
DCI_pdu.dci_alloc[0].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
DCI_pdu.Num_ue_spec_dci++;
*/
DCI_pdu.nCCE = 0;
for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci;i++) {
DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
......@@ -866,7 +866,6 @@ int main(int argc, char **argv) {
}
PHY_vars_UE->UE_mode[0] = PUSCH;
nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
......@@ -891,27 +890,28 @@ int main(int argc, char **argv) {
for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB;aa++) {
memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
/*
re_offset = PHY_vars_eNB->lte_frame_parms.first_carrier_offset;
txptr = (uint32_t*)&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti];
for (i=0;i<PHY_vars_eNB->lte_frame_parms.N_RB_DL*6;i++) {
txptr[re_offset++] = QPSK[taus()&3];
txptr[re_offset++] = PHY_vars_eNB->lte_frame_parms.mode1_flag==1 ? QPSK[taus()&3] : QPSK2[taus()&3];
//printf("%i => %d,%d\n",re_offset-1,*(int16_t*)&txptr[re_offset-1],*(1+(int16_t*)&txptr[re_offset-1]));
}
re_offset=1; //skip DC
for (i=0;i<PHY_vars_eNB->lte_frame_parms.N_RB_DL*6;i++)
txptr[re_offset++] = QPSK[taus()&3];
txptr[re_offset++] = PHY_vars_eNB->lte_frame_parms.mode1_flag==1 ? QPSK[taus()&3] : QPSK2[taus()&3];
*/
}
generate_pilots_slot(PHY_vars_eNB,
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
1024,
AMP, //1024,
(subframe*2),
0);
generate_pilots_slot(PHY_vars_eNB,
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
1024,
AMP, //1024,
(subframe*2)+1,
0);
......@@ -974,7 +974,7 @@ int main(int argc, char **argv) {
DCI_pdu.Num_common_dci,
DCI_pdu.dci_alloc,
0,
1024,
AMP,
&PHY_vars_eNB->lte_frame_parms,
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
subframe);
......@@ -999,7 +999,7 @@ int main(int argc, char **argv) {
PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->n_DMRS = 0;
generate_phich_top(PHY_vars_eNB,
subframe,1024,0,0);
subframe,AMP,0,0);
/*
// generate 3 interfering PHICH
if (num_phich_interf>0) {
......@@ -1032,11 +1032,11 @@ int main(int argc, char **argv) {
// write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
if (n_frames==1)
if (n_frames==1) {
write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][0],4*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX,1,1);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB > 1)
write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][1],4*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX,1,1);
}
tx_lev = 0;
......@@ -1153,7 +1153,7 @@ int main(int argc, char **argv) {
}
}
else {
for(aa=0;aa<frame_parms->nb_antennas_tx;aa++)
for(aa=0;aa<frame_parms->nb_antennas_tx_eNB;aa++)
{
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
{
......
......@@ -959,7 +959,7 @@ int main(int argc, char **argv) {
if ((cqi_flag == 1) && (n_frames == 1) ) {
printf("CQI information (O %d) %d %d\n",PHY_vars_UE->ulsch_ue[0]->O,
PHY_vars_UE->ulsch_ue[0]->o[0],PHY_vars_UE->ulsch_ue[0]->o[1]);
print_CQI(PHY_vars_UE->ulsch_ue[0]->o,PHY_vars_UE->ulsch_ue[0]->uci_format,0);
print_CQI(PHY_vars_UE->ulsch_ue[0]->o,PHY_vars_UE->ulsch_ue[0]->uci_format,PHY_vars_UE->lte_frame_parms.N_RB_DL,0);
}
PHY_vars_UE->ulsch_ue[0]->o_ACK[0] = taus()&1;
......@@ -1224,7 +1224,7 @@ int main(int argc, char **argv) {
printf("No ULSCH errors found, o_ACK[0]= %d, cqi_crc_status=%d\n",PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->o_ACK[0],PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->cqi_crc_status);
if (PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->cqi_crc_status==1)
print_CQI(PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->o,
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->uci_format,0);
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->uci_format,0,PHY_vars_eNB->lte_frame_parms.N_RB_DL);
dump_ulsch(PHY_vars_eNB,subframe,0);
exit(-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