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) {
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 (p=0;p<15;p++) {
if (p == 0|| p==5) {
for (p=0;p<fp->Lmax;p++) {
if ((fp->L_ssb >> p) & 0x01) {
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
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));
// antenna ports 0-3 are mapped on antennas 0-3
// antenna port 4 is mapped on antenna 0
// antenna ports 5-14 are mapped on all antennas
if (((p<4) && (p==j)) || ((p==4) && (j==0))) {
// setting identity matrix as first step for beam weights
if (p==j) {
for (re=0; re<fp->ofdm_symbol_size; re++)
{
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++)
{
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]);
}
ru->beam_weights[i][p][j][re] = 0x00000000;
}
//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=0
} // if (p<ru
} // for p
} // for j
} // for p
}
} //for i
} // !=IF5
ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_subframe_wCP );
return(0);
......
......@@ -105,19 +105,21 @@ int nr_beam_precoding(int32_t **txdataF,
uint8_t p;
int slot_offset_F;
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);
// 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));
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],
(int16_t*)beam_weights[p][aa],
(int16_t*)&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],
0,
frame_parms->ofdm_symbol_size,
15);
}
}
return 0;
}
......@@ -446,10 +446,8 @@ typedef struct RU_t_s{
time_stats_t transport;
/// RX and TX buffers for precoder output
RU_COMMON common;
/// beamforming weight vectors per eNB
/// beamforming weight vectors
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)
int16_t **prach_rxsigF;
/// 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) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
}
else {
bw = ru->nrbeam_weights[0];
bw = ru->beam_weights[0];
for (l=0;l<fp->symbols_per_slot;l++) {
for (aa=0;aa<ru->nb_tx;aa++) {
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