Commit 1d3023a5 authored by Francesco Mani's avatar Francesco Mani

adapting beamforming functions from LTE to NR

parent 2d35c286
...@@ -1607,7 +1607,7 @@ extern void fep_full(RU_t *ru,int slot); ...@@ -1607,7 +1607,7 @@ extern void fep_full(RU_t *ru,int slot);
extern void ru_fep_full_2thread(RU_t *ru,int slot); extern void ru_fep_full_2thread(RU_t *ru,int slot);
extern void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx); extern void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
extern void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx); extern void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
extern void feptx_prec(RU_t *ru, int frame_tx,int tti_tx); extern void nr_feptx_prec(RU_t *ru, int frame_tx,int tti_tx);
extern void init_fep_thread(RU_t *ru); extern void init_fep_thread(RU_t *ru);
extern void init_nr_feptx_thread(RU_t *ru); extern void init_nr_feptx_thread(RU_t *ru);
...@@ -1990,7 +1990,7 @@ void set_function_spec_param(RU_t *ru) { ...@@ -1990,7 +1990,7 @@ void set_function_spec_param(RU_t *ru) {
ru->do_prach = 0; // no prach processing in RU ru->do_prach = 0; // no prach processing in RU
ru->feprx = (get_nprocs()<=2) ? fep_full : ru_fep_full_2thread; // RX DFTs ru->feprx = (get_nprocs()<=2) ? fep_full : ru_fep_full_2thread; // RX DFTs
ru->feptx_ofdm = (get_nprocs()<=2) ? nr_feptx_ofdm : nr_feptx_ofdm_2thread; // this is fep with idft and precoding ru->feptx_ofdm = (get_nprocs()<=2) ? nr_feptx_ofdm : nr_feptx_ofdm_2thread; // this is fep with idft and precoding
ru->feptx_prec = feptx_prec; // this is fep with idft and precoding ru->feptx_prec = nr_feptx_prec; // this is fep with idft and precoding
ru->fh_north_in = NULL; // no incoming fronthaul from north ru->fh_north_in = NULL; // no incoming fronthaul from north
ru->fh_north_out = NULL; // no outgoing fronthaul to north ru->fh_north_out = NULL; // no outgoing fronthaul to north
ru->start_if = NULL; // no if interface ru->start_if = NULL; // no if interface
...@@ -2019,7 +2019,7 @@ void set_function_spec_param(RU_t *ru) { ...@@ -2019,7 +2019,7 @@ void set_function_spec_param(RU_t *ru) {
case REMOTE_IF5: // the remote unit is IF5 RRU case REMOTE_IF5: // the remote unit is IF5 RRU
ru->do_prach = 0; ru->do_prach = 0;
ru->feprx = (get_nprocs()<=2) ? fep_full : fep_full; // this is frequency-shift + DFTs ru->feprx = (get_nprocs()<=2) ? fep_full : fep_full; // this is frequency-shift + DFTs
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs ru->feptx_prec = nr_feptx_prec; // need to do transmit Precoding + IDFTs
ru->feptx_ofdm = (get_nprocs()<=2) ? nr_feptx_ofdm : nr_feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs ru->feptx_ofdm = (get_nprocs()<=2) ? nr_feptx_ofdm : nr_feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
...@@ -2043,7 +2043,7 @@ void set_function_spec_param(RU_t *ru) { ...@@ -2043,7 +2043,7 @@ void set_function_spec_param(RU_t *ru) {
case REMOTE_IF4p5: case REMOTE_IF4p5:
ru->do_prach = 0; ru->do_prach = 0;
ru->feprx = NULL; // DFTs ru->feprx = NULL; // DFTs
ru->feptx_prec = feptx_prec; // Precoding operation ru->feptx_prec = nr_feptx_prec; // Precoding operation
ru->feptx_ofdm = NULL; // no OFDM mod ru->feptx_ofdm = NULL; // no OFDM mod
ru->fh_south_in = fh_if4p5_south_in; // synchronous IF4p5 reception ru->fh_south_in = fh_if4p5_south_in; // synchronous IF4p5 reception
ru->fh_south_out = fh_if4p5_south_out; // synchronous IF4p5 transmission ru->fh_south_out = fh_if4p5_south_out; // synchronous IF4p5 transmission
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/LTE_TRANSPORT/transport_eNB.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h"
#include "modulation_eNB.h" #include "modulation_eNB.h"
#include "nr_modulation.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
int beam_precoding(int32_t **txdataF, int beam_precoding(int32_t **txdataF,
...@@ -89,3 +90,34 @@ int beam_precoding(int32_t **txdataF, ...@@ -89,3 +90,34 @@ int beam_precoding(int32_t **txdataF,
} }
return 0; return 0;
} }
int nr_beam_precoding(int32_t **txdataF,
int32_t **txdataF_BF,
NR_DL_FRAME_PARMS *frame_parms,
int32_t ***beam_weights,
int slot,
int symbol,
int aa)
{
uint8_t p;
int slot_offset_F;
int nb_antenna_ports = 1; // TODO get the actual value
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++) {
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;
}
...@@ -80,4 +80,13 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, ...@@ -80,4 +80,13 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
*/ */
void nr_dft(int32_t *z,int32_t *d, uint32_t Msc_PUSCH); void nr_dft(int32_t *z,int32_t *d, uint32_t Msc_PUSCH);
int nr_beam_precoding(int32_t **txdataF,
int32_t **txdataF_BF,
NR_DL_FRAME_PARMS *frame_parms,
int32_t ***beam_weights,
int slot,
int symbol,
int aa);
#endif #endif
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "PHY/phy_extern.h" #include "PHY/phy_extern.h"
#include "sched_nr.h" #include "sched_nr.h"
#include "PHY/MODULATION/modulation_common.h" #include "PHY/MODULATION/modulation_common.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
...@@ -125,12 +125,6 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -125,12 +125,6 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
if (nr_slot_select(cfg,slot) == SF_UL) return; if (nr_slot_select(cfg,slot) == SF_UL) return;
// this copy should be done in the precoding thread (currently inactive)
for (int aa=0;aa<ru->nb_tx;aa++)
memcpy((void*)ru->common.txdataF_BF[aa],
(void*)ru->gNB_list[0]->common_vars.txdataF[aa], fp->samples_per_slot_wCP*sizeof(int32_t));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
if (nr_slot_select(cfg,slot)==SF_DL) { if (nr_slot_select(cfg,slot)==SF_DL) {
...@@ -227,11 +221,6 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -227,11 +221,6 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
start_meas(&ru->ofdm_mod_stats); start_meas(&ru->ofdm_mod_stats);
// this copy should be done in the precoding thread (currently inactive)
for (int aa=0;aa<ru->nb_tx;aa++)
memcpy((void*)ru->common.txdataF_BF[aa],
(void*)ru->gNB_list[0]->common_vars.txdataF[aa], fp->samples_per_slot_wCP*sizeof(int32_t));
if ((nr_slot_select(cfg,slot)==SF_DL)|| if ((nr_slot_select(cfg,slot)==SF_DL)||
((nr_slot_select(cfg,slot)==SF_S))) { ((nr_slot_select(cfg,slot)==SF_S))) {
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot); // LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
...@@ -248,3 +237,39 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) { ...@@ -248,3 +237,39 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF))); dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF)));
} }
void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) {
int l,aa;
NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
int32_t ***bw;
if (ru->nb_tx == 1) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
memcpy((void*)ru->common.txdataF_BF[0],
(void*)ru->gNB_list[0]->common_vars.txdataF[0][tti_tx*fp->symbols_per_slot*fp->ofdm_symbol_size],
fp->samples_per_slot_wCP*sizeof(int32_t));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
}
else {
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,
ru->common.txdataF_BF,
fp,
bw,
tti_tx,
l,
aa);
}
}
}
}
...@@ -45,7 +45,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx); ...@@ -45,7 +45,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols); void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols);
void nr_init_feptx_thread(RU_t *ru); void nr_init_feptx_thread(RU_t *ru);
void fep_full(RU_t *ru,int slot); void fep_full(RU_t *ru,int slot);
void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
int nr_phy_init_RU(RU_t *ru); int nr_phy_init_RU(RU_t *ru);
void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params, void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
......
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