From 7934ec451adf67728007f13728eec396ef92c579 Mon Sep 17 00:00:00 2001 From: Khalid Ahmed Date: Mon, 7 Oct 2019 18:11:06 +0200 Subject: [PATCH] In TTD mode consider ssb slot as DL slot - added nr_is_ssb_slot function --- executables/nr-ru.c | 2 +- openair1/PHY/INIT/nr_parms.c | 26 ++++++++++++++++++++ openair1/PHY/INIT/phy_init.h | 1 + openair1/SCHED_NR/phy_procedures_nr_common.c | 3 ++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 3b79ded517..4f676716fa 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -731,8 +731,8 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { int i; T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot), T_INT(0), T_BUFFER(&ru->common.txdata[0][slot * fp->samples_per_slot], fp->samples_per_slot * 4)); - nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame); int sf_extension = 0; + //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame); int siglen=fp->samples_per_slot,flags=1; /* diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 7ca794c5c2..81785872f9 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -79,6 +79,32 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_f return symbol; } +int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot) +{ + + uint8_t n_hf; + int rel_slot; + + n_hf = cfg->sch_config.half_frame_index.value; + + // if SSB periodicity is 5ms, they are transmitted in both half frames + if ( cfg->sch_config.ssb_periodicity.value == 5) { + if (slot<10) + n_hf=0; + else + n_hf=1; + } + + // to set a effective slot number between 0 to 9 in the half frame where the SSB is supposed to be + rel_slot = (n_hf)? (slot-10) : slot; + + if(rel_slot<10 && rel_slot>=0) + return 1; + else + return 0; + +} + int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp, int mu, diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index e136e8a770..7e0500b56c 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -378,6 +378,7 @@ void phy_config_request(PHY_Config_t *phy_config); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_frame_index); +int nr_is_ssb_slot(nfapi_nr_config_request_t *cfg, int slot); int nr_init_frame_parms(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms); int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms,int mu,int Ncp,int N_RB_DL,int n_ssb_crb,int ssb_subcarrier_offset); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag); diff --git a/openair1/SCHED_NR/phy_procedures_nr_common.c b/openair1/SCHED_NR/phy_procedures_nr_common.c index c19866fc92..abc1c44ce5 100755 --- a/openair1/SCHED_NR/phy_procedures_nr_common.c +++ b/openair1/SCHED_NR/phy_procedures_nr_common.c @@ -31,11 +31,12 @@ */ #include "sched_nr.h" +#include "PHY/INIT/phy_init.h" nr_subframe_t nr_slot_select(nfapi_nr_config_request_t *cfg, unsigned char slot) { - if (cfg->subframe_config.duplex_mode.value == FDD || slot == NR_DOWNLINK_SLOT) + if (cfg->subframe_config.duplex_mode.value == FDD || slot == NR_DOWNLINK_SLOT || nr_is_ssb_slot(cfg, slot) == 1) return(SF_DL); else if (slot == NR_UPLINK_SLOT) return (SF_UL);