Commit 47634381 authored by Xiwen JIANG's avatar Xiwen JIANG

bug fixed for ue_spec_bf_weights initialisation

parent 208e4d7e
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
......
......@@ -1357,18 +1357,6 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
#endif
}
/*for (i=0; i<2; i++) { // 2 is the total number of cell specific antenna ports
eNB_common_vars->cell_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#ifdef DEBUG_PUY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->cell_spec_bf_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->cell_spec_bf_weights[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif
}
} */
for (i=0; i<15; i++) { // 15 is the total number of antenna ports
eNB_common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) {
......@@ -1383,18 +1371,6 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
}
}
/*for (i=0; i<8; i++) { //antenna port 5 for TM7, antenna port 7-15 for TM8-10
eNB_common_vars->ue_spec_bf_weights[eNB_id][i] = (int32_t **)malloc16_clear(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<frame_parms->nb_antennas_tx; j++) {
eNB_common_vars->ue_spec_bf_weights[eNB_id][i][j] = (int32_t*)malloc16_clear(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#ifdef DEBUG_PUY
msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->ue_spec_bf_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,eNB_common_vars->ue_spec_bf_weights[eNB_id][i][j],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
#endif
}
} */
// RX vars
eNB_common_vars->rxdata[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*) );
eNB_common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16(frame_parms->nb_antennas_rx*sizeof(int32_t*) );
......
......@@ -708,7 +708,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
}
} //aarx
//printf("[dlsch bf ch est]: dl_bf_estimates[0][600] %d, %d \n",*(short *)&dl_bf_ch_estimates[0][600],*(short*)&phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0][600]);
// printf("[dlsch bf ch est]: dl_bf_estimates[0][600] %d, %d \n",*(short *)&dl_bf_ch_estimates[0][600],*(short*)&phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0][600]);
return(0);
......
......@@ -204,14 +204,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
put_harq_pid_in_freelist(dlsch, i);
}
for (i=0; i<4; i++) {
dlsch->ue_spec_bf_weights[i] = (int32_t **)malloc16(nb_antennas_tx*sizeof(int32_t*));
for (aa=0; aa<nb_antennas_tx; aa++) {
dlsch->ue_spec_bf_weights[i][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
}
}
if (exit_flag==0) {
for (i=0; i<Mdlharq; i++) {
dlsch->harq_processes[i]->round=0;
......
......@@ -91,16 +91,18 @@ int beam_precoding(int32_t **txdataF,
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[5][aa][re])[0])>>15);
// printf("beamforming.c:txdata[%d][%d]=%d+j%d, beam_weights[%d][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
// p,slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
// ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
// ((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
// p,aa,re,
// ((int16_t*)&beam_weights[p][aa][re])[0],((int16_t*)&beam_weights[p][aa][re])[1],
// aa,re,
// ((int16_t*)&txdataF_BF[aa][re])[0],
// ((int16_t*)&txdataF_BF[aa][re])[1]);
/*
printf("beamforming.c:txdata[5][%d]=%d+j%d, beam_weights[5][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re,
((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0],
((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1],
aa,re,
((int16_t*)&beam_weights[5][aa][re])[0],
((int16_t*)&beam_weights[5][aa][re])[1],
aa,re,
((int16_t*)&txdataF_BF[aa][re])[0],
((int16_t*)&txdataF_BF[aa][re])[1]);
*/
}
}
......
......@@ -2557,10 +2557,21 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
if ((slot_rx%2)==1) // odd slots
phy_vars_ue->dlsch_ue[eNB_id][0]->active = 0;
}
}
#endif
if (phy_vars_ue->dlsch_ue[eNB_id][0]->active == 1) {
if (phy_vars_ue->transmission_mode[eNB_id]==7) {
if (phy_vars_ue->lte_frame_parms.Ncp==0) {
if (((slot_rx%2)==0 && ((l==3) || (l==6))) || ((slot_rx%2)==1 && ((l==2) || (l==5))))
lte_dl_bf_channel_estimation(phy_vars_ue,eNB_id,0,slot_rx,5,l+7*(slot_rx%2==1));
} else {
LOG_E(PHY,"[UE %d]Beamforming channel estimation not supported yet for TM7 extented CP.\n",phy_vars_ue->Mod_id);
}
}
}
// process last DLSCH symbols + invoke decoding
if (((slot_rx%2)==0) && (l==0)) {
// Regular PDSCH
......
......@@ -119,7 +119,8 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0,transmission_mode=1,n_tx_port=1,n_tx_phy=1,n_rx=1;
uint16_t Nid_cell=0;
int32_t **ue_spec_bf_weights, **cell_spec_bf_weights;
int32_t **cell_spec_bf_weights;
int32_t *ue_spec_bf_weights;
int eNB_id = 0, eNB_id_i = 1;
unsigned char mcs1=0,mcs2=0,mcs_i=0,dual_stream_UE = 0,awgn_flag=0,round,dci_flag=0;
......@@ -932,23 +933,31 @@ int main(int argc, char **argv)
exit(-1);
} else {
// this initilisation may should be moved to another place
for (j=0; j<4; j++) { // antenna port 5,7-14
for (j=0; j<4; j++) {
PHY_vars_eNB->dlsch_eNB[k][i]->ue_spec_bf_weights[j] = (int32_t **)malloc16(n_tx_phy*sizeof(int32_t*));
for (aa=0; aa<n_tx_phy; aa++) {
PHY_vars_eNB->dlsch_eNB[k][i]->ue_spec_bf_weights[j][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
ue_spec_bf_weights = PHY_vars_eNB->dlsch_eNB[k][i]->ue_spec_bf_weights[j][aa];
for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
if (n_tx_phy==1 || n_tx_phy==2)
ue_spec_bf_weights[re] = 0x00007fff;
else if (n_tx_phy==4 || n_tx_phy==8)
ue_spec_bf_weights[re] = 0x00007fff>>1;
else if (n_tx_phy==16)
ue_spec_bf_weights[re] = 0x00007fff>>2;
else if (n_tx_phy==64)
ue_spec_bf_weights[re] = 0x00007fff>>4;
}
}
}
ue_spec_bf_weights = PHY_vars_eNB->dlsch_eNB[k][i]->ue_spec_bf_weights[j];
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
for (re=0;re<frame_parms->ofdm_symbol_size;re++) {
if (n_tx_phy==1 || n_tx_phy==2)
ue_spec_bf_weights[aa][re] = 0x00007fff;
else if (n_tx_phy==4 || n_tx_phy==8)
ue_spec_bf_weights[aa][re] = 0x00007fff>>1;
else if (n_tx_phy==16)
ue_spec_bf_weights[aa][re] = 0x00007fff>>2;
else if (n_tx_phy==64)
ue_spec_bf_weights[aa][re] = 0x00007fff>>4;
}
}
}
}
PHY_vars_eNB->dlsch_eNB[k][i]->rnti = n_rnti+k;
......
......@@ -53,7 +53,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t abstraction_flag)
{
int i,j;
int i,j,layer,aa,re;
PHY_VARS_eNB* PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
memset(PHY_vars_eNB,0,sizeof(PHY_VARS_eNB));
PHY_vars_eNB->Mod_id=eNB_id;
......@@ -79,6 +79,18 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
} else {
LOG_D(PHY,"dlsch_eNB[%d][%d] => %p\n",i,j,PHY_vars_eNB->dlsch_eNB[i][j]);
PHY_vars_eNB->dlsch_eNB[i][j]->rnti=0;
for (layer=0; layer<4; layer++) {
PHY_vars_eNB->dlsch_eNB[i][j]->ue_spec_bf_weights[layer] = (int32_t **)malloc16(frame_parms->nb_antennas_tx*sizeof(int32_t*));
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
PHY_vars_eNB->dlsch_eNB[i][j]->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
for (re=0;re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
PHY_vars_eNB->dlsch_eNB[i][j]->ue_spec_bf_weights[layer][aa][re] = 0x00007fff;
}
}
}
}
}
......
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