Commit e0d4bfcf authored by gabrielC's avatar gabrielC

20 MHz UE fix

parent 70e7cde3
...@@ -3356,7 +3356,7 @@ ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a)); ...@@ -3356,7 +3356,7 @@ ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
//compute average channel_level on each (TX,RX) antenna pair //compute average channel_level on each (TX,RX) antenna pair
void dlsch_channel_level(int **dl_ch_estimates_ext, void dlsch_channel_level(int **dl_ch_estimates_ext,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int *avg, int32_t *avg,
uint8_t symbol, uint8_t symbol,
unsigned short nb_rb) unsigned short nb_rb)
{ {
...@@ -3365,10 +3365,16 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, ...@@ -3365,10 +3365,16 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
short rb; short rb;
unsigned char aatx,aarx,nre=12,symbol_mod; unsigned char aatx,aarx,nre=12,symbol_mod;
__m128i *dl_ch128, avg128D; __m128i *dl_ch128, avg128D, coeff128;
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
float one_over_nb_re = 0;
one_over_nb_re = 1/(nb_rb *12);
int16_t one_over_nb_re_q1_15 = (int16_t)(one_over_nb_re * (float)(1<<15) );
coeff128 = _mm_set_epi16(one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15,
one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15,one_over_nb_re_q1_15);
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++)
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
//clear average level //clear average level
...@@ -3380,8 +3386,9 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, ...@@ -3380,8 +3386,9 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
for (rb=0;rb<nb_rb;rb++) { for (rb=0;rb<nb_rb;rb++) {
// printf("rb %d : ",rb); // printf("rb %d : ",rb);
// print_shorts("ch",&dl_ch128[0]); // print_shorts("ch",&dl_ch128[0]);
avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],dl_ch128[0])); avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[0],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[0], coeff128),15)));
avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],dl_ch128[1])); avg128D = _mm_add_epi32(avg128D,_mm_madd_epi16(dl_ch128[1],_mm_srai_epi16(_mm_mulhi_epi16(dl_ch128[1], coeff128),15)));
if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->mode1_flag==0)) { if (((symbol_mod == 0) || (symbol_mod == (frame_parms->Ncp-1)))&&(frame_parms->mode1_flag==0)) {
dl_ch128+=2; dl_ch128+=2;
} }
...@@ -3405,10 +3412,10 @@ void dlsch_channel_level(int **dl_ch_estimates_ext, ...@@ -3405,10 +3412,10 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
else else
nre=12; nre=12;
avg[(aatx<<1)+aarx] = (((int*)&avg128D)[0] + avg[(aatx<<1)+aarx] =(((int32_t*)&avg128D)[0] +
((int*)&avg128D)[1] + ((int32_t*)&avg128D)[1] +
((int*)&avg128D)[2] + ((int32_t*)&avg128D)[2] +
((int*)&avg128D)[3])/(nb_rb*nre); ((int32_t*)&avg128D)[3]);
// printf("Channel level : %d\n",avg[(aatx<<1)+aarx]); // printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
} }
......
...@@ -1048,7 +1048,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1048,7 +1048,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
int overflow=0; int overflow=0;
int k,l; int k,l;
int dummy_tx_buffer[3840*4] __attribute__((aligned(16))); int dummy_tx_buffer[frame_parms->samples_per_tti] __attribute__((aligned(16)));
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_IN);
...@@ -1081,12 +1081,16 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1081,12 +1081,16 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
overflow = ulsch_start - 9*frame_parms->samples_per_tti; overflow = ulsch_start - 9*frame_parms->samples_per_tti;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
memset(&ue->common_vars.txdata[aa][ulsch_start],0, if (overflow > 0)
4*cmin(frame_parms->samples_per_tti-overflow,frame_parms->samples_per_tti)); {
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*(frame_parms->samples_per_tti-overflow));
if (overflow> 0)
memset(&ue->common_vars.txdata[aa][0],0,4*overflow); memset(&ue->common_vars.txdata[aa][0],0,4*overflow);
} }
else
{
memset(&ue->common_vars.txdata[aa][ulsch_start],0,4*frame_parms->samples_per_tti);
}
}
/*#else /*#else
overflow = ulsch_start - 9*frame_parms->samples_per_tti; overflow = ulsch_start - 9*frame_parms->samples_per_tti;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
...@@ -1480,7 +1484,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1480,7 +1484,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d Generating ACK (%d,%d) for %d bits on PUSCH\n", LOG_D(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d Generating ACK (%d,%d) for %d bits on PUSCH\n",
Mod_id, Mod_id,
ue->ulsch[eNB_id]->rnti, ue->ulsch[eNB_id]->rnti,
frame_tx,subframe_tx, frame_tx%1024,subframe_tx,
ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1], ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1],
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK); ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK);
} }
...@@ -1644,8 +1648,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1644,8 +1648,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id),T_INT(Mod_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb));
#endif #endif
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n", LOG_D(PHY,"[UE %d][PUSCH %d] AbsSubFrame %d.%d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
Mod_id,harq_pid,frame_tx,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp); Mod_id,harq_pid,frame_tx%1024,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp);
start_meas(&ue->ulsch_modulation_stats); start_meas(&ue->ulsch_modulation_stats);
ulsch_modulation(ue->common_vars.txdataF, ulsch_modulation(ue->common_vars.txdataF,
tx_amp, tx_amp,
...@@ -1943,7 +1947,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1943,7 +1947,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
(uint8_t *)&pucch_payload, (uint8_t *)&pucch_payload,
&len); &len);
LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n", frame_tx, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]); LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n",
frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]);
// Part - IV // Part - IV
......
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