Commit 794aac41 authored by Francesco Mani's avatar Francesco Mani

initializing beam_weights to I

parent c97cd87d
...@@ -106,35 +106,26 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -106,35 +106,26 @@ int nr_phy_init_RU(RU_t *ru) {
LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst); LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst);
for (i=0; i<RC.nb_nr_L1_inst; i++) { for (i=0; i<RC.nb_nr_L1_inst; i++) {
for (p=0;p<15;p++) { for (p=0;p<fp->Lmax;p++) {
if (p == 0|| p==5) { if ((fp->L_ssb >> p) & 0x01) {
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
for (j=0; j<ru->nb_tx; j++) { for (j=0; j<ru->nb_tx; j++) {
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
// antenna ports 0-3 are mapped on antennas 0-3 // setting identity matrix as first step for beam weights
// antenna port 4 is mapped on antenna 0 if (p==j) {
// antenna ports 5-14 are mapped on all antennas
if (((p<4) && (p==j)) || ((p==4) && (j==0))) {
for (re=0; re<fp->ofdm_symbol_size; re++) for (re=0; re<fp->ofdm_symbol_size; re++)
{
ru->beam_weights[i][p][j][re] = 0x00007fff; ru->beam_weights[i][p][j][re] = 0x00007fff;
//LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d][%d][%d] = %d\n", i,p,j,re,ru->beam_weights[i][p][j][re]);
}
} }
else if (p>4) { else {
for (re=0; re<fp->ofdm_symbol_size; re++) for (re=0; re<fp->ofdm_symbol_size; re++)
{ ru->beam_weights[i][p][j][re] = 0x00000000;
ru->beam_weights[i][p][j][re] = 0x00007fff/ru->nb_tx;
//LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d][%d][%d] = %d\n", i,p,j,re,ru->beam_weights[i][p][j][re]);
}
} }
//LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d] = %p (%lu bytes)\n", i,j,ru->beam_weights[i][p][j], fp->ofdm_symbol_size*sizeof(int32_t)); } // for j
} // for (j=0 } // for p
} // if (p<ru }
} // for p
} //for i } //for i
} // !=IF5 } // !=IF5
ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_subframe_wCP ); ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_subframe_wCP );
return(0); return(0);
......
...@@ -105,19 +105,21 @@ int nr_beam_precoding(int32_t **txdataF, ...@@ -105,19 +105,21 @@ int nr_beam_precoding(int32_t **txdataF,
uint8_t p; uint8_t p;
int slot_offset_F; int slot_offset_F;
int nb_antenna_ports = frame_parms->Lmax; // for now logical antenna ports corresponds to SSB int nb_antenna_ports = frame_parms->Lmax; // for now logical antenna ports corresponds to SSB
slot_offset_F = slot*(frame_parms->ofdm_symbol_size)*(frame_parms->symbols_per_slot); slot_offset_F = slot*(frame_parms->ofdm_symbol_size)*(frame_parms->symbols_per_slot);
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming // clear txdata_BF[aa][re] for each call of ue_spec_beamforming
memset(txdataF_BF[aa],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size)); memset(txdataF_BF[aa],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
for (p=0; p<nb_antenna_ports; p++) { for (p=0; p<nb_antenna_ports; p++) {
if ((frame_parms->L_ssb >> p) & 0x01) {
multadd_cpx_vector((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size], multadd_cpx_vector((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size],
(int16_t*)beam_weights[p][aa], (int16_t*)beam_weights[p][aa],
(int16_t*)&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size], (int16_t*)&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],
0, 0,
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15);
}
} }
return 0; return 0;
} }
...@@ -446,10 +446,8 @@ typedef struct RU_t_s{ ...@@ -446,10 +446,8 @@ typedef struct RU_t_s{
time_stats_t transport; time_stats_t transport;
/// RX and TX buffers for precoder output /// RX and TX buffers for precoder output
RU_COMMON common; RU_COMMON common;
/// beamforming weight vectors per eNB /// beamforming weight vectors
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15]; int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15];
/// beamforming weight vectors per eNB
int32_t **nrbeam_weights[NUMBER_OF_gNB_MAX+1][16];
/// received frequency-domain signal for PRACH (IF4p5 RRU) /// received frequency-domain signal for PRACH (IF4p5 RRU)
int16_t **prach_rxsigF; int16_t **prach_rxsigF;
/// received frequency-domain signal for PRACH BR (IF4p5 RRU) /// received frequency-domain signal for PRACH BR (IF4p5 RRU)
......
...@@ -257,8 +257,7 @@ void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) { ...@@ -257,8 +257,7 @@ void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
} }
else { else {
bw = ru->beam_weights[0];
bw = ru->nrbeam_weights[0];
for (l=0;l<fp->symbols_per_slot;l++) { for (l=0;l<fp->symbols_per_slot;l++) {
for (aa=0;aa<ru->nb_tx;aa++) { for (aa=0;aa<ru->nb_tx;aa++) {
nr_beam_precoding(ru->gNB_list[0]->common_vars.txdataF, nr_beam_precoding(ru->gNB_list[0]->common_vars.txdataF,
......
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