Enable beamforming for 2 tx antenna ports and fix corresponding segmentation error
This commit is contained in:
committed by
Thomas Schlichter
parent
e72d0483b4
commit
58f4f155cc
@@ -125,7 +125,7 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
int beam_count = 0;
|
||||
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1
|
||||
for (p=0;p<ru->nb_log_antennas;p++) {
|
||||
if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
|
||||
//if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
|
||||
beam_count++;
|
||||
}
|
||||
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
|
||||
@@ -133,7 +133,7 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
int l_ind = 0;
|
||||
for (i=0; i<RC.nb_nr_L1_inst; i++) {
|
||||
for (p=0;p<ru->nb_log_antennas;p++) {
|
||||
if ((fp->L_ssb >> (63-p)) & 0x01) {
|
||||
//if ((fp->L_ssb >> (63-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));
|
||||
@@ -142,8 +142,8 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
//printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
|
||||
l_ind++;
|
||||
} // for j
|
||||
} // for p
|
||||
}
|
||||
//}
|
||||
} // for p
|
||||
} //for i
|
||||
}
|
||||
} // !=IF5
|
||||
|
||||
@@ -145,7 +145,8 @@ int nr_beam_precoding(int32_t **txdataF,
|
||||
int slot,
|
||||
int symbol,
|
||||
int aa,
|
||||
int nb_antenna_ports)
|
||||
int nb_antenna_ports,
|
||||
int offset)
|
||||
{
|
||||
|
||||
|
||||
@@ -155,14 +156,14 @@ int nr_beam_precoding(int32_t **txdataF,
|
||||
memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
|
||||
|
||||
for (p=0; p<nb_antenna_ports; p++) {
|
||||
if ((frame_parms->L_ssb >> (63-p)) & 0x01) {
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*frame_parms->ofdm_symbol_size],
|
||||
//if ((frame_parms->L_ssb >> (63-p)) & 0x01) {
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][(symbol*frame_parms->ofdm_symbol_size)+offset],
|
||||
(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;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,8 @@ int nr_beam_precoding(int32_t **txdataF,
|
||||
int slot,
|
||||
int symbol,
|
||||
int aa,
|
||||
int nb_antenna_ports
|
||||
int nb_antenna_ports,
|
||||
int offset
|
||||
);
|
||||
|
||||
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
|
||||
|
||||
@@ -285,7 +285,6 @@ static void *nr_feptx_thread(void *param) {
|
||||
NR_DL_FRAME_PARMS *fp;
|
||||
int ofdm_mask_full;
|
||||
int txdataF_offset;
|
||||
int32_t *txdataF;
|
||||
while (!oai_exit) {
|
||||
ret = 0;
|
||||
if (wait_on_condition(&feptx->mutex_feptx,&feptx->cond_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break;
|
||||
@@ -314,16 +313,16 @@ static void *nr_feptx_thread(void *param) {
|
||||
}
|
||||
else {
|
||||
bw = ru->beam_weights[0];
|
||||
txdataF = &ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset];
|
||||
for(i=0; i<fp->symbols_per_slot>>1; ++i){
|
||||
nr_beam_precoding(&txdataF,
|
||||
nr_beam_precoding(ru->gNB_list[0]->common_vars.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
fp,
|
||||
bw,
|
||||
slot,
|
||||
l+i,
|
||||
aa,
|
||||
ru->nb_log_antennas);
|
||||
ru->nb_log_antennas,
|
||||
txdataF_offset);//here
|
||||
}
|
||||
}
|
||||
stop_meas(&ru->precoding_stats);
|
||||
@@ -362,7 +361,8 @@ static void *nr_feptx_thread(void *param) {
|
||||
slot,
|
||||
l,
|
||||
aa,
|
||||
nb_antenna_ports);
|
||||
ru->nb_log_antennas,
|
||||
0);
|
||||
}
|
||||
stop_meas(&ru->precoding_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 0);
|
||||
@@ -485,7 +485,8 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
tti_tx,
|
||||
l,
|
||||
aa,
|
||||
ru->nb_log_antennas);
|
||||
ru->nb_log_antennas,
|
||||
0);
|
||||
}// for (aa=0;aa<ru->nb_tx;aa++)
|
||||
}// for (l=0;l<fp->symbols_per_slot;l++)
|
||||
}// if (ru->nb_tx == 1)
|
||||
|
||||
@@ -249,11 +249,11 @@ RUs = (
|
||||
max_rxgain = 75;
|
||||
eNB_instances = [0];
|
||||
##beamforming 1x2 matrix: 1 layer x 2 antennas
|
||||
bf_weights = [0x00007fff, 0x00007fff];
|
||||
#bf_weights = [0x00007fff, 0x00007fff];
|
||||
##beamforming 1x4 matrix: 1 layer x 4 antennas
|
||||
#bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
|
||||
## beamforming 2x2 matrix:
|
||||
# bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
|
||||
bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user