Commit 1da3b555 authored by Khodr Saaifan's avatar Khodr Saaifan Committed by Thomas Schlichter

implement TM4 into PDSCH and make format2 coherency more stable

parent d42485d7
......@@ -1046,6 +1046,7 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_uespec_pilots = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0_tm4 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_bf_ch_estimates = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
......@@ -1054,6 +1055,8 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
//pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_mag0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_mag0_tm4 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_magb0_tm4 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// the allocated memory size is fixed:
......@@ -1068,6 +1071,9 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->rxdataF_uespec_pilots[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * fp->N_RB_DL*12);
pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->rxdataF_comp0_tm4[idx] =(int32_t*)malloc16_clear( sizeof(int32_t) * 2 *num );
pdsch->dl_ch_mag0_tm4[idx] =(int32_t*)malloc16_clear( sizeof(int32_t) * 2 *num );
pdsch->dl_ch_magb0_tm4[idx] =(int32_t*)malloc16_clear( sizeof(int32_t) * 2 *num );
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_bf_ch_estimates[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * fp->ofdm_symbol_size*7*2);
pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
......
......@@ -544,19 +544,17 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
eNB_id=0;
/*SFN:
/*Khodr Saaifan:
* Rank Estimation:
* We shall control the function according to ue->transmission_mode[eNB_id]
* where ue->transmission_mode[eNB_id]=3 or 4 for TM3/TM4
* We activate it as a feature for 2X2 MIMO
*
* */
#ifdef FHG_TM4
if ((frame_parms->nb_antennas_rx>1) && (frame_parms->nb_antenna_ports_eNB>1))
rank_tm3_tm4 = rank_estimation_tm3_tm4(&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][4],
&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][4],//2
&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][4],//1
&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][4],//3
N_RB_DL);
#endif
ue->measurements.rank[eNB_id] = rank_tm3_tm4;
......@@ -814,7 +812,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7));*/
} // if frame_parms->mode1_flag == 0
else //SFN: we need still to fix here for SISO
else //SFN: we fix SISO measurements
{
// cqi information only for mode 1
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......@@ -829,23 +827,27 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
if (subband<6) {
// for (i=0;i<48;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
ue->measurements.subband_cqi[eNB_id][aarx][subband] =
(signal_energy_nodc(dl_ch0,48)) - ue->measurements.n0_power[aarx];
ue->measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,48));
if (ue->measurements.subband_cqi[eNB_id][aarx][subband]<0)
ue->measurements.subband_cqi[eNB_id][aarx][subband] =0;
ue->measurements.subband_cqi_tot[eNB_id][subband] += ue->measurements.subband_cqi[eNB_id][aarx][subband];
ue->measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(ue->measurements.subband_cqi[eNB_id][aarx][subband],
ue->measurements.n0_power[aarx]);
if (aarx==(frame_parms->nb_antennas_rx-1))
ue->measurements.subband_cqi_tot[eNB_id][subband] /=frame_parms->nb_antennas_rx;
ue->measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(ue->measurements.subband_cqi[eNB_id][aarx][subband],
ue->measurements.n0_power[aarx]);
} else {
// 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)]);
ue->measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,12) ) - ue->measurements.n0_power[aarx];
ue->measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,12) );
if (ue->measurements.subband_cqi[eNB_id][aarx][subband]<0)
ue->measurements.subband_cqi[eNB_id][aarx][subband] =0;
ue->measurements.subband_cqi_tot[eNB_id][subband] += ue->measurements.subband_cqi[eNB_id][aarx][subband];
if (aarx==(frame_parms->nb_antennas_rx-1))
ue->measurements.subband_cqi_tot[eNB_id][subband] /=frame_parms->nb_antennas_rx;
ue->measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(ue->measurements.subband_cqi[eNB_id][aarx][subband],
ue->measurements.n0_power[aarx]);
}
......@@ -856,8 +858,9 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
}
for (subband=0; subband<nb_subbands; subband++) {
ue->measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(ue->measurements.subband_cqi_tot[eNB_id][subband],ue->measurements.n0_power_tot);
}
ue->measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(ue->measurements.subband_cqi_tot[eNB_id][subband],ue->measurements.n0_power_tot);
// msg("subband_cqi_tot[%d][%d] => %d dB (n0 %d)\n",eNB_id,subband,ue->measurements.subband_cqi_tot_dB[eNB_id][subband],ue->measurements.n0_power_tot);
}
}
//ue->measurements.rank[eNB_id] = 0;
......
......@@ -3592,7 +3592,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
ra_rnti = ue->prach_resources[eNB_id]->ra_RNTI;
// Now check UE_SPEC format0/1A ue_spec search spaces at aggregation 8
// printf("[DCI search] Format 0/1A aggregation 8\n");
// printf("[DCI search] Format 0/1A aggregation 1\n");
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3694,7 +3694,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt == 0)
{
// Now check UE_SPEC format 0 search spaces at aggregation 1
// Now check UE_SPEC format 0 search spaces at aggregation 8
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3726,7 +3726,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
//printf("[DCI search] Format 0 aggregation 8 dci_cnt %d\n",dci_cnt);
}
// These are for CRNTI based on transmission mode
// These are for CRNTI based on transmission mode //KhodrSaaifan
if ((tmode < 3) || (tmode == 7)) {
// Now check UE_SPEC format 1 search spaces at aggregation 1
old_dci_cnt=dci_cnt;
......@@ -3754,12 +3754,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 1 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff) ||
/* if ((CCEmap0==0xffff) ||
(format_c_found==1))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
// Now check UE_SPEC format 1 search spaces at aggregation 2
old_dci_cnt=dci_cnt;
......@@ -3787,12 +3787,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 2 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff)||
/*if ((CCEmap0==0xffff)||
(format_c_found==1))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
// Now check UE_SPEC format 1 search spaces at aggregation 4
old_dci_cnt=dci_cnt;
......@@ -3820,12 +3819,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 4 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff)||
/*if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
//#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 1 search spaces at aggregation 8
......@@ -3854,12 +3852,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 8 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff)||
/*if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
//#endif //ALL_AGGREGATION
/* sfn: Enable Format2 seaching in UE space
......@@ -3877,7 +3874,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
0,
3,
format1A,
format1A,
format1A,
......@@ -3910,7 +3907,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
1,
2,
format1A,
format1A,
format1A,
......@@ -3943,7 +3940,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
2,
1,
format1A,
format1A,
format1A,
......@@ -3977,7 +3974,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
3,
0,
format1A,
format1A,
format1A,
......
This diff is collapsed.
......@@ -660,7 +660,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0)
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);// In the case of TM4 Nl=2, len should be multiplied by N_l
else
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else if((beamforming_mode==7) && (frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12)){
......@@ -668,7 +668,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
} else if((beamforming_mode==7) && (frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==10)){
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
} else {
len = (nb_rb*12) - pbch_pss_sss_adjust;
len = (nb_rb*12) - pbch_pss_sss_adjust;// In the case of TM4 Nl=2, len should be multiplied by N_l
}
......@@ -693,6 +693,50 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
return(0);
}
int dlsch_qpsk_llr_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
uint8_t beamforming_mode,
uint8_t Nl)
{
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*frame_parms->N_RB_DL*12*Nl)];
uint32_t *llr32;
int i,len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
llr32 = (uint32_t*)dlsch_llr;
if (!llr32) {
msg("dlsch_qpsk_llr: llr is null, symbol %d, llr32=%p\n",symbol, llr32);
return(-1);
}
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0)
len = Nl*((nb_rb*8) - (2*pbch_pss_sss_adjust/3));// In the case of TM4 Nl=2, len should be multiplied by N_l
else
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else if((beamforming_mode==7) && (frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12)){
len = (nb_rb*9) - (3*pbch_pss_sss_adjust/4);
} else if((beamforming_mode==7) && (frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==10)){
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
} else {
len = Nl*((nb_rb*12) - pbch_pss_sss_adjust);// In the case of TM4 Nl=2, len should be multiplied by N_l
}
for (i=0; i<len; i++) {
*llr32 = *rxF;
rxF++;
llr32++;
}
return(0);
}
int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int32_t **sic_buffer, //Q15
......@@ -930,6 +974,91 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
_m_empty();
#endif
}
//KhodrSaaifan
void dlsch_16qam_llr_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
int16_t **llr32p,
uint8_t beamforming_mode,
uint8_t Nl)
{
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12*Nl)];
__m128i *ch_mag;
__m128i llr128[2];//Array of 128bit variable
uint32_t *llr32;
int i,len;
unsigned char symbol_mod,len_mod4=0;
if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr;//point to LLR[0]
} else {
llr32 = (uint32_t*)*llr32p;//update LLR pointer according to previous
}
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12*Nl)];
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0)
len = ((nb_rb*8) - (2*pbch_pss_sss_adjust/3))*Nl;
else
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else if((beamforming_mode==7) && (frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12)){
len = (nb_rb*9) - (3*pbch_pss_sss_adjust/4);
} else if((beamforming_mode==7) && (frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==10)){
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
} else {
len = ((nb_rb*12) - pbch_pss_sss_adjust)*Nl;
}
// update output pointer according to number of REs in this symbol (<<2 because 4 bits per RE)
if (first_symbol_flag == 1)
*llr32p = dlsch_llr + (len<<2);//Update for next time with Qm 4 bits
else
*llr32p += (len<<2);
// printf("len=%d\n", len);
len_mod4 = len&3;//in REs
// printf("len_mod4=%d\n", len_mod4);
len>>=2; // length in quad words (4 REs)
// printf("len>>=2=%d\n", len);
len+=(len_mod4==0 ? 0 : 1);
// printf("len+=%d\n", len);
for (i=0; i<len; i++) {//Number of REs/4
xmm0 = _mm_abs_epi16(rxF[i]);//|I0| |Q0| |I1| |Q1| |I2| |Q2| |I3| |Q3|
xmm0 = _mm_subs_epi16(ch_mag[i],xmm0);//|h|^2-|I0| |h|^2-|Q0| |h|^2-|I1| |h|^2-|Q1| |h|^2-|I2| |h|^2-|Q2| |h|^2-|I3| |h|^2-|Q3|
// lambda_1=y_R, lambda_2=|y_R|-|h|^2, lamda_3=y_I, lambda_4=|y_I|-|h|^2
llr128[0] = _mm_unpacklo_epi32(rxF[i],xmm0);//upacking low 64 bits
llr128[1] = _mm_unpackhi_epi32(rxF[i],xmm0);//upacking high 64 bits
//////////////////////////////////////////////////////
llr32[0] = _mm_extract_epi32(llr128[0],0); //((uint32_t *)&llr128[0])[0];
llr32[1] = _mm_extract_epi32(llr128[0],1); //((uint32_t *)&llr128[0])[1];
llr32[2] = _mm_extract_epi32(llr128[0],2); //((uint32_t *)&llr128[0])[2];
llr32[3] = _mm_extract_epi32(llr128[0],3); //((uint32_t *)&llr128[0])[3];
llr32[4] = _mm_extract_epi32(llr128[1],0); //((uint32_t *)&llr128[1])[0];
llr32[5] = _mm_extract_epi32(llr128[1],1); //((uint32_t *)&llr128[1])[1];
llr32[6] = _mm_extract_epi32(llr128[1],2); //((uint32_t *)&llr128[1])[2];
llr32[7] = _mm_extract_epi32(llr128[1],3); //((uint32_t *)&llr128[1])[3];
llr32+=8;
}
_mm_empty();
_m_empty();
#endif
}
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
......@@ -1206,7 +1335,114 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
_m_empty();
#endif
}
//KhodrSaaifan
void dlsch_64qam_llr_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
int32_t **dl_ch_magb,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
//int16_t **llr_save,
uint32_t llr_offset,
uint8_t beamforming_mode,uint8_t Nl)
{
#if defined(__x86_64__) || defined(__i386__)
__m128i *rxF = (__m128i*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12*Nl)];
__m128i *ch_mag,*ch_magb;
int i,len,len2;
unsigned char symbol_mod,len_mod4;
short *llr;
int16_t *llr2;
llr = dlsch_llr;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
ch_mag = (__m128i*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12*Nl)];
ch_magb = (__m128i*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12*Nl)];
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==0)
len = ((nb_rb*8) - (2*pbch_pss_sss_adjust/3))*Nl;
else
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else if((beamforming_mode==7) && (frame_parms->Ncp==0) && (symbol==3 || symbol==6 || symbol==9 || symbol==12)){
len = (nb_rb*9) - (3*pbch_pss_sss_adjust/4);
} else if((beamforming_mode==7) && (frame_parms->Ncp==1) && (symbol==4 || symbol==7 || symbol==10)){
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
} else {
len = ((nb_rb*12) - pbch_pss_sss_adjust)*Nl;
}
llr2 = llr;
llr += (len*6);
len_mod4 =len&3;
len2=len>>2; // length in quad words (4 REs)
len2+=((len_mod4==0)?0:1);
for (i=0; i<len2; i++) {
xmm1 = _mm_abs_epi16(rxF[i]);
xmm1 = _mm_subs_epi16(ch_mag[i],xmm1);
xmm2 = _mm_abs_epi16(xmm1);
xmm2 = _mm_subs_epi16(ch_magb[i],xmm2);
llr2[0] = ((short *)&rxF[i])[0];
llr2[1] = ((short *)&rxF[i])[1];
llr2[2] = _mm_extract_epi16(xmm1,0);
llr2[3] = _mm_extract_epi16(xmm1,1);//((short *)&xmm1)[j+1];
llr2[4] = _mm_extract_epi16(xmm2,0);//((short *)&xmm2)[j];
llr2[5] = _mm_extract_epi16(xmm2,1);//((short *)&xmm2)[j+1];
llr2+=6;
llr2[0] = ((short *)&rxF[i])[2];
llr2[1] = ((short *)&rxF[i])[3];
llr2[2] = _mm_extract_epi16(xmm1,2);
llr2[3] = _mm_extract_epi16(xmm1,3);//((short *)&xmm1)[j+1];
llr2[4] = _mm_extract_epi16(xmm2,2);//((short *)&xmm2)[j];
llr2[5] = _mm_extract_epi16(xmm2,3);//((short *)&xmm2)[j+1];
llr2+=6;
llr2[0] = ((short *)&rxF[i])[4];
llr2[1] = ((short *)&rxF[i])[5];
llr2[2] = _mm_extract_epi16(xmm1,4);
llr2[3] = _mm_extract_epi16(xmm1,5);//((short *)&xmm1)[j+1];
llr2[4] = _mm_extract_epi16(xmm2,4);//((short *)&xmm2)[j];
llr2[5] = _mm_extract_epi16(xmm2,5);//((short *)&xmm2)[j+1];
llr2+=6;
llr2[0] = ((short *)&rxF[i])[6];
llr2[1] = ((short *)&rxF[i])[7];
llr2[2] = _mm_extract_epi16(xmm1,6);
llr2[3] = _mm_extract_epi16(xmm1,7);//((short *)&xmm1)[j+1];
llr2[4] = _mm_extract_epi16(xmm2,6);//((short *)&xmm2)[j];
llr2[5] = _mm_extract_epi16(xmm2,7);//((short *)&xmm2)[j+1];
llr2+=6;
}
_mm_empty();
_m_empty();
#endif
}
//#if 0
void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
......
......@@ -529,9 +529,10 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
if (ue->transmission_mode[eNB] == 6)
len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,ue->measurements.precoded_cqi_dB[eNB][0]);
for (harq_pid=0;harq_pid<8;harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs);
len += sprintf(&buffer[len], "/***************/\n");
for (harq_pid=0;harq_pid<8;harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:\n",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs);
len += sprintf(&buffer[len], "eNB %d: MIMO Mode = %d, Nl = %d, nb_rb = %d TBS = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mimo_mode==15? 4 : 2,ue->dlsch[0][0][0]->harq_processes[harq_pid]->Nl,ue->dlsch[0][0][0]->harq_processes[harq_pid]->nb_rb,ue->dlsch[0][0][0]->harq_processes[harq_pid]->TBS);
for (round=0;round<8;round++)
len+=sprintf(&buffer[len],"%d/%d ",
ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round],
......@@ -543,7 +544,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[0]->dl_power_off);
for (harq_pid=0;harq_pid<8;harq_pid++) {
for (harq_pid=0;harq_pid<8;harq_pid++) {
len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs);
for (round=0;round<8;round++)
len+=sprintf(&buffer[len],"%d/%d ",
......
......@@ -826,7 +826,16 @@ int32_t dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adj,
//int16_t **llr128p,
uint8_t beamforming_mode);
//KhodrSaaifan
int dlsch_qpsk_llr_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
uint8_t beamforming_mode,
uint8_t Nl);
/**
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
@param frame_parms Frame descriptor structure
......@@ -862,6 +871,18 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t pbch_pss_sss_adjust,
int16_t **llr128p,
uint8_t beamforming_mode);
//KhodrSaaifan
void dlsch_16qam_llr_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
int16_t **llr128p,
uint8_t beamforming_mode,
uint8_t Nl);
/**
\brief This function generates log-likelihood ratios (decoder input) for single-stream 16QAM received waveforms
@param frame_parms Frame descriptor structure
......@@ -914,6 +935,21 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint32_t llr_offset,
uint8_t beamforming_mode);
//KhodrSaaifan
void dlsch_64qam_llr_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
int32_t **dl_ch_magb,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
//int16_t **llr_save,
uint32_t llr_offset,
uint8_t beamforming_mode,
uint8_t Nl);
/** \fn dlsch_siso(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
......@@ -955,6 +991,30 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t symbol,
uint16_t nb_rb);
/** \fn KhodrSaaifan: dlsch_postcoding_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int32_t **dl_ch_mag,
int32_t **dl_ch_magb,
uint8_t symbol,
uint16_t nb_rb)
\brief This function does Alamouti combining on RX and prepares LLR inputs by skipping pilots, PBCH and primary/secondary synchronization signals.
@param frame_parms Frame descriptor structure
@param rxdataF_comp Compensated channel output
@param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position
@param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position
@param symbol Symbol in sub-frame
@param nb_rb Number of RBs in this allocation
*/
void dlsch_postcoding_tm4(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp,
int **dl_ch_mag,
int **dl_ch_magb,
int **rxdataF_comp_tm4,
int **dl_ch_mag_tm4,
int **dl_ch_magb_tm4,
uint8_t symbol,
uint16_t nb_rb, uint8_t N_l);
/** \fn dlsch_antcyc(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int32_t **dl_ch_mag,
......
......@@ -614,7 +614,9 @@ typedef enum {
DUALSTREAM_PUSCH_PRECODING=11,
TM7=12,
TM8=13,
TM9_10=14
TM9_10=14,
////sfn: test TM4
TM4_NO_PRECODING=15
} MIMO_mode_t;
typedef enum {
......@@ -850,6 +852,10 @@ typedef struct {
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..168*N_RB_DL[
int32_t **rxdataF_comp0;
/// \brief Received frequency-domain signal after extraction and channel compensation.
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..N_l*168*N_RB_DL[
int32_t **rxdataF_comp0_tm4;
/// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
/// - second index: ? [0..7] (hard coded) accessed via \c round
......@@ -887,7 +893,11 @@ typedef struct {
int32_t **dl_ch_mag0;
/// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..168*N_RB_DL[
/// - second index: ? [0..N_l*168*N_RB_DL[
int32_t **dl_ch_mag0_tm4;
/// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..168*N_RB_DL[
int32_t **dl_ch_mag1[8][8];
/// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
......@@ -895,6 +905,10 @@ typedef struct {
int32_t **dl_ch_magb0;
/// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..N_l*168*N_RB_DL[
int32_t **dl_ch_magb0_tm4;
/// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
/// - second index: ? [0..168*N_RB_DL[
int32_t **dl_ch_magb1[8][8];
/// \brief Cross-correlation of two eNB signals.
......
......@@ -313,7 +313,7 @@ void nas_COMMON_receive(uint16_t dlen,
printk("\n");
#endif //NAS_DEBUG_RECEIVE
netif_rx(skb);
netif_rx_ni(skb);
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_RECEIVE: end\n");
#endif
......
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