Files
openairinterface5g/openair1/PHY/MODULATION/beamforming.c
T
makiandClaude Opus 4.7 7cd72323af Merge antenna muting mechanism onto 2026.w17
Brings the O-RAN compliant antenna muting feature (originally introduced
on the 'new' branch) onto the latest upstream 2026.w17 tag.

Files added:
  openair1/PHY/NR_TRANSPORT/nr_antenna_state.{c,h}
  openair1/PHY/NR_TRANSPORT/nr_antenna_control.{c,h}

Files modified (integration hooks):
  CMakeLists.txt, executables/nr-gnb.c
  openair1/PHY/INIT/nr_init.c, openair1/PHY/defs_gNB.h
  openair1/PHY/MODULATION/{beamforming.c,nr_modulation.h,nr_beamforming.c}
  openair1/SCHED_NR/nr_ru_procedures.c
  openair2/LAYER2/NR_MAC_gNB/mac_proto.h
  openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_{primitives,dlsch,uci}.c

Conflicts resolved:
  - defs_gNB.h: kept upstream's new headers + appended antenna_state.h
  - nr_init.c: dropped reference to upstream-removed nr_srs_info init,
    kept nr_init_antenna_state() call
  - beamforming.c: upstream moved nr_beam_precoding into new file
    nr_beamforming.c; nr_beam_precoding_with_muting added there with
    upstream's signature (no slot param)
  - nr_modulation.h: aligned _with_muting decl to upstream signature
  - nr_ru_procedures.c: muting check applied around upstream's new
    fft_shift in nr_feptx, and around per-port memcpy in nr_feptx_prec
  - gNB_scheduler_uci.c: SINR-based MCS hint uses get_dl_nrOfLayers(NULL,
    sched_ctrl, ...) since nrmac is not in scope at the call site
  - mac_proto.h: get_dl_nrOfLayers signature updated to take gNB_MAC_INST*

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 06:25:57 +09:00

83 lines
3.0 KiB
C

/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
#include "PHY/defs_common.h"
#include "PHY/defs_eNB.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/coding_extern.h"
#include "PHY/CODING/lte_interleaver_inline.h"
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
#include "modulation_eNB.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "PHY/NR_TRANSPORT/nr_antenna_state.h"
int beam_precoding(int32_t **txdataF,
int32_t **txdataF_BF,
int subframe,
LTE_DL_FRAME_PARMS *frame_parms,
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
int symbol,
int aa,
int p,
int l1_id)
{
int rb_offset_neg0 = frame_parms->ofdm_symbol_size - (6*frame_parms->N_RB_DL);
int rb_offset_neg = (subframe*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti) + rb_offset_neg0;
int rb_offset_pos = (subframe*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti);
multadd_cpx_vector((c16_t *)&txdataF[p][rb_offset_neg + (symbol * frame_parms->ofdm_symbol_size)],
(c16_t *)&beam_weights[l1_id][p][aa][rb_offset_neg0],
(c16_t *)&txdataF_BF[aa][rb_offset_neg0 + (symbol * frame_parms->ofdm_symbol_size)],
6 * frame_parms->N_RB_DL,
15);
multadd_cpx_vector(
(c16_t *)&txdataF[p][rb_offset_pos + (symbol * frame_parms->ofdm_symbol_size)],
(c16_t *)&beam_weights[l1_id][p][aa][0],
(c16_t *)&txdataF_BF[aa][(symbol * frame_parms->ofdm_symbol_size)],
7 * frame_parms->N_RB_DL, // to allow for extra RE at the end, 12 useless multipy-adds (first one at DC and 11 at end)
15);
return 0;
}
int beam_precoding_one_eNB(int32_t **txdataF,
int32_t **txdataF_BF,
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15],
int subframe,
int nb_antenna_ports,
int nb_tx, // total physical antenna
LTE_DL_FRAME_PARMS *frame_parms
)
{
int p, symbol, aa; // loop index
int re_offset;
int ofdm_symbol_size = frame_parms->ofdm_symbol_size;
int symbols_per_tti = frame_parms->symbols_per_tti;
int nb_antenna_ports_eNB = frame_parms->nb_antenna_ports_eNB; // logic antenna ports
re_offset = ofdm_symbol_size*symbols_per_tti*subframe;
// txdataF_BF[aa][re] = sum(beam_weghts[p][aa][re]*txdataF[p][re]), p=0~nb_antenna_ports-1
// real part and image part need to compute separately
for (aa=0; aa<nb_tx; aa++) {
memset(txdataF_BF[aa],0,sizeof(int32_t)*(ofdm_symbol_size*symbols_per_tti));
for(p=0;p<nb_antenna_ports;p++){
if (p<nb_antenna_ports_eNB || p==5){
for (symbol=0; symbol<symbols_per_tti; symbol++){
multadd_cpx_vector((c16_t *)&txdataF[p][symbol * ofdm_symbol_size + re_offset],
(c16_t *)beam_weights[0][p][aa],
(c16_t *)&txdataF_BF[aa][symbol * ofdm_symbol_size],
ofdm_symbol_size,
15);
}
}
}
}
return 0;
}