mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Merge remote-tracking branch 'origin/oran_beamforming' into integration_2025_w43 (!3605)
Support beam index in OAI 7.2 Fronthaul Interface This branch supports beam index in OAI 7.2 Fronthaul Interface. - For CP DL (PDSCH), nBeamIndex of the corresponding prbMapElm is set when sending IQ data in oran_fh_if4p5_south_out. nBeamIndex of the corresponding prbMapElm is set when sending IQ data in oran_fh_if4p5_south_out. - For CP UL (PUSCH and PRACH), nBeamIndex of the corresponding prbMapElm is set in oran_fh_if4p5_south_out. In addition, it fixes a couple of issues - XRAN hardcodes nBeamIndex of PRACH to zero. Modify XRAN to support setting of nBeamIndex of PRACH and update xran F release patch. - Fix the bug in calculating fh_config->neAxc where num_beams_period is multiplified twice Testing methodology: Use Benetel O_RU for testing even though it does not support beamforming. With successful registration and data transfer, one could check the pcap on the fronthaul interface to see if CP packets are with the right beam index. Results: 1. Verified that CP-packets for SSB, DCI, PDSCH, PRACH, PDSCH, PUSCH, CSI-RS and SRS are with the right beam index 2. Verified that there is no side-effect on Benetel O_RU. UE could register properly. 3. Verified 4 SSB with ssb_PositionsInBurst_Bitmap = 85. Could see SSB and PRACH with 4 different indices.
This commit is contained in:
@@ -17,7 +17,7 @@ add_library(oran_fhlib_5g MODULE
|
||||
)
|
||||
|
||||
set(E_VERSION 5.1.6)
|
||||
set(F_VERSION 6.1.4)
|
||||
set(F_VERSION 6.1.5)
|
||||
|
||||
find_package(xran REQUIRED)
|
||||
if(xran_VERSION VERSION_EQUAL E_VERSION)
|
||||
|
||||
@@ -259,7 +259,14 @@ static bool is_tdd_ul_symbol(const struct xran_frame_config *frame_conf, int slo
|
||||
* slot is not UL). */
|
||||
static bool is_tdd_dl_guard_slot(const struct xran_frame_config *frame_conf, int slot)
|
||||
{
|
||||
return !is_tdd_ul_symbol(frame_conf, slot, XRAN_NUM_OF_SYMBOL_PER_SLOT - 1);
|
||||
return !is_tdd_ul_symbol(frame_conf, slot, 0);
|
||||
}
|
||||
|
||||
/** @brief Check if current slot is UL or guard/mixed without UL (i.e., current
|
||||
* slot is not UL). */
|
||||
static bool is_tdd_ul_guard_slot(const struct xran_frame_config *frame_conf, int slot)
|
||||
{
|
||||
return is_tdd_ul_symbol(frame_conf, slot, XRAN_NUM_OF_SYMBOL_PER_SLOT - 1);
|
||||
}
|
||||
|
||||
/** @details Read PRACH and PUSCH data from xran buffers. If
|
||||
@@ -337,7 +344,7 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
|
||||
start_ptr = rx_data + (slot_size * slot_offset_rxdata);
|
||||
const struct xran_frame_config *frame_conf = &get_xran_fh_config(ant_id / nb_rx_per_ru)->frame_conf;
|
||||
// skip processing this slot is TX (no RX in this slot)
|
||||
if (is_tdd_dl_guard_slot(frame_conf, *slot))
|
||||
if (!is_tdd_ul_guard_slot(frame_conf, *slot))
|
||||
continue;
|
||||
// This loop would better be more inner to avoid confusion and maybe also errors.
|
||||
for (int32_t sym_idx = 0; sym_idx < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_idx++) {
|
||||
@@ -484,12 +491,70 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
int nPRBs = fh_cfg->nDLRBs;
|
||||
int fftsize = 1 << fh_cfg->ru_conf.fftSize;
|
||||
int nb_tx_per_ru = ru->nb_tx / fh_init->xran_ports;
|
||||
int nb_rx_per_ru = ru->nb_rx / fh_init->xran_ports;
|
||||
|
||||
// Handle CP UL packet here instead of at xran_fh_rx_read_slot() as oran_fh_if4p5_south_in() lags behind
|
||||
// oran_fh_if4p5_south_out() (which is invoked at the right time slot) by 4 slots.
|
||||
// Need to use --continuous-tx so that this routine will be triggered in RX slot.
|
||||
for (uint16_t cc_id = 0; cc_id < 1 /*nSectorNum*/; cc_id++) { // OAI does not support multiple CC yet.
|
||||
for (uint8_t ant_id = 0; ant_id < ru->nb_rx; ant_id++) {
|
||||
int first = 1; // The first UL symbol
|
||||
const struct xran_frame_config *frame_conf = &get_xran_fh_config(ant_id / nb_rx_per_ru)->frame_conf;
|
||||
// skip processing this slot is TX (no RX in this slot)
|
||||
if (!is_tdd_ul_guard_slot(frame_conf, slot)) {
|
||||
continue;
|
||||
}
|
||||
// This loop would better be more inner to avoid confusion and maybe also errors.
|
||||
for (int32_t sym_idx = 0; sym_idx < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_idx++) {
|
||||
/* the callback is for mixed and UL slots. In mixed, we have to
|
||||
* skip DL and guard symbols. */
|
||||
if (!is_tdd_ul_symbol(frame_conf, slot, sym_idx)) {
|
||||
continue;
|
||||
}
|
||||
oran_buf_list_t *bufs = get_xran_buffers(ant_id / nb_rx_per_ru);
|
||||
uint8_t *pPrbMapData = bufs->dstcp[ant_id % nb_rx_per_ru][tti % XRAN_N_FE_BUF_LEN].pBuffers->pData;
|
||||
struct xran_prb_map *pPrbMap = (struct xran_prb_map *)pPrbMapData;
|
||||
|
||||
struct xran_prb_elm *pRbElm = &pPrbMap->prbMap[0];
|
||||
|
||||
struct xran_prb_map *pRbMap = pPrbMap;
|
||||
uint32_t idxElm = 0;
|
||||
|
||||
LOG_D(HW, "pRbMap->nPrbElm %d\n", pRbMap->nPrbElm);
|
||||
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
|
||||
LOG_D(HW, "prbMap[%d] : PRBstart %d nPRBs %d\n", idxElm, pRbMap->prbMap[idxElm].nRBStart, pRbMap->prbMap[idxElm].nRBSize);
|
||||
pRbElm = &pRbMap->prbMap[idxElm];
|
||||
if (first) {
|
||||
// ant_id / no of antenna per beam gives the beam_nb
|
||||
pRbElm->nBeamIndex =
|
||||
ru->beam_id[ant_id / (ru->nb_rx / ru->num_beams_period)][slot * XRAN_NUM_OF_SYMBOL_PER_SLOT + sym_idx];
|
||||
// In phy-f-1.0/fhi_lib/lib/api/xran_pkt_cp.h, beamId:15 is of 15bit. -1 set extension bit ef:1 to 1 mistakenly.
|
||||
if (pRbElm->nBeamIndex == -1) {
|
||||
pRbElm->nBeamIndex = 0;
|
||||
} else {
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (uint16_t cc_id = 0; cc_id < 1 /*nSectorNum*/; cc_id++) { // OAI does not support multiple CC yet.
|
||||
for (uint8_t ant_id = 0; ant_id < ru->nb_tx; ant_id++) {
|
||||
oran_buf_list_t *bufs = get_xran_buffers(ant_id / nb_tx_per_ru);
|
||||
const struct xran_frame_config *frame_conf = &get_xran_fh_config(ant_id / nb_tx_per_ru)->frame_conf;
|
||||
// skip processing this slot is TX (no TX in this slot)
|
||||
if (!is_tdd_dl_guard_slot(frame_conf, slot)) {
|
||||
continue;
|
||||
}
|
||||
// This loop would better be more inner to avoid confusion and maybe also errors.
|
||||
for (int32_t sym_idx = 0; sym_idx < XRAN_NUM_OF_SYMBOL_PER_SLOT; sym_idx++) {
|
||||
/* the callback is for mixed and UL slots. In mixed, we have to
|
||||
* skip UL and guard symbols. */
|
||||
if (is_tdd_ul_symbol(frame_conf, slot, sym_idx)) {
|
||||
continue;
|
||||
}
|
||||
uint8_t *pData =
|
||||
bufs->src[ant_id % nb_tx_per_ru][tti % XRAN_N_FE_BUF_LEN].pBuffers[sym_idx % XRAN_NUM_OF_SYMBOL_PER_SLOT].pData;
|
||||
uint8_t *pPrbMapData = bufs->srccp[ant_id % nb_tx_per_ru][tti % XRAN_N_FE_BUF_LEN].pBuffers->pData;
|
||||
@@ -512,6 +577,14 @@ int xran_fh_tx_send_slot(ru_info_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
for (idxElm = 0; idxElm < pRbMap->nPrbElm; idxElm++) {
|
||||
struct xran_section_desc *p_sec_desc = NULL;
|
||||
p_prbMapElm = &pRbMap->prbMap[idxElm];
|
||||
if (sym_idx == 0) {
|
||||
// ant_id / no of antenna per beam gives the beam_nb
|
||||
p_prbMapElm->nBeamIndex = ru->beam_id[ant_id / (ru->nb_tx / ru->num_beams_period)][slot * XRAN_NUM_OF_SYMBOL_PER_SLOT];
|
||||
// In phy-f-1.0/fhi_lib/lib/api/xran_pkt_cp.h, beamId:15 is of 15bit. -1 set extension bit ef:1 to 1 mistakenly.
|
||||
if (p_prbMapElm->nBeamIndex == -1)
|
||||
p_prbMapElm->nBeamIndex = 0;
|
||||
}
|
||||
|
||||
// assumes one fragment per symbol
|
||||
#ifdef E_RELEASE
|
||||
p_sec_desc = p_prbMapElm->p_sec_desc[sym_id][0];
|
||||
|
||||
@@ -918,7 +918,7 @@ static bool set_fh_config(void *mplane_api, int ru_idx, int num_rus, enum xran_c
|
||||
fh_config->dpdk_port = ru_idx; // DPDK port number used for FH
|
||||
fh_config->sector_id = 0; // Band sector ID for FH; not used in xran
|
||||
fh_config->nCC = 1; // number of Component carriers supported on FH; M-plane info
|
||||
fh_config->neAxc = RTE_MAX(oai0->num_distributed_ru * oai0->tx_num_channels / num_rus, oai0->num_distributed_ru * oai0->rx_num_channels / num_rus); // number of eAxc supported on one CC = max(PDSCH, PUSCH)
|
||||
fh_config->neAxc = RTE_MAX(oai0->tx_num_channels / num_rus, oai0->rx_num_channels / num_rus); // number of eAxc supported on one CC = max(PDSCH, PUSCH)
|
||||
fh_config->neAxcUl = 0; // number of eAxc supported on one CC for UL direction = PUSCH; used only if XRAN_CATEGORY_B
|
||||
fh_config->nAntElmTRx = 0; // number of antenna elements for TX and RX = SRS; used only if XRAN_CATEGORY_B
|
||||
fh_config->nDLFftSize = 0; // DL FFT size; not used in xran
|
||||
|
||||
@@ -214,7 +214,10 @@ void oran_fh_if4p5_south_in(RU_t *ru, int *frame, int *slot)
|
||||
{
|
||||
ru_info_t ru_info;
|
||||
ru_info.nb_rx = ru->nb_rx * ru->num_beams_period;
|
||||
ru_info.nb_tx = ru->nb_tx * ru->num_beams_period;
|
||||
ru_info.rxdataF = ru->common.rxdataF;
|
||||
ru_info.beam_id = ru->common.beam_id;
|
||||
ru_info.num_beams_period = ru->num_beams_period;
|
||||
ru_info.prach_buf = ru->prach_rxsigF[0]; // index: [prach_oca][ant_id]
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
@@ -267,8 +270,12 @@ void oran_fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
{
|
||||
start_meas(&ru->tx_fhaul);
|
||||
ru_info_t ru_info;
|
||||
ru_info.nb_rx = ru->nb_rx * ru->num_beams_period;
|
||||
ru_info.nb_tx = ru->nb_tx * ru->num_beams_period;
|
||||
ru_info.txdataF_BF = ru->common.txdataF_BF;
|
||||
ru_info.beam_id = ru->common.beam_id;
|
||||
ru_info.num_beams_period = ru->num_beams_period;
|
||||
|
||||
// printf("south_out:\tframe=%d\tslot=%d\ttimestamp=%ld\n",frame,slot,timestamp);
|
||||
|
||||
int ret = xran_fh_tx_send_slot(&ru_info, frame, slot, timestamp);
|
||||
|
||||
@@ -41,6 +41,14 @@ typedef struct ru_info_s {
|
||||
int nb_tx;
|
||||
int32_t **txdataF_BF;
|
||||
|
||||
/// \brief Anaglogue beam ID for each OFDM symbol (used when beamforming not done in RU)
|
||||
/// - first index: concurrent beam
|
||||
/// - second index: beam_id [0.. symbols_per_frame]
|
||||
int32_t **beam_id;
|
||||
|
||||
/// number of concurrent analog beams in period
|
||||
int num_beams_period;
|
||||
|
||||
// Needed for Prach
|
||||
int16_t **prach_buf;
|
||||
} ru_info_t;
|
||||
|
||||
Reference in New Issue
Block a user