From 824f62d8bfa8949dfa550245bdb3e26be36ddcd5 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 14 Sep 2018 15:01:55 +0200 Subject: [PATCH] basic simulator: support TDD mode For whatever reason we need N_TA_offset to be 0 for the basic simulator to function properly. This is more a hack than a proper solution. More analysis is needed to understand what happens and what should be really done. --- openair1/PHY/INIT/lte_param_init.c | 7 +++++++ targets/RT/USER/lte-ru.c | 6 ++++++ targets/RT/USER/lte-ue.c | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c index 0830058a8f..dd8c2e54db 100644 --- a/openair1/PHY/INIT/lte_param_init.c +++ b/openair1/PHY/INIT/lte_param_init.c @@ -169,6 +169,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp, } else ru->N_TA_offset=0; +#if BASIC_SIMULATOR + /* this is required for the basic simulator in TDD mode + * TODO: find a proper cleaner solution + */ + UE->N_TA_offset = 0; +#endif + printf("Done lte_param_init\n"); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index d20b614ad7..1ff97386ac 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1456,6 +1456,12 @@ int setup_RU_buffers(RU_t *ru) { if (frame_parms->N_RB_DL == 100) ru->N_TA_offset = 624; else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2; else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4; +#if BASIC_SIMULATOR + /* this is required for the basic simulator in TDD mode + * TODO: find a proper cleaner solution + */ + ru->N_TA_offset = 0; +#endif } if (ru->openair0_cfg.mmapped_dma == 1) { // replace RX signal buffers with mmaped HW versions diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 66107d79a4..c49a54b98a 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -333,6 +333,13 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti } else UE->N_TA_offset = 0; +#if BASIC_SIMULATOR + /* this is required for the basic simulator in TDD mode + * TODO: find a proper cleaner solution + */ + UE->N_TA_offset = 0; +#endif + if (simL1flag == 1) init_ue_devices(UE); LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); init_UE_threads(inst);