From ee5b73901954deb33cdc6e6a7914d7e9c559e84e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 14 Mar 2019 15:13:22 +0100 Subject: [PATCH] PHY: make sf_extension a parameter This parameter is meaningful in TDD, to decide when to start DL at eNB side. Since there is a need for the PA to be operational, we need to transmit a bit before the DL subframe coming after an UL subframe. (We transmit zeros.) We used to use N_TA_offset which may be too much. Default value is now N_TA_offset/2 and can be changed in the configuration file, in the RUs section, like: RUs = ( { local_rf = "yes" nb_tx = 1 nb_rx = 1 att_tx = 0 att_rx = 0; bands = [7]; max_pdschReferenceSignalPower = -27; max_rxgain = 105; eNB_instances = [0]; sf_extension = 312; } ); N_TA_offset is 624 (for 30.72MHz). In the example above, we set sf_extension = 312, which is also the default. The value to put in the configuration file is for 30.72MHz. The value is scaled accordingly at runtime (thus only one value to set for every RB configuration, 25, 50 or 100, leading to less problems when adapting configuration files). This option is for experts and should not be changed randomly. --- openair1/PHY/defs_eNB.h | 2 ++ openair2/ENB_APP/enb_paramdef.h | 5 ++++- targets/RT/USER/lte-ru.c | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 271d54fdce..0c41328f32 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -312,6 +312,8 @@ typedef struct RU_t_s{ LTE_DL_FRAME_PARMS frame_parms; ///timing offset used in TDD int N_TA_offset; + /// SF extension used in TDD (unit: number of samples at 30.72MHz) (this is an expert option) + int sf_extension; /// RF device descriptor openair0_device rfdevice; /// HW configuration diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index b44ec9de16..edbb34461a 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -101,6 +101,7 @@ typedef enum { #define CONFIG_STRING_RU_NBIOTRRC_LIST "NbIoT_RRC_instances" #define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs" #define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src" +#define CONFIG_STRING_RU_SF_EXTENSION "sf_extension" #define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_ADDRESS_IDX 1 @@ -122,6 +123,7 @@ typedef enum { #define RU_NBIOTRRC_LIST_IDX 17 #define RU_SDR_ADDRS 18 #define RU_SDR_CLK_SRC 19 +#define RU_SF_EXTENSION_IDX 20 @@ -149,7 +151,8 @@ typedef enum { {CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \ {CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \ -{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 787e630d17..002190ec53 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -835,7 +835,7 @@ void tx_rf(RU_t *ru) { (prevSF_type == SF_UL) && (nextSF_type == SF_DL)) { flags = 2; // start of burst - sf_extension = ru->N_TA_offset; + sf_extension = ru->sf_extension; } if ((fp->frame_type == TDD) && @@ -843,7 +843,7 @@ void tx_rf(RU_t *ru) { (prevSF_type == SF_UL) && (nextSF_type == SF_UL)) { flags = 4; // start of burst and end of burst (only one DL SF between two UL) - sf_extension = ru->N_TA_offset; + sf_extension = ru->sf_extension; } #if defined(__x86_64) || defined(__i386__) @@ -1386,6 +1386,14 @@ int setup_RU_buffers(RU_t *ru) { * TODO: find a proper cleaner solution */ ru->N_TA_offset = 0; + + if (frame_parms->N_RB_DL == 100) /* no scaling to do */; + else if (frame_parms->N_RB_DL == 50) ru->sf_extension /= 2; + else if (frame_parms->N_RB_DL == 25) ru->sf_extension /= 4; + else { printf("not handled, todo\n"); exit(1); } + } else { + ru->N_TA_offset = 0; + ru->sf_extension = 0; } if (ru->openair0_cfg.mmapped_dma == 1) { @@ -2883,6 +2891,8 @@ void RCconfig_RU(void) { RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; + /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */ + RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; } //strcmp(local_rf, "yes") == 0