From a9718835d48a9f672c333903ffbc4e42af1138a1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 5 Jun 2024 16:45:17 +0200 Subject: [PATCH] 7.2 FH: auto-compute FFT size --- doc/ORAN_FHI7.2_Tutorial.md | 1 - executables/nr-ru.c | 6 ++++-- radio/COMMON/common_lib.h | 2 ++ radio/fhi_72/oran-config.c | 8 +++++--- radio/fhi_72/oran-params.h | 2 -- .../CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf | 1 - .../CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf | 1 - .../CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf | 1 - .../CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf | 1 - 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md index 58f7047369..7d5671eb5b 100644 --- a/doc/ORAN_FHI7.2_Tutorial.md +++ b/doc/ORAN_FHI7.2_Tutorial.md @@ -791,7 +791,6 @@ Edit the sample OAI gNB configuration file and check following parameters: compression * `iq_width_prach`: Width of PRACH IQ samples: if 16, no compression, if <16, applies compression - * `fft_size`: size of FFT performed by RU, set to 12 by default * `prach_config`: PRACH-specific configuration * `eAxC_offset`: PRACH antenna offset * `kbar`: the PRACH guard interval, provided in RU diff --git a/executables/nr-ru.c b/executables/nr-ru.c index a5a670916e..8d87dd6018 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -912,7 +912,7 @@ static void fill_rf_config(RU_t *ru, char *rf_config_file) } } -static void fill_split7_2_config(split7_config_t *split7, const nfapi_nr_config_request_scf_t *config, int slots_per_frame) +static void fill_split7_2_config(split7_config_t *split7, const nfapi_nr_config_request_scf_t *config, int slots_per_frame, uint16_t ofdm_symbol_size) { const nfapi_nr_prach_config_t *prach_config = &config->prach_config; const nfapi_nr_tdd_table_t *tdd_table = &config->tdd_table; @@ -934,6 +934,8 @@ static void fill_split7_2_config(split7_config_t *split7, const nfapi_nr_config_ } } } + + split7->fftSize = log2(ofdm_symbol_size); } /* this function maps the RU tx and rx buffers to the available rf chains. @@ -1157,7 +1159,7 @@ void *ru_thread( void *param ) { nr_dump_frame_parms(fp); nr_phy_init_RU(ru); fill_rf_config(ru, ru->rf_config_file); - fill_split7_2_config(&ru->openair0_cfg.split7, &ru->config, fp->slots_per_frame); + fill_split7_2_config(&ru->openair0_cfg.split7, &ru->config, fp->slots_per_frame, fp->ofdm_symbol_size); if(!emulate_rf) { // Start IF device if any diff --git a/radio/COMMON/common_lib.h b/radio/COMMON/common_lib.h index 0ff54a79ce..aa2d9e3189 100644 --- a/radio/COMMON/common_lib.h +++ b/radio/COMMON/common_lib.h @@ -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 */ diff --git a/radio/fhi_72/oran-config.c b/radio/fhi_72/oran-config.c index 853d2cefc4..ddee538dfd 100644 --- a/radio/fhi_72/oran-config.c +++ b/radio/fhi_72/oran-config.c @@ -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; diff --git a/radio/fhi_72/oran-params.h b/radio/fhi_72/oran-params.h index a3fb22267b..c7e17ea42a 100644 --- a/radio/fhi_72/oran-params.h +++ b/radio/fhi_72/oran-params.h @@ -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 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf index 5984d32b17..46bcb97982 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf @@ -295,7 +295,6 @@ fhi_72 = { ru_config = { iq_width = 9; iq_width_prach = 9; - fft_size = 12; }; prach_config = { eAxC_offset = 4; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf index d5c22b7e5e..8cabc3e87e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel550.conf @@ -288,7 +288,6 @@ fhi_72 = { ru_config = { iq_width = 9; iq_width_prach = 9; - fft_size = 12; }; prach_config = { eAxC_offset = 4; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf index ddcb28a331..65d7a0e8c8 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-benetel650.conf @@ -288,7 +288,6 @@ fhi_72 = { ru_config = { iq_width = 9; iq_width_prach = 9; - fft_size = 12; }; prach_config = { eAxC_offset = 4; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf index 1ddba82cdf..88fa646936 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.273prb.fhi72.4x4-liteon.conf @@ -286,7 +286,6 @@ fhi_72 = { ru_config = { iq_width = 9; iq_width_prach = 9; - fft_size = 12; }; prach_config = { eAxC_offset = 4;