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])
......
......@@ -834,43 +834,31 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext = &rxdataF_ext[aarx][symbol*(frame_parms->N_RB_DL*12)];
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
if ((frame_parms->N_RB_DL&1) == 0) { // even number of RBs
for (rb=0;rb<frame_parms->N_RB_DL;rb++) {
// For second half of RBs skip DC carrier
if (rb==(frame_parms->N_RB_DL>>1)) {
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
//dl_ch0++;
}
if (symbol_mod>0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
for (i=0;i<12;i++) {
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
}
nb_rb++;
dl_ch0_ext+=12;
rxF_ext+=12;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
j=0;
......@@ -879,11 +867,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
(i!=(nushiftmod3+3)) &&
(i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i];
// printf("ch %d => (%d,%d)\n",i,*(short *)&dl_ch0[i],*(1+(short*)&dl_ch0[i]));
......@@ -894,11 +878,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
}
......@@ -908,21 +888,13 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
if (symbol_mod>0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
for (i=0;i<12;i++)
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
nb_rb++;
dl_ch0_ext+=12;
rxF_ext+=12;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
j=0;
......@@ -931,11 +903,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
(i!=(nushiftmod3+3)) &&
(i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i];
// printf("ch %d => (%d,%d)\n",i,*(short *)&dl_ch0[i],*(1+(short*)&dl_ch0[i]));
......@@ -946,11 +914,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
// Do middle RB (around DC)
......@@ -962,28 +926,16 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
if ((i!=nushiftmod3) &&
(i!=(nushiftmod3+3))){
dl_ch0_ext[j]=dl_ch0[i];
#ifndef NEW_FFT
rxF_ext[j++]=rxF[i<<1];
#else
rxF_ext[j++]=rxF[i];
#endif
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
}
}
#ifndef NEW_FFT
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
#endif
for (;i<12;i++) {
if ((i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))){
dl_ch0_ext[j]=dl_ch0[i];
#ifndef NEW_FFT
rxF_ext[j++]=rxF[(1+i-6)<<1];
#else
rxF_ext[j++]=rxF[(1+i-6)];
#endif
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
}
}
......@@ -993,34 +945,18 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
dl_ch0_ext+=8;
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=14;
#else
rxF+=7;
#endif
rb++;
}
else {
for (i=0;i<6;i++) {
dl_ch0_ext[i]=dl_ch0[i];
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
}
#ifndef NEW_FFT
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
#endif
for (;i<12;i++) {
dl_ch0_ext[i]=dl_ch0[i];
#ifndef NEW_FFT
rxF_ext[i]=rxF[(1+i-6)<<1];
#else
rxF_ext[i]=rxF[(1+i-6)];
#endif
}
......@@ -1028,11 +964,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
dl_ch0_ext+=12;
rxF_ext+=12;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=14;
#else
rxF+=7;
#endif
rb++;
}
......@@ -1040,21 +972,13 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
if (symbol_mod > 0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
for (i=0;i<12;i++)
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
nb_rb++;
dl_ch0_ext+=12;
rxF_ext+=12;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
j=0;
......@@ -1063,11 +987,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
(i!=(nushiftmod3+3)) &&
(i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i];
}
......@@ -1077,11 +997,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
}
......@@ -1118,42 +1034,31 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
// msg("pdcch extract_rbs: rxF_ext pos %d\n",symbol*(frame_parms->N_RB_DL*12));
rxF_ext = &rxdataF_ext[aarx][symbol*(frame_parms->N_RB_DL*12)];
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
if ((frame_parms->N_RB_DL&1) == 0) // even number of RBs
for (rb=0;rb<frame_parms->N_RB_DL;rb++) {
// For second half of RBs skip DC carrier
if (rb==(frame_parms->N_RB_DL>>1)) {
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
//dl_ch0++;
// dl_ch0++;
//dl_ch1++;
}
if (symbol_mod>0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
memcpy(dl_ch1_ext,dl_ch1,12*sizeof(int32_t));
/*
/*
msg("rb %d\n",rb);
for (i=0;i<12;i++)
msg("(%d %d)",((int16_t *)dl_ch)[i<<1],((int16_t*)dl_ch)[1+(i<<1)]);
msg("\n");*/
msg("(%d %d)",((int16_t *)dl_ch0)[i<<1],((int16_t*)dl_ch0)[1+(i<<1)]);
msg("\n");
*/
for (i=0;i<12;i++) {
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
// msg("%d : (%d,%d)\n",(rxF+(2*i)-&rxdataF[aarx][( (symbol*(frame_parms->ofdm_symbol_size)))*2])/2,
// ((int16_t*)&rxF[i<<1])[0],((int16_t*)&rxF[i<<1])[0]);
// msg("%d : (%d,%d)\n",(rxF+(2*i)-&rxdataF[aarx][( (symbol*(frame_parms->ofdm_symbol_size)))*2])/2,
// ((int16_t*)&rxF[i<<1])[0],((int16_t*)&rxF[i<<1])[0]);
}
nb_rb++;
dl_ch0_ext+=12;
......@@ -1167,35 +1072,20 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
(i!=nushiftmod3+3) &&
(i!=nushiftmod3+6) &&
(i!=nushiftmod3+9)) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i];
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j] =dl_ch0[i];
dl_ch1_ext[j++]=dl_ch1[i];
}
}
nb_rb++;
dl_ch0_ext+=8;
dl_ch1_ext+=8;
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else { // Odd number of RBs
......@@ -1207,11 +1097,8 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
memcpy(dl_ch1_ext,dl_ch1,12*sizeof(int32_t));
for (i=0;i<12;i++)
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
nb_rb++;
dl_ch0_ext+=12;
dl_ch1_ext+=12;
......@@ -1219,11 +1106,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
......@@ -1233,11 +1116,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
(i!=nushiftmod3+3) &&
(i!=nushiftmod3+6) &&
(i!=nushiftmod3+9)) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j]=dl_ch0[i];
dl_ch1_ext[j++]=dl_ch1[i];
......@@ -1252,11 +1131,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
// Do middle RB (around DC)
......@@ -1265,25 +1140,13 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
for (i=0;i<6;i++) {
dl_ch0_ext[i]=dl_ch0[i];
dl_ch1_ext[i]=dl_ch1[i];
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
}
#ifndef NEW_FFT
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
#endif
for (;i<12;i++) {
dl_ch0_ext[i]=dl_ch0[i];
dl_ch1_ext[i]=dl_ch1[i];
#ifndef NEW_FFT
rxF_ext[i]=rxF[(1+i)<<1];
#else
rxF_ext[i]=rxF[(1+i)];
#endif
}
nb_rb++;
......@@ -1293,11 +1156,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=14;
#else
rxF+=7;
#endif
rb++;
}
else {
......@@ -1307,29 +1166,17 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
(i!=nushiftmod3+3)){
dl_ch0_ext[j]=dl_ch0[i];
dl_ch1_ext[j]=dl_ch1[i];
#ifndef NEW_FFT
rxF_ext[j++]=rxF[i<<1];
#else
rxF_ext[j++]=rxF[i];
#endif
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
}
}
#ifndef NEW_FFT
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
#endif
for (;i<12;i++) {
if ((i!=nushiftmod3+6) &&
(i!=nushiftmod3+9)){
dl_ch0_ext[j]=dl_ch0[i];
dl_ch1_ext[j]=dl_ch1[i];
#ifndef NEW_FFT
rxF_ext[j++]=rxF[(1+i-6)<<1];
#else
rxF_ext[j++]=rxF[(1+i-6)];
#endif
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
}
}
......@@ -1341,11 +1188,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
rxF_ext+=8;
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=14;
#else
rxF+=7;
#endif
rb++;
}
......@@ -1356,11 +1199,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
memcpy(dl_ch1_ext,dl_ch1,12*sizeof(int32_t));
for (i=0;i<12;i++)
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
nb_rb++;
dl_ch0_ext+=12;
dl_ch1_ext+=12;
......@@ -1368,12 +1207,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
j=0;
......@@ -1382,11 +1216,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
(i!=nushiftmod3+3) &&
(i!=nushiftmod3+6) &&
(i!=nushiftmod3+9)) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j]=dl_ch0[i];
dl_ch1_ext[j++]=dl_ch1[i];
......@@ -1399,11 +1229,7 @@ void pdcch_extract_rbs_dual(int32_t **rxdataF,
dl_ch0+=12;
dl_ch1+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
}
......@@ -1976,13 +1802,17 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
if (numCCE <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)))
return(cmax(1,nCCEmin));
//else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antennas_tx_eNB==4) ? 4 : 5)))
else if (numCCE < get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
else if (numCCE <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
return(cmax(2,nCCEmin));
//else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antennas_tx_eNB==4) ? 7 : 8)))
else if (numCCE < get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
else if (numCCE <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
return(cmax(3,nCCEmin));
else if (frame_parms->N_RB_DL<=10) {
if (frame_parms->Ncp == 0) { // normal CP
printf("numCCE %d, N_RB_DL = %d : should be returning 4 PDCCH symbols (%d,%d,%d)\n",numCCE,frame_parms->N_RB_DL,
get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)),
get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)),
get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)));
if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antennas_tx_eNB==4) ? 10 : 11)))
return(4);
}
......
......@@ -3697,7 +3697,7 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
}
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id) {
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands) {
int i, aarx;
uint16_t pmiq=0;
......@@ -3705,7 +3705,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id) {
uint8_t rank = meas->rank[eNB_id];
int pmi_re,pmi_im;
for (i=0;i<NUMBER_OF_SUBBANDS;i++) {
for (i=0;i<nb_subbands;i++) {
pmi_re = 0;
pmi_im = 0;
......@@ -3740,7 +3740,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id) {
return(pmivect);
}
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id) {
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id,int nb_subbands) {
uint8_t i;
uint16_t pmiq=0;
......@@ -3748,7 +3748,7 @@ uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_i
uint8_t rank = meas->rank[eNB_id];
int pmi_re,pmi_im;
for (i=0;i<NUMBER_OF_SUBBANDS;i++) {
for (i=0;i<nb_subbands;i++) {
if (rank == 0) {
pmi_re = meas->subband_pmi_re[eNB_id][i][a_id];
......@@ -3891,7 +3891,7 @@ uint8_t sinr2cqi(double sinr,uint8_t trans_mode) {
//}
uint32_t fill_subband_cqi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t trans_mode) {
uint32_t fill_subband_cqi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t trans_mode,int nb_subbands) {
uint8_t i;
......@@ -3900,7 +3900,7 @@ uint32_t fill_subband_cqi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t trans_mo
int diff_cqi=0;
for (i=0;i<NUMBER_OF_SUBBANDS;i++) {
for (i=0;i<nb_subbands;i++) {
diff_cqi = -sinr2cqi(meas->wideband_cqi_avg[eNB_id],trans_mode) + sinr2cqi(meas->subband_cqi_tot_dB[eNB_id][i],trans_mode);
......@@ -3920,61 +3920,209 @@ uint32_t fill_subband_cqi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t trans_mo
return(cqivect);
}
void fill_CQI(void *o,UCI_format_t uci_format,PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint16_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,uint16_t rnti, uint8_t trans_mode, double sinr_eff) {
// msg("[PHY][UE] Filling CQI for eNB %d, meas->wideband_cqi_tot[%d] %d\n",
// eNB_id,eNB_id,meas->wideband_cqi_tot[eNB_id]);
double sinr_tmp;
uint8_t *o = ulsch->o;
UCI_format_t uci_format = ulsch->uci_format;
if(flag_LA==1)
sinr_tmp = sinr_eff;
else
sinr_tmp = (double) meas->wideband_cqi_avg[eNB_id];
//LOG_I(PHY,"Filling CQI %f for eNB %d\n",sinr_tmp,eNB_id);
switch (uci_format) {
case wideband_cqi_rank1_2A:
((wideband_cqi_rank1_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((wideband_cqi_rank1_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id);
break;
case wideband_cqi_rank2_2A:
((wideband_cqi_rank2_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_nopmi:
((HLC_subband_cqi_nopmi_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_nopmi_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode);
break;
case HLC_subband_cqi_rank1_2A:
((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode);
((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi = quantize_wideband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_rank2_2A:
// This has to be improved!!!
((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi2 = fill_subband_cqi(meas,eNB_id,trans_mode);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
switch (N_RB_DL) {
case 6:
switch (uci_format) {
case wideband_cqi_rank1_2A:
((wideband_cqi_rank1_2A_1_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((wideband_cqi_rank1_2A_1_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,6);
break;
case wideband_cqi_rank2_2A:
((wideband_cqi_rank2_2A_1_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_1_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_1_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,6);
break;
case HLC_subband_cqi_nopmi:
((HLC_subband_cqi_nopmi_1_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_nopmi_1_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,6);
break;
case HLC_subband_cqi_rank1_2A:
((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,6);
((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->pmi = quantize_wideband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_rank2_2A:
// This has to be improved!!!
((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,6);
((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi2 = fill_subband_cqi(meas,eNB_id,trans_mode,6);
((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,6);
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
mac_xface->macphy_exit("fill_CQI ue_selected CQI not supported yet!!!");
break;
default:
LOG_E(PHY,"unsupported CQI mode (%d)!!!\n",uci_format);
mac_xface->macphy_exit("unsupported CQI mode !!!");
break;
}
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
mac_xface->macphy_exit("fill_CQI ue_selected CQI not supported yet!!!");
case 25:
switch (uci_format) {
case wideband_cqi_rank1_2A:
((wideband_cqi_rank1_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((wideband_cqi_rank1_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,7);
break;
case wideband_cqi_rank2_2A:
((wideband_cqi_rank2_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,7);
break;
case HLC_subband_cqi_nopmi:
((HLC_subband_cqi_nopmi_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_nopmi_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,7);
break;
case HLC_subband_cqi_rank1_2A:
((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,7);
((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi = quantize_wideband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_rank2_2A:
// This has to be improved!!!
((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,7);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi2 = fill_subband_cqi(meas,eNB_id,trans_mode,7);
((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,7);
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
mac_xface->macphy_exit("fill_CQI ue_selected CQI not supported yet!!!");
break;
default:
LOG_E(PHY,"unsupported CQI mode (%d)!!!\n",uci_format);
mac_xface->macphy_exit("unsupported CQI mode !!!");
break;
}
break;
case 50:
switch (uci_format) {
case wideband_cqi_rank1_2A:
((wideband_cqi_rank1_2A_10MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((wideband_cqi_rank1_2A_10MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,9);
break;
case wideband_cqi_rank2_2A:
((wideband_cqi_rank2_2A_10MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_10MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_10MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,9);
break;
case HLC_subband_cqi_nopmi:
((HLC_subband_cqi_nopmi_10MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_nopmi_10MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,9);
break;
case HLC_subband_cqi_rank1_2A:
((HLC_subband_cqi_rank1_2A_10MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank1_2A_10MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,9);
((HLC_subband_cqi_rank1_2A_10MHz *)o)->pmi = quantize_wideband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_rank2_2A:
// This has to be improved!!!
((HLC_subband_cqi_rank2_2A_10MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_10MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,9);
((HLC_subband_cqi_rank2_2A_10MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_10MHz *)o)->diffcqi2 = fill_subband_cqi(meas,eNB_id,trans_mode,9);
((HLC_subband_cqi_rank2_2A_10MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,9);
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_10MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
mac_xface->macphy_exit("fill_CQI ue_selected CQI not supported yet!!!");
break;
default:
LOG_E(PHY,"unsupported CQI mode (%d)!!!\n",uci_format);
mac_xface->macphy_exit("unsupported CQI mode !!!");
break;
}
break;
default:
LOG_E(PHY,"unsupported CQI mode (%d)!!!\n",uci_format);
mac_xface->macphy_exit("unsupported CQI mode !!!");
case 100:
switch (uci_format) {
case wideband_cqi_rank1_2A:
((wideband_cqi_rank1_2A_20MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((wideband_cqi_rank1_2A_20MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,13);
break;
case wideband_cqi_rank2_2A:
((wideband_cqi_rank2_2A_20MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_20MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_20MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,13);
break;
case HLC_subband_cqi_nopmi:
((HLC_subband_cqi_nopmi_20MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_nopmi_20MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,13);
break;
case HLC_subband_cqi_rank1_2A:
((HLC_subband_cqi_rank1_2A_20MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank1_2A_20MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,13);
((HLC_subband_cqi_rank1_2A_20MHz *)o)->pmi = quantize_wideband_pmi(meas,eNB_id);
break;
case HLC_subband_cqi_rank2_2A:
// This has to be improved!!!
((HLC_subband_cqi_rank2_2A_20MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_20MHz *)o)->diffcqi1 = fill_subband_cqi(meas,eNB_id,trans_mode,13);
((HLC_subband_cqi_rank2_2A_20MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode);
((HLC_subband_cqi_rank2_2A_20MHz *)o)->diffcqi2 = fill_subband_cqi(meas,eNB_id,trans_mode,13);
((HLC_subband_cqi_rank2_2A_20MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,13);
break;
case HLC_subband_cqi_mcs_CBA:
// this is the cba mcs uci for cba transmission
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->mcs = 2; //fixme
((HLC_subband_cqi_mcs_CBA_20MHz *)o)->crnti = rnti;
LOG_D(PHY,"fill uci for cba rnti %x, mcs %d \n", rnti, 2);
break;
case ue_selected:
LOG_E(PHY,"fill_CQI ue_selected CQI not supported yet!!!\n");
mac_xface->macphy_exit("fill_CQI ue_selected CQI not supported yet!!!");
break;
default:
LOG_E(PHY,"unsupported CQI mode (%d)!!!\n",uci_format);
mac_xface->macphy_exit("unsupported CQI mode !!!");
break;
}
break;
}
}
void reset_cba_uci(void *o) {
......@@ -4258,119 +4406,392 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
// The aperiodic CQI reporting mode is fixed for every transmission mode instead of being configured by higher layer signaling
case 1:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
case 2:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
case 3:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
case 4:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank2_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank2_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank2_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->o_RI[0] = 1;
}
break;
case 5:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank2_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank2_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank2_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->o_RI[0] = 1;
}
break;
case 6:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank2_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank2_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank2_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->o_RI[0] = 1;
}
break;
case 7:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
}
else if(meas->rank[eNB_id] == 0){
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
}
else{
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
......@@ -4386,7 +4807,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
ulsch->uci_format = HLC_subband_cqi_nopmi;
}
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);
//FK: moved this part to ulsch_coding to be more recent
/*
......@@ -4679,78 +5100,257 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
case 1:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
break;
case 2:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
break;
case 3:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
break;
case 4:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_1_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_10MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_20MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = wideband_cqi_rank1_2A;
}
break;
case 5:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_1_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_10MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_20MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = wideband_cqi_rank1_2A;
}
break;
case 6:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_1_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_10MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_20MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = wideband_cqi_rank1_2A;
}
break;
case 7:
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
switch (frame_parms->N_RB_DL) {
case 6:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
break;
default:
......@@ -4889,7 +5489,7 @@ double sinr_eff_cqi_calc(PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id){
double channely=0;
double channelx_i=0;
double channely_i=0;
uint16_t q = quantize_subband_pmi(meas,eNB_id);
uint16_t q = quantize_subband_pmi(meas,eNB_id,7);
uint8_t qq;
switch(transmission_mode){
......
......@@ -105,76 +105,342 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
len += sprintf(&buffer[len], "[UE PROC] effective SINR %.2f dB\n",phy_vars_ue->sinr_eff);
len += sprintf(&buffer[len], "[UE PROC] Wideband CQI eNB %d: %d dB, avg: %d dB\n",eNB,phy_vars_ue->PHY_measurements.wideband_cqi_tot[eNB],phy_vars_ue->PHY_measurements.wideband_cqi_avg[eNB]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n",
eNB,
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][0],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][1],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][2],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][3],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][4],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][5],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][6]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %x\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&phy_vars_ue->PHY_measurements,eNB)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %x,%x\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,0)),
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,1)));
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][5]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][5]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n",
eNB,
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][0],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][1],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][2],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][3],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][4],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][5]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %llx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&phy_vars_ue->PHY_measurements,eNB,6)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %llx,%llx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,0,6)),
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,1,6)));
break;
case 25:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][6]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n",
eNB,
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][0],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][1],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][2],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][3],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][4],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][5],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][6]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %llx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&phy_vars_ue->PHY_measurements,eNB,7)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %llx,%llx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,0,7)),
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,1,7)));
break;
case 50:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][6],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][7],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][8]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][6],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][7],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][8]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][7][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][7][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][8][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][8][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][7][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][7][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][8][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][8][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n",
eNB,
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][0],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][1],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][2],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][3],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][4],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][5],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][6],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][7],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][8]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %llx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&phy_vars_ue->PHY_measurements,eNB,9)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %llx,%llx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,0,9)),
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,1,9)));
break;
case 100:
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][6],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][7],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][8],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][9],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][10],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][11],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][0][12]);
len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n",
eNB,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][2],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][3],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][4],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][5],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][6],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][7],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][8],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][9],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][10],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][11],
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB][1][12]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][7][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][7][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][8][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][8][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][9][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][9][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][10][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][10][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][11][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][11][0],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][12][0],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][12][0]);
len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n",
eNB,
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][0][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][1][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][2][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][3][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][4][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][5][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][6][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][6][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][7][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][7][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][8][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][8][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][9][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][9][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][10][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][10][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][11][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][11][1],
phy_vars_ue->PHY_measurements.subband_pmi_re[eNB][12][1],
phy_vars_ue->PHY_measurements.subband_pmi_im[eNB][12][1]);
len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n",
eNB,
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][0],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][1],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][2],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][3],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][4],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][5],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][6],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][7],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][8],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][9],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][10],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][11],
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB][12]);
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %llx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&phy_vars_ue->PHY_measurements,eNB,13)));
len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %llx,%llx\n",eNB,
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,0,13)),
pmi2hex_2Ar1(quantize_subband_pmi2(&phy_vars_ue->PHY_measurements,eNB,1,13)));
break;
}
#ifdef OPENAIR2
RRC_status = mac_get_rrc_status(phy_vars_ue->Mod_id,0,0);
len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status);
......@@ -190,7 +456,7 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
if (phy_vars_ue->transmission_mode[eNB] == 6)
len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,phy_vars_ue->PHY_measurements.precoded_cqi_dB[eNB][0]);
if (phy_vars_ue->dlsch_ue[0] && phy_vars_ue->dlsch_ue[0][0] && phy_vars_ue->dlsch_ue[0][1]) {
len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %x (%p)\n",eNB,pmi2hex_2Ar1(phy_vars_ue->dlsch_ue[0][0]->pmi_alloc),phy_vars_ue->dlsch_ue[0][0]);
len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %llx (%p)\n",eNB,pmi2hex_2Ar1(phy_vars_ue->dlsch_ue[0][0]->pmi_alloc),phy_vars_ue->dlsch_ue[0][0]);
len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->dl_power_off);
......@@ -345,7 +611,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) {
phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]);
len += sprintf(&buffer[len],"\n");
len += sprintf(&buffer[len],"[eNB PROC] DL TM %d, DL_cqi %d, DL_pmi_single %x\n",
len += sprintf(&buffer[len],"[eNB PROC] DL TM %d, DL_cqi %d, DL_pmi_single %llx\n",
phy_vars_eNB->transmission_mode[UE_id],
phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0],
pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single));
......
......@@ -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
......@@ -44,24 +44,34 @@
#ifdef DEBUG_UCI_TOOLS
#include "PHY/vars.h"
#endif
//#define DEBUG_UCI
#define DEBUG_UCI
unsigned int pmi2hex_2Ar1(unsigned short pmi) {
uint64_t pmi2hex_2Ar1(uint32_t pmi) {
return ((pmi&3) + (((pmi>>2)&3)<<4) + (((pmi>>4)&3)<<8) + (((pmi>>6)&3)<<12) +
(((pmi>>8)&3)<<16) + (((pmi>>10)&3)<<20) + (((pmi>>12)&3)<<24));
uint64_t pmil = (uint64_t)pmi;
return ((pmil&3) + (((pmil>>2)&3)<<4) + (((pmil>>4)&3)<<8) + (((pmil>>6)&3)<<12) +
(((pmil>>8)&3)<<16) + (((pmil>>10)&3)<<20) + (((pmil>>12)&3)<<24) +
(((pmil>>14)&3)<<28) + (((pmil>>16)&3)<<32) + (((pmil>>18)&3)<<36) +
(((pmil>>20)&3)<<40) + (((pmil>>22)&3)<<44) + (((pmil>>24)&3)<<48));
}
unsigned int pmi2hex_2Ar2(unsigned char pmi) {
uint64_t pmi2hex_2Ar2(uint32_t pmi) {
return ((pmi&1) + (((pmi>>1)&1)<<4) + (((pmi>>2)&1)<<8) + (((pmi>>3)&3)<<12) +
(((pmi>>4)&3)<<16) + (((pmi>>5)&3)<<20) + (((pmi>>6)&3)<<24));
uint64_t pmil = (uint64_t)pmi;
return ((pmil&1) + (((pmil>>1)&1)<<4) + (((pmil>>2)&1)<<8) + (((pmil>>3)&1)<<12) +
(((pmil>>4)&1)<<16) + (((pmil>>5)&1)<<20) + (((pmil>>6)&1)<<24) +
(((pmil>>7)&1)<<28) + (((pmil>>8)&1)<<32) + (((pmil>>9)&1)<<36) +
(((pmil>>10)&1)<<40) + (((pmil>>11)&1)<<44) + (((pmil>>12)&1)<<48));
}
unsigned int cqi2hex(unsigned short cqi) {
uint64_t cqi2hex(uint32_t cqi) {
return ((cqi&3) + (((cqi>>2)&3)<<4) + (((cqi>>4)&3)<<8) + (((cqi>>6)&3)<<12) +
(((cqi>>8)&3)<<16) + (((cqi>>10)&3)<<20) + (((cqi>>12)&3)<<24));
uint64_t cqil = (uint64_t)cqi;
return ((cqil&3) + (((cqil>>2)&3)<<4) + (((cqil>>4)&3)<<8) + (((cqil>>6)&3)<<12) +
(((cqil>>8)&3)<<16) + (((cqil>>10)&3)<<20) + (((cqil>>12)&3)<<24) +
(((cqil>>14)&3)<<28) + (((cqil>>16)&3)<<32) + (((cqil>>18)&3)<<36) +
(((cqil>>20)&3)<<40) + (((cqil>>22)&3)<<44) + (((cqil>>24)&3)<<48));
}
//void do_diff_cqi(uint8_t N_RB_DL,
......@@ -117,7 +127,7 @@ void do_diff_cqi(uint8_t N_RB_DL,
// This is table 7.2.1-3 from 36.213 (with k replaced by the number of subbands, nb_sb)
switch (N_RB_DL) {
case 6:
nb_sb=0;
nb_sb=1;
break;
case 15:
nb_sb = 4;
......@@ -156,61 +166,132 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint16
uint8_t N_RB_DL = 25;
*access_mode=SCHEDULED_ACCESS;
switch(uci_format){
case wideband_cqi_rank1_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_5MHz *)o)->pmi;
break;
case wideband_cqi_rank2_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_5MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_nopmi:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_5MHz *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi1));
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi;
switch(N_RB_DL) {
case 6:
switch(uci_format){
case wideband_cqi_rank1_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_1_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_1_5MHz *)o)->pmi;
break;
case wideband_cqi_rank2_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_1_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_1_5MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_1_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_nopmi:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_1_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_1_5MHz *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi1));
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_D(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti);
} else {
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_1_5MHz *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci \n");
*access_mode=UNKNOWN_ACCESS;
break;
}
break;
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_D(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti);
} else {
case 25:
switch(uci_format){
case wideband_cqi_rank1_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank1_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_pmi_single = ((wideband_cqi_rank1_2A_5MHz *)o)->pmi;
break;
case wideband_cqi_rank2_2A:
stats->DL_cqi[0] = (((wideband_cqi_rank2_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((wideband_cqi_rank2_2A_5MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
stats->DL_pmi_dual = ((wideband_cqi_rank2_2A_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_nopmi:
stats->DL_cqi[0] = (((HLC_subband_cqi_nopmi_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],((HLC_subband_cqi_nopmi_5MHz *)o)->diffcqi1);
break;
case HLC_subband_cqi_rank1_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
stats->DL_pmi_single = ((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_rank2_2A:
stats->DL_cqi[0] = (((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi1);
if (stats->DL_cqi[0] > 24)
stats->DL_cqi[0] = 24;
stats->DL_cqi[1] = (((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi2);
if (stats->DL_cqi[1] > 24)
stats->DL_cqi[1] = 24;
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[0],stats->DL_cqi[0],(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi1));
do_diff_cqi(N_RB_DL,stats->DL_subband_cqi[1],stats->DL_cqi[1],(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi2));
stats->DL_pmi_dual = ((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi;
break;
case HLC_subband_cqi_mcs_CBA:
if ((*crnti == ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti) && (*crnti !=0)){
*access_mode=CBA_ACCESS;
LOG_D(PHY,"[eNB] UCI for CBA : mcs %d crnti %x\n",
((HLC_subband_cqi_mcs_CBA_5MHz *)o)->mcs, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti);
} else {
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti);
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci \n");
*access_mode=UNKNOWN_ACCESS;
LOG_N(PHY,"[eNB] UCI for CBA : rnti (enb context %x, rx uci %x) invalid, unknown access\n",
*crnti, ((HLC_subband_cqi_mcs_CBA_5MHz *)o)->crnti);
break;
}
break;
case unknown_cqi:
default:
LOG_N(PHY,"[eNB][UCI] received unknown uci \n");
*access_mode=UNKNOWN_ACCESS;
case 50:
break;
case 100:
break;
}
......@@ -291,43 +372,151 @@ void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats, uint16
}
void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id) {
void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id,int N_RB_DL) {
switch(uci_format){
case wideband_cqi_rank1_2A:
#ifdef DEBUG_UCI
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,((wideband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, pmi (%x) %8x\n",eNB_id,((wideband_cqi_rank1_2A_5MHz *)o)->pmi,pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)o)->pmi));
switch(N_RB_DL) {
case 6:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,
((wideband_cqi_rank1_2A_1_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, pmi (%x) %8x\n",eNB_id,
((wideband_cqi_rank1_2A_1_5MHz *)o)->pmi,
pmi2hex_2Ar1(((wideband_cqi_rank1_2A_1_5MHz *)o)->pmi));
break;
case 25:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,
((wideband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, pmi (%x) %8x\n",eNB_id,
((wideband_cqi_rank1_2A_5MHz *)o)->pmi,
pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)o)->pmi));
break;
case 50:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,
((wideband_cqi_rank1_2A_10MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, pmi (%x) %8x\n",eNB_id,
((wideband_cqi_rank1_2A_10MHz *)o)->pmi,
pmi2hex_2Ar1(((wideband_cqi_rank1_2A_10MHz *)o)->pmi));
break;
case 100:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id,
((wideband_cqi_rank1_2A_20MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, pmi (%x) %8x\n",eNB_id,
((wideband_cqi_rank1_2A_20MHz *)o)->pmi,
pmi2hex_2Ar1(((wideband_cqi_rank1_2A_20MHz *)o)->pmi));
break;
}
#endif //DEBUG_UCI
break;
case wideband_cqi_rank2_2A:
#ifdef DEBUG_UCI
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((wideband_cqi_rank2_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((wideband_cqi_rank2_2A_5MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, pmi %8x\n",eNB_id,pmi2hex_2Ar2(((wideband_cqi_rank2_2A_5MHz *)o)->pmi));
switch(N_RB_DL) {
case 6:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((wideband_cqi_rank2_2A_1_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((wideband_cqi_rank2_2A_1_5MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, pmi %8x\n",eNB_id,pmi2hex_2Ar2(((wideband_cqi_rank2_2A_1_5MHz *)o)->pmi));
break;
case 25:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((wideband_cqi_rank2_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((wideband_cqi_rank2_2A_5MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, pmi %8x\n",eNB_id,pmi2hex_2Ar2(((wideband_cqi_rank2_2A_5MHz *)o)->pmi));
break;
case 50:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((wideband_cqi_rank2_2A_10MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((wideband_cqi_rank2_2A_10MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, pmi %8x\n",eNB_id,pmi2hex_2Ar2(((wideband_cqi_rank2_2A_10MHz *)o)->pmi));
break;
case 100:
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((wideband_cqi_rank2_2A_20MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((wideband_cqi_rank2_2A_20MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 2: eNB %d, pmi %8x\n",eNB_id,pmi2hex_2Ar2(((wideband_cqi_rank2_2A_20MHz *)o)->pmi));
break;
}
#endif //DEBUG_UCI
break;
case HLC_subband_cqi_nopmi:
#ifdef DEBUG_UCI
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
switch(N_RB_DL) {
case 6:
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_1_5MHz *)o)->diffcqi1));
break;
case 25:
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
break;
case 50:
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_10MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_10MHz *)o)->diffcqi1));
break;
case 100:
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_20MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi (no pmi) : eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_20MHz *)o)->diffcqi1));
break;
}
#endif //DEBUG_UCI
break;
case HLC_subband_cqi_rank1_2A:
#ifdef DEBUG_UCI
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi);
switch(N_RB_DL) {
case 6:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi);
break;
case 25:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi);
break;
case 50:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi);
break;
case 100:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank1_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 1: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank1_2A_5MHz *)o)->pmi);
break;
}
#endif //DEBUG_UCI
break;
case HLC_subband_cqi_rank2_2A:
#ifdef DEBUG_UCI
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi2 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi2));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi);
switch(N_RB_DL) {
case 6:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi2 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->diffcqi2));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_1_5MHz *)o)->pmi);
break;
case 25:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_5MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi2 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_5MHz *)o)->diffcqi2));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_5MHz *)o)->pmi);
break;
case 50:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_10MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_10MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_10MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi2 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_10MHz *)o)->diffcqi2));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_10MHz *)o)->pmi);
break;
case 100:
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi1 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_20MHz *)o)->cqi1);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, cqi2 %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_20MHz *)o)->cqi2);
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi1 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_20MHz *)o)->diffcqi1));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, diffcqi2 %8x\n",eNB_id,cqi2hex(((HLC_subband_cqi_rank2_2A_20MHz *)o)->diffcqi2));
LOG_I(PHY,"[PRINT CQI] hlc_cqi rank 2: eNB %d, pmi %d\n",eNB_id,((HLC_subband_cqi_rank2_2A_20MHz *)o)->pmi);
break;
}
#endif //DEBUG_UCI
break;
case HLC_subband_cqi_mcs_CBA:
......
......@@ -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,47 +96,63 @@ 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));
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) {
rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
// Align with 128 bit
rx_offset = rx_offset - rx_offset % 4;
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],
frame_parms->ofdm_symbol_size*sizeof(int));
start_meas(&phy_vars_ue->rx_dft_stats);
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);
start_meas(&phy_vars_ue->rx_dft_stats);
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);
}
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 = rx_offset - (rx_offset % 4);
rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples) +
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-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,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));
start_meas(&phy_vars_ue->rx_dft_stats);
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);
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,29 +890,30 @@ 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,
(subframe*2),
0);
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
AMP, //1024,
(subframe*2),
0);
generate_pilots_slot(PHY_vars_eNB,
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
1024,
(subframe*2)+1,
0);
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
AMP, //1024,
(subframe*2)+1,
0);
if (input_fd == NULL) {
......@@ -969,15 +969,15 @@ int main(int argc, char **argv) {
if (DCI_pdu.dci_alloc[i].nCCE==-1)
exit(-1);
}
num_pdcch_symbols = generate_dci_top(DCI_pdu.Num_ue_spec_dci,
DCI_pdu.Num_common_dci,
DCI_pdu.dci_alloc,
0,
1024,
&PHY_vars_eNB->lte_frame_parms,
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
subframe);
DCI_pdu.Num_common_dci,
DCI_pdu.dci_alloc,
0,
AMP,
&PHY_vars_eNB->lte_frame_parms,
PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id],
subframe);
if (n_frames==1)
printf("num_pdcch_symbols at TX %d\n",num_pdcch_symbols);
......@@ -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;
......@@ -1127,10 +1127,10 @@ int main(int argc, char **argv) {
// printf("subframe_offset = %d\n",subframe_offset);
slot_fep(PHY_vars_UE,
l%(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
(2*subframe)+(l/(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2)),
0,
0);
l%(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
(2*subframe)+(l/(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2)),
0,
0);
#ifdef PERFECT_CE
if (awgn_flag==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