Merge remote-tracking branch 'origin/update-fhi7.2' into integration_2024_w24
This commit is contained in:
@@ -195,6 +195,8 @@ typedef struct split7_config {
|
||||
struct {
|
||||
symbol_direction_t sym_dir[14];
|
||||
} slot_dirs[160];
|
||||
/*! this is the exponent in 2^X for the FFT size */
|
||||
uint16_t fftSize;
|
||||
} split7_config_t;
|
||||
|
||||
/*! \brief RF frontend parameters set by application */
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
# we need at least gcc-11 to build xran, so let's enforce it here
|
||||
# (because xran might not check it, and we have control here)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0
|
||||
OR CMAKE_C_COMPILER_VERSION VERSION_LESS 11.0)
|
||||
message(FATAL_ERROR "you need to have at least gcc/g++-11 to use 7.2 FHI through xran")
|
||||
endif()
|
||||
|
||||
# use env var PKG_CONFIG_PATH to override paths to libdpdk.pc
|
||||
pkg_check_modules(dpdk REQUIRED libdpdk)
|
||||
pkg_check_modules(numa REQUIRED numa)
|
||||
|
||||
find_package(xran 5.1.2 EXACT REQUIRED) # E release -> 5
|
||||
find_package(xran 5.1.3 EXACT REQUIRED) # E release -> 5
|
||||
|
||||
# Ignore xran-specific warning: we don't care/can't change the following warning, so suppress
|
||||
# alignment 1 of 'struct XYZ' is less than 2
|
||||
|
||||
@@ -729,7 +729,7 @@ static bool set_fh_frame_config(const openair0_config_t *oai0, struct xran_frame
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool set_fh_ru_config(const paramdef_t *rup, int nru, struct xran_ru_config *ru_config)
|
||||
static bool set_fh_ru_config(const paramdef_t *rup, uint16_t fftSize, int nru, struct xran_ru_config *ru_config)
|
||||
{
|
||||
ru_config->xranTech = XRAN_RAN_5GNR;
|
||||
ru_config->xranCat = XRAN_CATEGORY_A;
|
||||
@@ -740,7 +740,8 @@ static bool set_fh_ru_config(const paramdef_t *rup, int nru, struct xran_ru_conf
|
||||
ru_config->iqWidth_PRACH = *gpd(rup, nru, ORAN_RU_CONFIG_IQWIDTH_PRACH)->uptr;
|
||||
AssertFatal(ru_config->iqWidth_PRACH <= 16, "IQ Width for PRACH cannot be > 16!\n");
|
||||
ru_config->compMeth_PRACH = ru_config->iqWidth_PRACH < 16 ? XRAN_COMPMETHOD_BLKFLOAT : XRAN_COMPMETHOD_NONE;
|
||||
ru_config->fftSize = *gpd(rup, nru, ORAN_RU_CONFIG_FFT_SIZE)->uptr;
|
||||
AssertFatal(fftSize > 0, "FFT size cannot be 0\n");
|
||||
ru_config->fftSize = fftSize;
|
||||
ru_config->byteOrder = XRAN_NE_BE_BYTE_ORDER;
|
||||
ru_config->iqOrder = XRAN_I_Q_ORDER;
|
||||
ru_config->xran_max_frame = 0;
|
||||
@@ -779,6 +780,7 @@ bool set_fh_config(int ru_idx, int num_rus, const openair0_config_t *oai0, struc
|
||||
DevAssert(oai0->rx_freq[0] == oai0->rx_freq[i]);
|
||||
DevAssert(oai0->nr_band > 0);
|
||||
DevAssert(oai0->nr_scs_for_raster > 0);
|
||||
AssertFatal(oai0->threequarter_fs == 0, "cannot use three-quarter sampling with O-RAN 7.2 split\n");
|
||||
|
||||
// we simply assume that the loading process provides function to_nrarfcn()
|
||||
// to calculate the ARFCN numbers from frequency. That is not clean, but the
|
||||
@@ -869,7 +871,7 @@ bool set_fh_config(int ru_idx, int num_rus, const openair0_config_t *oai0, struc
|
||||
return false;
|
||||
if (!set_fh_frame_config(oai0, &fh_config->frame_conf))
|
||||
return false;
|
||||
if (!set_fh_ru_config(rup, nru, &fh_config->ru_conf))
|
||||
if (!set_fh_ru_config(rup, oai0->split7.fftSize, nru, &fh_config->ru_conf))
|
||||
return false;
|
||||
|
||||
fh_config->bbdev_enc = NULL;
|
||||
|
||||
@@ -123,6 +123,14 @@ static struct xran_prb_map get_xran_prb_map_ul(const struct xran_fh_config *f)
|
||||
return prbmap;
|
||||
}
|
||||
|
||||
static uint32_t next_power_2(uint32_t num)
|
||||
{
|
||||
uint32_t power = 2;
|
||||
while (power < num)
|
||||
power <<= 1;
|
||||
return power;
|
||||
}
|
||||
|
||||
static uint32_t oran_allocate_uplane_buffers(
|
||||
void *instHandle,
|
||||
struct xran_buffer_list list[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN],
|
||||
@@ -132,7 +140,10 @@ static uint32_t oran_allocate_uplane_buffers(
|
||||
{
|
||||
xran_status_t status;
|
||||
uint32_t pool;
|
||||
uint32_t numBufs = XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT;
|
||||
// we need at least XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT
|
||||
// buffers, but xran_bm_init() uses rte_pktmbuf_pool_create() which
|
||||
// recommends to use a power of two for the buffers
|
||||
uint32_t numBufs = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT);
|
||||
status = xran_bm_init(instHandle, &pool, numBufs, bufSize);
|
||||
AssertFatal(XRAN_STATUS_SUCCESS == status, "Failed at xran_bm_init(), status %d\n", status);
|
||||
printf("xran_bm_init() hInstance %p poolIdx %u elements %u size %u\n", instHandle, pool, numBufs, bufSize);
|
||||
@@ -211,14 +222,14 @@ static void oran_allocate_cplane_buffers(void *instHandle,
|
||||
{
|
||||
xran_status_t status;
|
||||
uint32_t poolSec;
|
||||
uint32_t numBufsSec = XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT * sect * XRAN_MAX_FRAGMENT;
|
||||
uint32_t numBufsSec = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT * sect * XRAN_MAX_FRAGMENT);
|
||||
uint32_t bufSizeSec = sizeof(struct xran_section_desc);
|
||||
status = xran_bm_init(instHandle, &poolSec, numBufsSec, bufSizeSec);
|
||||
AssertFatal(XRAN_STATUS_SUCCESS == status, "Failed at xran_bm_init(), status %d\n", status);
|
||||
printf("xran_bm_init() hInstance %p poolIdx %u elements %u size %u\n", instHandle, poolSec, numBufsSec, bufSizeSec);
|
||||
|
||||
uint32_t poolPrb;
|
||||
uint32_t numBufsPrb = XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT;
|
||||
uint32_t numBufsPrb = next_power_2(XRAN_N_FE_BUF_LEN * ant * XRAN_NUM_OF_SYMBOL_PER_SLOT);
|
||||
uint32_t bufSizePrb = size_of_prb_map;
|
||||
status = xran_bm_init(instHandle, &poolPrb, numBufsPrb, bufSizePrb);
|
||||
AssertFatal(XRAN_STATUS_SUCCESS == status, "Failed at xran_bm_init(), status %d\n", status);
|
||||
|
||||
@@ -91,13 +91,11 @@
|
||||
|
||||
#define ORAN_RU_CONFIG_IQWIDTH "iq_width"
|
||||
#define ORAN_RU_CONFIG_IQWIDTH_PRACH "iq_width_prach"
|
||||
#define ORAN_RU_CONFIG_FFT_SIZE "fft_size"
|
||||
|
||||
// clang-format off
|
||||
#define ORAN_RU_DESC {\
|
||||
{ORAN_RU_CONFIG_IQWIDTH, "sample IQ width (16=uncompressed)\n", PARAMFLAG_MANDATORY, .u8ptr=NULL, .defuintval=16, TYPE_UINT8, 0}, \
|
||||
{ORAN_RU_CONFIG_IQWIDTH_PRACH, "PRACH sample IQ width (16=uncompressed)\n", PARAMFLAG_MANDATORY, .u8ptr=NULL, .defuintval=16, TYPE_UINT8, 0}, \
|
||||
{ORAN_RU_CONFIG_FFT_SIZE, "Size of FFT at RU\n", PARAMFLAG_MANDATORY, .u8ptr=NULL, .defuintval=12, TYPE_UINT8, 0}, \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
#include "oaioran.h"
|
||||
|
||||
// include the following file for VERSIONX, version of xran lib, to print it during
|
||||
// startup. Only relevant for printing, if it ever makes problem, remove this
|
||||
// line and the use of VERSIONX further below. It is relative to phy/fhi_lib/lib/api
|
||||
#include "../../app/src/common.h"
|
||||
|
||||
typedef struct {
|
||||
eth_state_t e;
|
||||
rru_config_msg_type_t last_msg;
|
||||
@@ -309,7 +314,7 @@ __attribute__((__visibility__("default"))) int transport_init(openair0_device *d
|
||||
|
||||
eth->last_msg = (rru_config_msg_type_t)-1;
|
||||
|
||||
printf("ORAN: %s\n", __FUNCTION__);
|
||||
LOG_I(HW, "Initializing O-RAN 7.2 FH interface through xran library (compiled against headers of %s)\n", VERSIONX);
|
||||
|
||||
initNotifiedFIFO(&oran_sync_fifo);
|
||||
eth->oran_priv = oai_oran_initialize(openair0_cfg);
|
||||
|
||||
Reference in New Issue
Block a user