Commit 13483270 authored by knopp's avatar knopp

parent e67c9df2
......@@ -934,7 +934,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
#ifndef USER_MODE
ue_common_vars->rxdata[i] = (int*) RX_DMA_BUFFER[0][i];
#else //USER_MODE
ue_common_vars->rxdata[i] = (int*) malloc16(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
ue_common_vars->rxdata[i] = (int*) malloc16((FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int));
#endif //USER_MODE
if (ue_common_vars->rxdata[i]) {
#ifdef DEBUG_PHY
......@@ -1016,7 +1016,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) {
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates[eNB_id][(j<<1) + i] = (int *)malloc16(frame_parms->symbols_per_tti*sizeof(int)*(frame_parms->ofdm_symbol_size)+LTE_CE_FILTER_LENGTH);
if (ue_common_vars->dl_ch_estimates[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
......@@ -1048,7 +1048,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) {//frame_parms->nb_antennas_tx; j++) {
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->ofdm_symbol_size)*2);
if (ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
......
......@@ -182,11 +182,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++) {
pil = (short *)&pilot[p][0];
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+phy_vars_ue->lte_frame_parms.first_carrier_offset)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+phy_vars_ue->lte_frame_parms.first_carrier_offset))];
#endif
dl_ch = (short *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
// if (eNb_id==0)
......@@ -206,11 +202,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -221,11 +213,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=2;pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1);pilot_cnt+=2) {
......@@ -246,11 +234,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // 6 samples in replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
// printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
......@@ -265,11 +249,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -279,11 +259,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
k = (nu + nushift)%6;
if (k > 6)
k -=6;
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k))];
#endif
for (pilot_cnt=0;pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3);pilot_cnt+=2) {
// printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
// printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
......@@ -298,11 +275,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -314,11 +287,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -331,11 +300,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -368,11 +333,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -390,11 +351,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=2;pilot_cnt<24;pilot_cnt+=2) {
......@@ -418,11 +375,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -439,11 +392,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -467,11 +416,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// printf("Second half\n");
// Second half of RBs
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k))];
#endif
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
#ifdef DEBUG_CH
......@@ -486,11 +432,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=0;pilot_cnt<22;pilot_cnt+=2) {
......@@ -512,11 +454,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -533,11 +471,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -558,11 +492,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif// remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -601,12 +531,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
// remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -617,11 +542,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -638,11 +559,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
//printf("Second half\n");
//Second half of RBs
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p))<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p)))];
#endif
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
......@@ -651,11 +568,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (rb=0;rb<28;rb+=4) {
......@@ -673,11 +586,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -688,11 +597,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -795,10 +700,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
break;
}
// do ifft of channel estimate
for (aa=0;aa<phy_vars_ue->lte_frame_parms.nb_antennas_rx*phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB;aa++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],1);
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++)
for (p=0;p<phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB;p++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
}
return(0);
}
......
......@@ -302,36 +302,32 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
__m128i *dl_ch0_128,*dl_ch1_128;
int *dl_ch0,*dl_ch1;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
phy_vars_ue->PHY_measurements.nb_antennas_rx = frame_parms->nb_antennas_rx;
gain_offset = 0;
#ifndef __SSE3__
zeroPMI = _mm_xor_si128(zeroPMI,zeroPMI);
#endif
if (phy_vars_ue->init_averaging == 1) {
for (eNB_id=0;eNB_id<phy_vars_ue->n_connected_eNB;eNB_id++) {
phy_vars_ue->PHY_measurements.rx_power_avg[eNB_id] = 0;
}
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phy_vars_ue->PHY_measurements.n0_power[aarx] = 0;
phy_vars_ue->PHY_measurements.n0_power_dB[aarx] = 0;
}
phy_vars_ue->PHY_measurements.n0_power_tot = 0;
phy_vars_ue->PHY_measurements.n0_power_tot_dB = 0;
phy_vars_ue->PHY_measurements.n0_power_avg = 0;
phy_vars_ue->PHY_measurements.n0_power_avg_dB = 0;
int nb_subbands,subband_size,last_subband_size;
int N_RB_DL = frame_parms->N_RB_DL;
switch (N_RB_DL) {
case 6:
nb_subbands = 6;
subband_size = 12;
last_subband_size = 0;
break;
default:
case 25:
nb_subbands = 7;
subband_size = 4*12;
last_subband_size = 12;
break;
case 50:
nb_subbands = 9;
subband_size = 6*12;
last_subband_size = 2*12;
break;
case 100:
nb_subbands = 13;
subband_size = 8*12;
last_subband_size = 4*12;
break;
}
// noise measurements
// for abstraction we do noise measurements based on the precalculated phy_vars_ue->N0
// otherwise if there is a symbol where we can take noise measurements on, we measure there
// otherwise do not update the noise measurements
if (abstraction_flag!=0) {
phy_vars_ue->PHY_measurements.n0_power_tot = 0;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......@@ -368,7 +364,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx] =
(signal_energy_nodc(&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
(frame_parms->N_RB_DL*12)));
(N_RB_DL*12)));
//- phy_vars_ue->PHY_measurements.n0_power[aarx];
if (phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx]<0)
......@@ -432,19 +428,18 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
dl_ch0 = &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4];
dl_ch1 = &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
// cqi
if (aarx==0)
phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband]=0;
if (subband<6) {
/*
for (i=0;i<48;i++)
if ((subband<(nb_subbands-1))||(N_RB_DL==6)) {
/*for (i=0;i<48;i++)
msg("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
*/
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] =
(signal_energy_nodc(dl_ch0,48) + signal_energy_nodc(dl_ch1,48));
(signal_energy_nodc(dl_ch0,subband_size) + signal_energy_nodc(dl_ch1,subband_size));
if ( phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] < 0)
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband]=0;
/*
......@@ -456,21 +451,22 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],
phy_vars_ue->PHY_measurements.n0_power[aarx]);
}
else {
else { // this is for the last subband which is smaller in size
// for (i=0;i<12;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,12) + signal_energy_nodc(dl_ch1,12)); // - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,last_subband_size) +
signal_energy_nodc(dl_ch1,last_subband_size)); // - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband] += phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband];
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],
phy_vars_ue->PHY_measurements.n0_power[aarx]);
}
dl_ch1+=48;
dl_ch0+=48;
dl_ch1+=subband_size;
dl_ch0+=subband_size;
// msg("subband_cqi[%d][%d][%d] => %d (%d dB)\n",eNB_id,aarx,subband,phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband]);
}
}
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
// msg("subband_cqi_tot[%d][%d] => %d dB (n0 %d)\n",eNB_id,subband,phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
}
......@@ -488,7 +484,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
}
#endif
*/
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
// pmi
......@@ -497,7 +493,11 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
pmi128_im = _mm_xor_si128(pmi128_im,pmi128_im);
// limit is the number of groups of 4 REs in a subband (12 = 4 RBs, 3 = 1 RB)
// for 5 MHz channelization, there are 7 subbands, 6 of size 4 RBs and 1 of size 1 RB
limit = (subband < 6) ? 12 : 3;
if ((N_RB_DL==6) || (subband<(nb_subbands-1)))
limit = subband_size>>2;
else
limit = last_subband_size>>2;
for (i=0;i<limit;i++) {
// For each RE in subband perform ch0 * conj(ch1)
......@@ -582,13 +582,13 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
// msg("subband_cqi[%d][%d][%d] => %d (%d dB)\n",eNB_id,aarx,subband,phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband]);
}
}
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
}
}
phy_vars_ue->PHY_measurements.rank[eNB_id] = 0;
for (i=0;i<NUMBER_OF_SUBBANDS;i++) {
for (i=0;i<nb_subbands;i++) {
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB_id][i] = 0;
if (frame_parms->nb_antennas_rx>1) {
if (phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][0][i] >= phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][1][i])
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1536,21 +1536,21 @@ uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t s
*/
uint8_t phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe);;
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id);
void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL);
void extract_CQI(void *o,UCI_format_t uci_format,LTE_eNB_UE_stats *stats,uint16_t * crnti, uint8_t * access_mode);
void fill_CQI(void *o,UCI_format_t uci_format,PHY_MEASUREMENTS *meas,uint8_t eNB_id, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id, int N_RB_DL, rnti_t rnti, uint8_t trans_mode,double sinr_eff);
void reset_cba_uci(void *o);
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id);
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id);
uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands);
uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id,int nb_subbands);
uint32_t pmi2hex_2Ar1(uint16_t pmi);
uint64_t pmi2hex_2Ar1(uint32_t pmi);
uint32_t pmi2hex_2Ar2(uint8_t pmi);
uint64_t pmi2hex_2Ar2(uint32_t pmi);
uint32_t cqi2hex(uint16_t cqi);
uint64_t cqi2hex(uint32_t cqi);
uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
......
......@@ -264,10 +264,10 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
else
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch->o,ulsch->uci_format,meas,eNB_id,0, transmission_mode,phy_vars_ue->sinr_eff);
fill_CQI(ulsch,meas,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL,0, transmission_mode,phy_vars_ue->sinr_eff);
if (((phy_vars_ue->frame_tx % 100) == 0) || (phy_vars_ue->frame_tx < 10))
print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
print_CQI(ulsch->o,ulsch->uci_format,eNB_id,phy_vars_ue->lte_frame_parms.N_RB_DL);
}
else {
ulsch->O_RI = 0;
......
......@@ -42,6 +42,63 @@ typedef enum {
unknown_cqi//
} UCI_format_t;
// **********************************************1.5 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:16;
uint32_t pmi:12;
uint32_t cqi1:4;
} wideband_cqi_rank1_2A_1_5MHz ;
#define sizeof_wideband_cqi_rank1_2A_1_5MHz 16
typedef struct __attribute__((packed)) {
uint16_t padding:2;
uint16_t pmi:6;
uint16_t cqi2:4;
uint16_t cqi1:4;
} wideband_cqi_rank2_2A_1_5MHz ;
#define sizeof_wideband_cqi_rank2_2A_1_5MHz 14
typedef struct __attribute__((packed)) {
uint32_t padding:16;
uint32_t diffcqi1:12;
uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_1_5MHz;
#define sizeof_HLC_subband_cqi_nopmi_1_5MHz 16
typedef struct __attribute__((packed)) {
uint32_t padding:14;
uint32_t pmi:2;
uint32_t diffcqi1:12;
uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_1_5MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_1_5MHz 18
typedef struct __attribute__((packed)) {
uint64_t padding:31;
uint64_t pmi:1;
uint64_t diffcqi2:12;
uint64_t cqi2:4;
uint64_t diffcqi1:12;
uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_1_5MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_1_5MHz 33
typedef struct __attribute__((packed)) {
uint32_t padding:16;
uint32_t diffcqi1:12;
uint32_t cqi1:4;
} HLC_subband_cqi_modes123_1_5MHz;
#define sizeof_HLC_subband_cqi_modes123_1_5MHz 16
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t crnti:16;
uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_1_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz 20
// **********************************************5 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:14;
uint32_t pmi:14;
......@@ -96,10 +153,119 @@ typedef struct __attribute__((packed)) {
} HLC_subband_cqi_mcs_CBA_5MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_5MHz 20
// **********************************************10 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:10;
uint32_t pmi:18;
uint32_t cqi1:4;
} wideband_cqi_rank1_2A_10MHz ;
#define sizeof_wideband_cqi_rank1_2A_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:15;
uint32_t pmi:9;
uint32_t cqi2:4;
uint32_t cqi1:4;
} wideband_cqi_rank2_2A_10MHz ;
#define sizeof_wideband_cqi_rank2_2A_10MHz 17
typedef struct __attribute__((packed)) {
uint32_t padding:10;
uint32_t diffcqi1:18;
uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_10MHz;
#define sizeof_HLC_subband_cqi_nopmi_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:8;
uint32_t pmi:2;
uint32_t diffcqi1:18;
uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_10MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_10MHz 24
typedef struct __attribute__((packed)) {
uint64_t padding:19;
uint64_t pmi:1;
uint64_t diffcqi2:18;
uint64_t cqi2:4;
uint64_t diffcqi1:18;
uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_10MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_10MHz 45
typedef struct __attribute__((packed)) {
uint32_t padding:10;
uint32_t diffcqi1:18;
uint32_t cqi1:4;
} HLC_subband_cqi_modes123_10MHz;
#define sizeof_HLC_subband_cqi_modes123_10MHz 22
typedef struct __attribute__((packed)) {
uint32_t padding:12;
uint32_t crnti:16;
uint32_t mcs:4;
} HLC_subband_cqi_mcs_CBA_10MHz;
#define sizeof_HLC_subband_cqi_mcs_CBA_10MHz 20
// **********************************************20 MHz***************************************************************************
typedef struct __attribute__((packed)) {
uint32_t padding:2;
uint32_t pmi:26;
uint32_t cqi1:4;
} wideband_cqi_rank1_2A_20MHz ;
#define sizeof_wideband_cqi_rank1_2A_20MHz 20
typedef struct __attribute__((packed)) {
uint32_t padding:11;
uint32_t pmi:13;
uint32_t cqi2:4;
uint32_t cqi1:4;
} wideband_cqi_rank2_2A_20MHz ;
#define sizeof_wideband_cqi_rank2_2A_20MHz 21
typedef struct __attribute__((packed)) {
uint32_t padding:2;
uint32_t diffcqi1:26;
uint32_t cqi1:4;
} HLC_subband_cqi_nopmi_20MHz;
#define sizeof_HLC_subband_cqi_nopmi_20MHz 30
typedef struct __attribute__((packed)) {
// uint32_t padding:12;
uint32_t pmi:2;
uint32_t diffcqi1:26;
uint32_t cqi1:4;
} HLC_subband_cqi_rank1_2A_20MHz;
#define sizeof_HLC_subband_cqi_rank1_2A_20MHz 32
typedef struct __attribute__((packed)) {
uint64_t padding:3;
uint64_t pmi:1;
uint64_t diffcqi2:26;
uint64_t cqi2:4;
uint64_t diffcqi1:26;
uint64_t cqi1:4;
} HLC_subband_cqi_rank2_2A_20MHz;
#define sizeof_HLC_subband_cqi_rank2_2A_20MHz 61
typedef struct __attribute__((packed)) {
uint32_t padding:2;
uint32_t diffcqi1:26;
uint32_t cqi1:4;
} HLC_subband_cqi_modes123_20MHz;
#define sizeof_HLC_subband_cqi_modes123_20MHz 30
typedef