Commit 6103c758 authored by Florian Kaltenberger's avatar Florian Kaltenberger

handling beamforming also for PDSCH

parent 8e6e814d
...@@ -759,7 +759,11 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -759,7 +759,11 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
// bit 11 enables the gpio programming // bit 11 enables the gpio programming
// currently we switch beams every 10 slots (should = 1 TDD period in FR2) and we take the beam index of the first symbol of the first slot of this period // currently we switch beams every 10 slots (should = 1 TDD period in FR2) and we take the beam index of the first symbol of the first slot of this period
int beam=0; int beam=0;
if (slot%10==0) beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] & 8; if (slot%10==0) {
if (ru->common.beam_id[0][slot*fp->symbols_per_slot] < 8) {
beam = ru->common.beam_id[0][slot*fp->symbols_per_slot] & 8;
}
}
/* /*
if (slot==0 || slot==40) beam=0&8; if (slot==0 || slot==40) beam=0&8;
if (slot==10 || slot==50) beam=1&8; if (slot==10 || slot==50) beam=1&8;
......
...@@ -333,7 +333,25 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, ...@@ -333,7 +333,25 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
} // symbol loop } // symbol loop
}// layer loop }// layer loop
dlsch->slot_tx[slot]=0; dlsch->slot_tx[slot]=0;
// TODO: handle precoding
// this maps the layers onto antenna ports
// handle beamforming ID
// each antenna port is assigned a beam_index
// since PHY can only handle BF on slot basis we set the whole slot
// first check if this slot has not already been allocated to another beam
if (gNB->common_vars.beam_id[0][slot*frame_parms->symbols_per_slot]!=255) {
for (int j=0;j<frame_parms->symbols_per_slot;j++)
gNB->common_vars.beam_id[0][slot*frame_parms->symbols_per_slot+j] = rel15->precodingAndBeamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx;
}
else {
LOG_W(PHY,"beam index for PDSCH allocation already taken\n");
}
}// dlsch loop }// dlsch loop
return 0; return 0;
} }
......
...@@ -160,9 +160,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, ...@@ -160,9 +160,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
if (do_meas==1) start_meas(&gNB->phy_proc_tx); if (do_meas==1) start_meas(&gNB->phy_proc_tx);
// clear the transmit data array for the current subframe // clear the transmit data array and beam index for the current slot
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) { for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t)); memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t));
memset(&gNB->common_vars.beam_id[aa][slot*fp->symbols_per_slot],255,fp->symbols_per_slot*sizeof(uint8_t));
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1);
......
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