From fc30280a7d7096ebfbfe700d01555b6d591de91e Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Feb 2023 16:29:43 +0100 Subject: [PATCH] cleaning up some NR files --- CMakeLists.txt | 3 - common/utils/nr/nr_common.h | 7 + doc/Doxyfile | 1 - nfapi/oai_integration/nfapi_vnf.c | 1 + openair1/PHY/INIT/nr_init.c | 1 - openair1/PHY/INIT/nr_init_ru.c | 4 - .../PHY/NR_ESTIMATION/nr_measurements_gNB.c | 1 - .../dlsch_pdu_rel15.time_alloc_list_flag | 0 .../dlsch_pdu_rel15.time_allocation_type | 0 openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 14 -- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 1 - openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c | 208 +----------------- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 1 - openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 1 - .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 134 +---------- .../PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 2 - openair1/PHY/defs_gNB.h | 26 +-- openair1/PHY/defs_nr_common.h | 84 ------- openair1/PHY/impl_defs_nr.h | 6 - openair1/PHY/phy_vars_nr_ue.h | 88 -------- openair1/SCHED_NR/extern.h | 0 openair1/SCHED_NR/fapi_nr_l1.h | 1 - openair1/SCHED_NR/nr_prach_procedures.c | 1 - openair1/SCHED_NR/nr_ru_procedures.c | 1 - openair1/SCHED_NR/phy_frame_config_nr.h | 2 + openair1/SCHED_NR/phy_procedures_nr_common.c | 35 --- openair1/SCHED_NR/sched_nr.h | 1 - openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 - openair1/SCHED_NR_UE/pucch_uci_ue_nr.c | 74 ------- openair1/SCHED_NR_UE/pucch_uci_ue_nr.h | 8 - openair2/LAYER2/MAC/eNB_scheduler.c | 1 - openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 3 + openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h | 14 -- openair2/LAYER2/NR_MAC_gNB/config.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 1 - .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 14 -- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 10 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 1 - openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 15 +- openair2/RRC/NR/nr_rrc_common.c | 1 - openair2/RRC/NR/nr_rrc_defs.h | 8 +- openair2/RRC/NR/nr_rrc_extern.h | 2 - openair2/RRC/NR/rrc_gNB.c | 4 - 44 files changed, 26 insertions(+), 757 deletions(-) delete mode 100644 openair1/PHY/NR_TRANSPORT/dlsch_pdu_rel15.time_alloc_list_flag delete mode 100644 openair1/PHY/NR_TRANSPORT/dlsch_pdu_rel15.time_allocation_type delete mode 100644 openair1/SCHED_NR/extern.h delete mode 100644 openair1/SCHED_NR/phy_procedures_nr_common.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7da5bbc5e5..3e937dff2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -831,7 +831,6 @@ target_link_libraries(SCHED_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) set(SCHED_NR_SRC ${OPENAIR1_DIR}/SCHED_NR/fapi_nr_l1.c - ${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c ${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_gNB.c ${OPENAIR1_DIR}/SCHED_NR/nr_prach_procedures.c ${OPENAIR1_DIR}/SCHED_NR/phy_frame_config_nr.c @@ -859,7 +858,6 @@ target_link_libraries(SCHED_UE_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) set(SCHED_SRC_NR_UE ${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c - ${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c ${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c ${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr_ue.c ${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c @@ -2574,7 +2572,6 @@ target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR) add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 9abb93770d..e27543365a 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -40,6 +40,13 @@ #define MAX_BWP_SIZE 275 #define NR_MAX_NUM_BWP 4 #define NR_MAX_HARQ_PROCESSES 16 +#define NR_NB_REG_PER_CCE 6 +#define NR_NB_SC_PER_RB 12 + +typedef enum { + nr_FR1 = 0, + nr_FR2 +} nr_frequency_range_e; typedef struct nr_bandentry_s { int16_t band; diff --git a/doc/Doxyfile b/doc/Doxyfile index ef21662ec9..c839eabf84 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -2097,7 +2097,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h \ @CMAKE_CURRENT_SOURCE_DIR@/../nfapi/open-nFAPI/sim_common/inc/vendor_ext.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/nr_prach_procedures.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_procedures_nr_common.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/phy_procedures_nr_gNB.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/fapi_nr_l1.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/SCHED_NR/nr_ru_procedures.c \ diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 750b31da98..3bf9932d65 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -41,6 +41,7 @@ #include "PHY/LTE_TRANSPORT/transport_proto.h" #include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "executables/lte-softmodem.h" +#include "openair1/PHY/defs_gNB.h" #include "common/ran_context.h" #include "openair2/PHY_INTERFACE/queue_t.h" diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index b65068716b..d30e7e8af8 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -23,7 +23,6 @@ #include "common/utils/nr/nr_common.h" #include "common/ran_context.h" #include "PHY/defs_gNB.h" -#include "PHY/phy_extern.h" #include "PHY/NR_REFSIG/nr_refsig.h" #include "PHY/INIT/phy_init.h" #include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 0a357a5255..f1810e5541 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -21,10 +21,6 @@ #include "phy_init.h" #include "SCHED/sched_common.h" -/*#include "RadioResourceConfigCommonSIB.h" -#include "RadioResourceConfigDedicated.h" -#include "TDD-Config.h" -#include "MBSFN-SubframeConfigList.h"*/ #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" #include diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index 710856d0b7..0c73d3cd1d 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -32,7 +32,6 @@ #include "PHY/types.h" #include "PHY/defs_gNB.h" -#include "PHY/phy_extern.h" #include "nr_ul_estimation.h" #define I0_SKIP_DC 1 diff --git a/openair1/PHY/NR_TRANSPORT/dlsch_pdu_rel15.time_alloc_list_flag b/openair1/PHY/NR_TRANSPORT/dlsch_pdu_rel15.time_alloc_list_flag deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair1/PHY/NR_TRANSPORT/dlsch_pdu_rel15.time_allocation_type b/openair1/PHY/NR_TRANSPORT/dlsch_pdu_rel15.time_allocation_type deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index bdf681c21d..974e74f30e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -35,20 +35,6 @@ #include "PHY/defs_gNB.h" -void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config, - nfapi_nr_dl_tti_pdcch_pdu dci_pdu, - nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu); - -void nr_check_time_alloc(uint8_t S, uint8_t L,nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15,nfapi_nr_config_request_t *cfg); - -uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB); - -uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position); - -void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type); - -void nr_get_rbg_list(uint32_t bitmap, uint8_t n_rbg, uint8_t* rbg_list); - void nr_pdsch_codeword_scrambling(uint8_t *in, uint32_t size, uint8_t q, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 853c20ca57..61249369e2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -31,7 +31,6 @@ */ #include "PHY/defs_gNB.h" -#include "PHY/phy_extern.h" #include "PHY/CODING/coding_extern.h" #include "PHY/CODING/coding_defs.h" #include "PHY/CODING/lte_interleaver_inline.h" diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c index 2dc21af0c5..2f8087ea0e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c @@ -36,214 +36,8 @@ extern void set_taus_seed(unsigned int seed_type); -uint8_t nr_pdsch_default_time_alloc_A_S_nCP[23] = {2,3,2,3,2,3,2,3,2,3,9,10,4,6,5,5,9,12,1,1,2,4,8}; -uint8_t nr_pdsch_default_time_alloc_A_L_nCP[23] = {12,11,10,9,9,8,7,6,5,4,4,4,4,4,7,2,2,2,13,6,4,7,4}; -uint8_t nr_pdsch_default_time_alloc_A_S_eCP[23] = {2,3,2,3,2,3,2,3,2,3,6,8,4,6,5,5,9,10,1,1,2,4,8}; -uint8_t nr_pdsch_default_time_alloc_A_L_eCP[23] = {6,5,10,9,9,8,7,6,5,4,4,2,4,4,6,2,2,2,11,6,4,6,4}; -uint8_t nr_pdsch_default_time_alloc_B_S[16] = {2,4,6,8,10,2,4,2,4,6,8,10,2,2,3,2}; -uint8_t nr_pdsch_default_time_alloc_B_L[16] = {2,2,2,2,2,2,2,4,4,4,4,4,7,12,11,4}; -uint8_t nr_pdsch_default_time_alloc_C_S[15] = {2,4,6,8,10,2,4,6,8,10,2,2,3,0,2}; -uint8_t nr_pdsch_default_time_alloc_C_L[15] = {2,2,2,2,2,4,4,4,4,4,7,12,11,6,6}; - - /// Time domain allocation routines - -/* -void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config, - nfapi_nr_dl_config_dci_dl_pdu dci_pdu, - nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu) { - - nfapi_nr_dl_config_pdcch_parameters_rel15_t params_rel15 = dci_pdu.pdcch_params_rel15; - uint8_t *alloc_type = &dlsch_pdu->dlsch_pdu_rel15.time_allocation_type; - uint8_t mux_pattern = params_rel15.mux_pattern; - uint8_t alloc_list_flag = dlsch_pdu->dlsch_pdu_rel15.time_alloc_list_flag; - - switch(params_rel15.rnti_type) { - - case NFAPI_NR_RNTI_SI: - AssertFatal(params_rel15.common_search_space_type == NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_0, - "Invalid common search space type %d for SI RNTI, expected %d\n", - params_rel15.common_search_space_type, NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_0); - - if (mux_pattern == NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1) - AssertFatal(config.subframe_config.dl_cyclic_prefix_type.value == NFAPI_CP_NORMAL, - "Invalid configuration CP extended for SI RNTI type 0 search space\n"); - - *alloc_type = (mux_pattern == NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1)?NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A : - (mux_pattern == NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE2)?NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_B : - NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C; - break; - - case NFAPI_NR_RNTI_RA: - case NFAPI_NR_RNTI_TC: - //AssertFatal(dci_alloc.pdcch_params.common_search_space_type == NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_1, - //"Invalid common search space type %d for RNTI %d, expected %d\n",dci_alloc.pdcch_params.common_search_space_type, - //NFAPI_NR_COMMON_SEARCH_SPACE_TYPE_1, dci_alloc.rnti_type); - *alloc_type = (alloc_list_flag) ? NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_ALLOC_LIST : NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A; - break; - - case NFAPI_NR_RNTI_P: - break; - - case NFAPI_NR_RNTI_C: - case NFAPI_NR_RNTI_CS: - if (params_rel15.search_space_type == NFAPI_NR_SEARCH_SPACE_TYPE_COMMON) - *alloc_type = (alloc_list_flag)? NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_ALLOC_LIST : NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A; - else - *alloc_type = NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_ALLOC_LIST; - - break; - - } -} - -static inline uint8_t get_K0(uint8_t row_idx, uint8_t time_alloc_type) { - return ( (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A)|| - (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C)? 0 : - ((row_idx==6)||(row_idx==7)||(row_idx==15))? 1 : 0); -} - -// ideally combine the calculation of L in the same function once the right struct is defined -uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_TypeA_Position) { - - uint8_t idx; - //uint8_t S; - - switch(time_alloc_type) { - case NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A: - idx = (row_idx>7)? (row_idx+6) : (((row_idx-1)<<1)-1+((dmrs_TypeA_Position==2)?0:1)); - return ((CP==NFAPI_CP_NORMAL)?nr_pdsch_default_time_alloc_A_S_nCP[idx] : nr_pdsch_default_time_alloc_A_S_eCP[idx]); - break; - - case NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_B: - idx = (row_idx<14)? (row_idx-1) : (row_idx == 14)? row_idx-1+((dmrs_TypeA_Position==2)?0:1) : 15; - return (nr_pdsch_default_time_alloc_B_S[idx]); - break; - - case NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C: - AssertFatal((row_idx!=6)&&(row_idx!=7)&&(row_idx<17), "Invalid row index %d in %s %s\n", row_idx, __FUNCTION__, __FILE__); - idx = (row_idx<6)? (row_idx-1) : (row_idx<14)? (row_idx-3) : (row_idx == 14)? row_idx-3+((dmrs_TypeA_Position==2)?0:1) : (row_idx-2); - break; - - default: - AssertFatal(0, "Invalid Time domain allocation type %d in %s %s\n", time_alloc_type, __FUNCTION__, __FILE__); - } - return 0; // temp warning fix -} - - -void nr_check_time_alloc(uint8_t S, uint8_t L,nfapi_nr_dl_config_dlsch_pdu_rel15_t *rel15,nfapi_nr_config_request_t *cfg) { - - switch (cfg->subframe_config.dl_cyclic_prefix_type.value) { - case NFAPI_CP_NORMAL: - if (rel15->mapping_type == NFAPI_NR_PDSCH_MAPPING_TYPE_A) { - AssertFatal(S<4, "Invalid value of S(%d) for mapping type A and normal CP\n", S); - - if (S==3) - AssertFatal(rel15->dmrs_TypeA_Position == 3, "Invalid S %d for dmrs_TypeA_Position %d\n", - S, rel15->dmrs_TypeA_Position); - - AssertFatal((L>2)&&(L<15), "Invalid L %d for mapping type A and normal CP\n", L); - - AssertFatal(((S+L)>2)&&((S+L)<15), "Invalid S+L %d for mapping type A and normal CP\n", S+L); - } - else { - AssertFatal(S<13, "Invalid value of S(%d) for mapping type B and normal CP\n", S); - - AssertFatal((L>1)&&(L<8), "Invalid L %d for mapping type B and normal CP\n", L); - - AssertFatal(((S+L)>1)&&((S+L)<15), "Invalid S+L %d for mapping type B and normal CP\n", S+L); - } - break; - - case NFAPI_CP_EXTENDED: - if (rel15->mapping_type == NFAPI_NR_PDSCH_MAPPING_TYPE_A) { - AssertFatal(S<4, "Invalid value of S(%d) for mapping type A and extended CP\n", S); - - if (S==3) - AssertFatal(rel15->dmrs_TypeA_Position == 3, "Invalid S %d for dmrs_TypeA_Position %d\n", - S, rel15->dmrs_TypeA_Position); - - AssertFatal((L>2)&&(L<13), "Invalid L %d for mapping type A and extended CP\n", L); - - AssertFatal(((S+L)>2)&&((S+L)<13), "Invalid S+L %d for mapping type A and extended CP\n", S+L); - } - else { - AssertFatal(S<11, "Invalid value of S(%d) for mapping type B and extended CP\n", S); - - AssertFatal((L>1)&&(L<7), "Invalid L %d for mapping type B and extended CP\n", L); - - AssertFatal(((S+L)>1)&&((S+L)<13), "Invalid S+L %d for mapping type B and extended CP\n", S+L); - } - break; - } -} - - - /// Frequency domain allocation routines - - // DL alloc type 0 -static inline uint8_t get_RBG_size_P(uint16_t n_RB, uint8_t RBG_config) { - if (RBG_config == NFAPI_NR_PDSCH_RBG_CONFIG_TYPE1) - return ((n_RB<37)?2:(n_RB<73)?4:(n_RB<145)?8:16); - else if (RBG_config == NFAPI_NR_PDSCH_RBG_CONFIG_TYPE2) - return ((n_RB<37)?4:(n_RB<73)?8:(n_RB<145)?16:16); - else - AssertFatal(0, "Invalid RBG config type (%d)\n", RBG_config); -} - -void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type) { - nr_rbg_parms_t* rbg_parms = &bwp->rbg_parms; - - rbg_parms->P = get_RBG_size_P(bwp->N_RB, config_type); - rbg_parms->start_size = rbg_parms->P - bwp->location%rbg_parms->P; - rbg_parms->end_size = ((bwp->location + bwp->N_RB)%rbg_parms->P)? ((bwp->location + bwp->N_RB)%rbg_parms->P) : rbg_parms->P; - rbg_parms->N_RBG = (uint8_t)ceil( (bwp->N_RB + (bwp->location%rbg_parms->P))/(float)rbg_parms->P); - LOG_I(PHY, "RBG parameters for BWP %d location %d N_RB %d:\n", bwp->bwp_id, bwp->location, bwp->N_RB); - LOG_I(PHY, "P %d\t start size %d\t endsize %d\t N_RBG %d\n", rbg_parms->P, rbg_parms->start_size, rbg_parms->end_size, rbg_parms->N_RBG); -} - -void nr_get_rbg_list(uint32_t bitmap, uint8_t n_rbg, uint8_t* rbg_list) { - uint8_t idx=0; - for (int i=0; i>(n_rbg-i-1))&1) - rbg_list[idx++]=i; -} - - // DL alloc type 1 - -uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB) { - if ((L-1)<=(N_RB>>1)) - return (N_RB*(L-1)+rb_start); - else - return (N_RB*(N_RB-L+1) + (N_RB-1-rb_start)); -} - - /// PRB bundling routines - -// Precoding granularity -static inline uint8_t nr_get_P_prime(uint8_t rnti_type, uint8_t dci_format, uint8_t prb_bundling_type) { - if (dci_format == NFAPI_NR_DL_DCI_FORMAT_1_0) - return (NFAPI_NR_PRG_GRANULARITY_2); - else // NFAPI_NR_DL_DCI_FORMAT_1_1 - return ((prb_bundling_type)?0:2);// incomplete for 1_1 -} - -void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t prb_bundling_type) { - nr_prg_parms_t* prg_parms = &bwp->prg_parms; - - prg_parms->P_prime = nr_get_P_prime(dci_alloc.pdcch_params.rnti_type, dci_alloc.pdcch_params.dci_format, prb_bundling_type); - prg_parms->start_size = prg_parms->P_prime - bwp->location%prg_parms->P_prime; - prg_parms->end_size = (bwp->location + bwp->N_RB)%prg_parms->P_prime; - if (!prg_parms->end_size) - prg_parms->end_size = prg_parms->P_prime; - prg_parms->N_PRG = ceil((float)bwp->N_RB/prg_parms->P_prime); - LOG_I(PHY, "PRG parameters for BWP %d location %d N_RB %d:\n", bwp->bwp_id, bwp->location, bwp->N_RB); - LOG_I(PHY, "P_prime %d\t start size %d\t endsize %d\t N_PRG %d\n", prg_parms->P_prime, prg_parms->start_size, prg_parms->end_size, prg_parms->N_PRG); -} -*/ - - /// Payload emulation +/// Payload emulation void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) { set_taus_seed(0); for (int i=0; i " a, __func__, ##__VA_ARGS__ ) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index 5c8506e4f7..dc09714da9 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -35,22 +35,10 @@ #include "PHY/impl_defs_top.h" #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" - -//#include "PHY/defs_nr_UE.h" +#include "nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h" #include "../NR_TRANSPORT/nr_transport_common_proto.h" -/*#ifndef STANDALONE_COMPILE -#include "UTIL/LISTS/list.h" -#endif -*/ -#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" -// structures below implement 36-211 and 36-212 - -/** @addtogroup _PHY_TRANSPORT_ - * @{ - */ - typedef enum { NEW_TRANSMISSION_HARQ, RETRANSMISSION_HARQ @@ -63,10 +51,6 @@ typedef struct { harq_result_t tx_status; /// Status Flag indicating for this ULSCH (idle,active,disabled) SCH_status_t status; - /// Subframe scheduling indicator (i.e. Transmission opportunity indicator) - uint8_t subframe_scheduling_flag; - /// Subframe cba scheduling indicator (i.e. Transmission opportunity indicator) - uint8_t subframe_cba_scheduling_flag; /// Last TPC command uint8_t TPC; /// The payload + CRC size in bits, "B" from 36-212 @@ -101,16 +85,10 @@ typedef struct { uint8_t n_DMRS; /// n_DMRS2 for cyclic shift of DMRS uint8_t n_DMRS2; - /// Flag to indicate that this is a control only ULSCH (i.e. no MAC SDU) - uint8_t control_only; - /// Flag to indicate that this is a calibration ULSCH (i.e. no MAC SDU and filled with TDD calibration information) - // int calibration_flag; /// Number of soft channel bits uint32_t G; // Number of modulated symbols carrying data uint32_t num_of_mod_symbols; - // decode phich - uint8_t decode_phich; // Encoder BG uint8_t BG; // LDPC lifting size @@ -120,44 +98,14 @@ typedef struct { typedef struct { /// NDAPI struct for UE nfapi_nr_ue_pusch_pdu_t pusch_pdu; - /// SRS active flag - uint8_t srs_active; // UL number of harq processes uint8_t number_harq_processes_for_pusch; - /// Minimum number of CQI bits for PUSCH (36-212 r8.6, Sec 5.2.4.1 p. 37) - uint8_t O_CQI_MIN; - /// ACK/NAK Bundling flag - uint8_t bundling; - /// beta_offset_cqi times 8 - uint16_t beta_offset_cqi_times8; - /// beta_offset_ri times 8 - uint16_t beta_offset_ri_times8; - /// beta_offset_harqack times 8 - uint16_t beta_offset_harqack_times8; - /// power_offset - uint8_t power_offset; - // for cooperative communication - uint8_t cooperation_flag; /// RNTI type uint8_t rnti_type; /// Cell ID int Nid_cell; - /// f_PUSCH parameter for PUSCH power control - int16_t f_pusch; - /// Po_PUSCH - target output power for PUSCH - int16_t Po_PUSCH; - /// PHR - current power headroom (based on last PUSCH transmission) - int16_t PHR; - /// Po_SRS - target output power for SRS - int16_t Po_SRS; - /// num active cba group - uint8_t num_active_cba_groups; /// bit mask of PT-RS ofdm symbol indicies uint16_t ptrs_symbols; - /// num dci found for cba - //uint8_t num_cba_dci[10]; - /// allocated CBA RNTI - //uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP]; } NR_UE_ULSCH_t; typedef struct { @@ -180,8 +128,6 @@ typedef struct { int16_t **d; /// Index of current HARQ round for this DLSCH uint8_t DLround; - /// MIMO mode for this DLSCH - MIMO_nrmode_t mimo_mode; /// Number of code segments uint32_t C; /// Number of bits in code segments @@ -190,20 +136,8 @@ typedef struct { uint32_t F; /// LDPC lifting factor uint32_t Z; - /// current delta_pucch - int8_t delta_PUCCH; /// Number of soft channel bits uint32_t G; - /// Current subband PMI allocation - uint16_t pmi_alloc; - /// Current RB allocation (even slots) - uint32_t rb_alloc_even[4]; - /// Current RB allocation (odd slots) - uint32_t rb_alloc_odd[4]; - /// distributed/localized flag - vrb_t vrb_type; - /// downlink power offset field - uint8_t dl_power_off; /// codeword this transport block is mapped to uint8_t codeword; /// HARQ-ACKs @@ -220,28 +154,8 @@ typedef struct { uint8_t rnti_type; /// Active flag for DLSCH demodulation bool active; - /// Transmission mode - uint8_t mode1_flag; - /// amplitude of PDSCH (compared to RS) in symbols without pilots - int16_t sqrt_rho_a; - /// amplitude of PDSCH (compared to RS) in symbols containing pilots - int16_t sqrt_rho_b; - /// Current subband antenna selection - uint32_t antenna_alloc; - /// Current subband RI allocation - uint32_t ri_alloc; - /// Current subband CQI1 allocation - uint32_t cqi_alloc1; - /// Current subband CQI2 allocation - uint32_t cqi_alloc2; - /// saved subband PMI allocation from last PUSCH/PUCCH report - uint16_t pmi_alloc; /// Structure to hold dlsch config from MAC fapi_nr_dl_config_dlsch_pdu_rel15_t dlsch_config; - /* higher layer parameter for reception of two transport blocks TS 38.213 9.1.3.1 Type-2 HARQ-ACK codebook dtermination */ - uint8_t Number_MCS_HARQ_DL_DCI; - /* spatial bundling of PUCCH */ - uint8_t HARQ_ACK_spatial_bundling_PUCCH; /// Number of MIMO layers (streams) uint8_t Nl; /// Maximum number of LDPC iterations @@ -254,52 +168,6 @@ typedef struct { uint8_t ptrs_symbol_index; } NR_UE_DLSCH_t; -typedef enum {format0_0, - format0_1, - format1_0, - format1_1, - format2_0, - format2_1, - format2_2, - format2_3 - } NR_DCI_format_t; - - -typedef enum {nr_pucch_format0=0, - nr_pucch_format1, - nr_pucch_format2, - nr_pucch_format3, - nr_pucch_format4 - } NR_PUCCH_FMT_t; - -typedef struct { - /// Length of DCI in bits - uint8_t dci_length; - /// Aggregation level - uint8_t L; - /// Position of first CCE of the dci - int firstCCE; - /// flag to indicate that this is a RA response - bool ra_flag; - /// rnti - rnti_t rnti; - /// rnti type - //crc_scrambled_t rnti_type; - /// Format - NR_DCI_format_t format; - /// search space - dci_space_t search_space; - /// DCI pdu - uint64_t dci_pdu[2]; -//#if defined(UPGRADE_RAT_NR) -#if 1 - /// harq information - uint8_t harq_pid_pusch; - /// delay between current slot and slot to transmit - uint8_t number_slots_rx_to_tx; -#endif -} NR_DCI_ALLOC_t; - /**@}*/ #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 1973d617f7..d74ad1372e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -31,7 +31,6 @@ */ #include "PHY/defs_UE.h" -#include "PHY/phy_extern_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/CODING/coding_defs.h" #include "PHY/CODING/coding_extern.h" @@ -39,7 +38,6 @@ #include "PHY/CODING/nrLDPC_extern.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include //#define DEBUG_ULSCH_CODING diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 469218addc..60bf49796b 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -33,7 +33,6 @@ #ifndef __PHY_DEFS_GNB__H__ #define __PHY_DEFS_GNB__H__ -#include "defs_eNB.h" #include "defs_nr_common.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" @@ -43,10 +42,9 @@ #include "PHY/CODING/nrLDPC_extern.h" #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" #include "executables/rt_profiling.h" - #include "nfapi_nr_interface_scf.h" -#define MAX_NUM_RU_PER_gNB MAX_NUM_RU_PER_eNB +#define MAX_NUM_RU_PER_gNB 8 #define MAX_PUCCH0_NID 8 typedef struct { @@ -63,14 +61,6 @@ typedef struct { uint32_t pbch_e[NR_POLAR_PBCH_E_DWORD]; } NR_gNB_PBCH; -typedef struct { - uint8_t ssb_start_symbol; - uint8_t n_hf; - uint8_t Lmax; - uint8_t ssb_index; - int32_t sfn; -} NR_PBCH_parms_t; - typedef enum { NR_SCH_IDLE, @@ -101,23 +91,11 @@ typedef struct { uint32_t Z; } NR_DL_gNB_HARQ_t; -typedef struct { - int frame; - int slot; - nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu; -} NR_gNB_PDCCH_t; - typedef struct { uint8_t active; nfapi_nr_dl_tti_csi_rs_pdu csirs_pdu; } NR_gNB_CSIRS_t; -typedef struct { - int frame; - int slot; - nfapi_nr_ul_dci_request_pdus_t pdcch_pdu; -} NR_gNB_UL_PDCCH_t; - typedef struct { int frame; int dump_frame; @@ -569,7 +547,7 @@ typedef struct { int prach_I0; } PHY_MEASUREMENTS_gNB; -#define MAX_NUM_NR_PRACH_PREAMBLES 64 + #define MAX_NUM_NR_RX_RACH_PDUS 4 #define MAX_NUM_NR_RX_PRACH_PREAMBLES 4 #define MAX_UL_PDUS_PER_SLOT 8 diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c99e07fe7d..9e87116a4a 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -45,9 +45,6 @@ #define MAX_NUM_SUBCARRIER_SPACING 5 #define NR_MAX_OFDM_SYMBOL_SIZE 4096 -#define NR_NB_SC_PER_RB 12 -#define NR_NB_REG_PER_CCE 6 - #define NR_SYMBOLS_PER_SLOT 14 #define ONE_OVER_SQRT2_Q15 23170 @@ -81,44 +78,23 @@ #define NR_MAX_DCI_SIZE_DWORD 54 // ceil(NR_MAX_DCI_SIZE/32) #define NR_MAX_PDCCH_AGG_LEVEL 16 // 3GPP TS 38.211 V15.8 Section 7.3.2 Table 7.3.2.1-1: Supported PDCCH aggregation levels -#define NR_MAX_CSET_DURATION 3 - -#define NR_MAX_NB_RBG 18 #define NR_MAX_NB_LAYERS 4 // 8 #define NR_MAX_NB_PORTS 32 -#define NR_MAX_NB_HARQ_PROCESSES 16 - #define NR_MAX_PDSCH_TBS 3824 #define MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 36 #define MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER 34 -#define MAX_NUM_NR_CHANNEL_BITS (4*14*273*12*8) // 14 symbols, 273 RB #define MAX_NUM_NR_RE (4*14*273*12) #define MAX_NUM_NR_SRS_SYMBOLS 4 #define MAX_NUM_NR_SRS_AP 4 -#define NR_RX_NB_TH 1 -#define NR_NB_TH_SLOT 2 - #define NR_NB_NSCID 2 -extern const uint8_t nr_rv_round_map[4]; - -static inline -uint8_t nr_rv_to_round(uint8_t rv) -{ - for (uint8_t round = 0; round < 4; round++) { - if (nr_rv_round_map[round] == rv) - return round; - } - return 0; -} - typedef enum { NR_MU_0=0, NR_MU_1, @@ -127,14 +103,6 @@ typedef enum { NR_MU_4, } nr_numerology_index_e; -typedef enum { - kHz15=0, - kHz30, - kHz60, - kHz120, - kHz240 -} nr_scs_e; - typedef enum{ nr_ssb_type_A = 0, nr_ssb_type_B, @@ -143,58 +111,6 @@ typedef enum{ nr_ssb_type_E } nr_ssb_type_e; -typedef enum { - nr_FR1 = 0, - nr_FR2 -} nr_frequency_range_e; - -typedef enum { - MOD_BPSK=0, - MOD_QPSK, - MOD_QAM16, - MOD_QAM64, - MOD_QAM256 -}nr_mod_t; - -typedef struct { - /// Size of first RBG - uint8_t start_size; - /// Nominal size - uint8_t P; - /// Size of last RBG - uint8_t end_size; - /// Number of RBG - uint8_t N_RBG; -}nr_rbg_parms_t; - -typedef struct { - /// Size of first PRG - uint8_t start_size; - /// Nominal size - uint8_t P_prime; - /// Size of last PRG - uint8_t end_size; - /// Number of PRG - uint8_t N_PRG; -} nr_prg_parms_t; - -typedef struct NR_BWP_PARMS { - /// BWP ID - uint8_t bwp_id; - /// Subcarrier spacing - nr_scs_e scs; - /// Freq domain location -- 1st CRB index - uint8_t location; - /// Bandwidth in PRB - uint16_t N_RB; - /// Cyclic prefix - uint8_t cyclic_prefix; - /// RBG params - nr_rbg_parms_t rbg_parms; - /// PRG params - nr_prg_parms_t prg_parms; -} NR_BWP_PARMS; - typedef struct { uint8_t k_0_p[MAX_NUM_NR_SRS_AP][MAX_NUM_NR_SRS_SYMBOLS]; uint8_t srs_generated_signal_bits; diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h index 8dcb383892..8d6437af74 100644 --- a/openair1/PHY/impl_defs_nr.h +++ b/openair1/PHY/impl_defs_nr.h @@ -211,12 +211,6 @@ typedef enum { srs_sl2560 = 16 } SRS_Periodicity_t; -#define NB_SRS_PERIOD (18) - -static const uint16_t srs_period[NB_SRS_PERIOD] -= { 0, 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560} -; - /// SRS_Resource of SRS_Config information element from 38.331 RRC specifications typedef struct { /// \brief srs resource identity. diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h index 024ab5017a..99b22ab69d 100644 --- a/openair1/PHY/phy_vars_nr_ue.h +++ b/openair1/PHY/phy_vars_nr_ue.h @@ -27,99 +27,11 @@ #include "common/ran_context.h" -char* namepointer_chMag ; -char fmageren_name2[512]; -char* namepointer_log2; - - -#include "PHY/LTE_REFSIG/primary_synch.h" -int16_t *primary_synch0_time; -int16_t *primary_synch1_time; -int16_t *primary_synch2_time; - - -//#include "PHY/CODING/coding_vars.h" - - - PHY_VARS_NR_UE ***PHY_vars_UE_g; -PHY_VARS_eNB ***PHY_vars_eNB_g; - -unsigned short rev[2048],rev_times4[8192],rev_half[1024]; -unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048],rev8192[8192]; - const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; -unsigned char NB_RU=0; - - -int number_of_cards; - - -int flag_LA=0; -int flagMag; -//extern channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; -//extern double ABS_SINR_eff_BLER_table[MCS_COUNT][9][9]; -//extern double ABS_beta[MCS_COUNT];odi -double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX]; -int table_length[MCS_COUNT]; -//double sinr_bler_map_up[MCS_COUNT][2][16]; - -//for MU-MIMO abstraction using MIESM -//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively -double MI_map_4qam[3][162]; -double MI_map_16qam[3][197]; -double MI_map_64qam[3][227]; - -// here the first index is for transmission mode 1, 2, 5 and 6 whereas the second index is for the 16 sinr vaues corresponding to 16 CQIs -const double sinr_to_cqi[4][16]= { {-2.5051, -2.5051, -1.7451, -0.3655, 1.0812, 2.4012, 3.6849, 6.6754, 8.3885, 8.7970, 12.0437, 14.4709, 15.7281, 17.2424, 17.2424, 17.2424}, - {-2.2360, -2.2360, -1.3919, -0.0218, 1.5319, 2.9574, 4.3234, 6.3387, 8.9879, 9.5096, 12.6609, 14.0116, 16.4984, 18.1572, 18.1572, 18.1572}, - {-1, -1.0000, -0.4198, -0.0140, 1.0362, 2.3520, 3.5793, 6.1136, 8.4836, 9.0858, 12.4723, 13.9128, 16.2054, 17.7392, 17.7392, 17.7392}, - { -4.1057, -4.1057, -3.3768, -2.2916, -1.1392, 0.1236, 1.2849, 3.1933, 5.9298, 6.4052, 9.6245, 10.9414, 13.5166, 14.9545, 14.9545, 14.9545} -}; - -//for SNR to MI conversion 7 th order Polynomial coeff -const double q_qam16[8]= {3.21151853033897e-10,5.55435952230651e-09,-2.30760065362117e-07,-6.25587743817859e-06,4.62251036452795e-06,0.00224150813158937,0.0393723140344367,0.245486379182639}; -const double q_qpsk[8]= {1.94491167814437e-09,8.40494123817774e-08,4.75527131198034e-07,-2.48946285301621e-05,-0.000347614016158364,0.00209252225437100,0.0742986115462510,0.488297879889425}; -const double q_qam64[8]= {2.25934026232206e-11,-1.45992206328306e-10,-3.70861183071900e-08,-1.22206071019319e-06,6.49115500399637e-06,0.00129828997837433,0.0259669554914859,0.166602901214898}; - -//for MI to SNR conversion 7 th order Polynomial coeff -const double p_qpsk[8]= {5982.42405670359,-21568.1135917693,31293.9987036905,-23394.6795043871,9608.34750585489,-2158.15802349899,267.731968719036,-20.6145324295965}; -const double p_qam16[8]= {7862.12690694170,-28510.3207048338,41542.2150287122,-31088.3036957379,12690.1982361016,-2785.66604739984,326.595462489375,-18.9911849872089}; -const double p_qam64[8]= {8832.57933013696,-32119.1802555952,46914.2578990397,-35163.8150557183,14343.7419388853,-3126.61025510092,360.954930562237,-18.0358548533343}; - -// ideal CE MIESM - -const double beta1_dlsch_MI[6][MCS_COUNT] = { {1.1188, 0.3720, 0.3755, 0.9453, 0.5799, 0.5256, 0.5485, 0.5340, 0.5165, 0.5300, 0.6594, 0.5962, 0.4884, 0.4927, 0.3687, 0.4614, 0.4081, 0.2639,0.2935,0.2520,0.3709,0.2906,0.2612,0.2390}, {0.7138, 0.5533, 0.5533, 0.4828, 0.4998, 0.4843, 0.4942, 0.5323, 0.5142, 0.4756, 0.5792, 0.4167, 0.4445, 0.3942, 0.3789, 0.2756, 0.4456, 0.1650, 0.2254, 0.2353, 0.2097,0.2517,0.3242,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1},{1.808065416202085, 1.754544945430673,1.902272019362616, 1.790054645392961, 1.563204092967629, 1.585258289348813, 1.579349443720310, 1.570650121437345, 1.545055626608596, 1.362229442426877, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33, 1,1,1,1,1,1,1},{0.7146, 0.4789, 0.5392, 0.5556, 0.4975, 0.4847, 0.4691, 0.5261, 0.5278, 0.4962, 0.4468, 0.4113, 0.4622, 0.4609, 0.3946, 0.3991, 0.3532, 0.2439, 0.1898, 0.2929, 0.2712, 0.3367, 0.3591, 0.2571}}; -const double beta2_dlsch_MI[6][MCS_COUNT] = { {1.1293, 0.3707, 0.3722, 0.9310, 0.5808, 0.5265, 0.5404, 0.5279, 0.5210, 0.5226, 0.6438, 0.5827, 0.4804, 0.4830, 0.3638, 0.4506, 0.4107, 0.2547, 0.2797, 0.2413, 0.3351, 0.2750, 0.2568, 0.2273}, {0.7028, 0.5503, 0.5503, 0.4815, 0.5006, 0.4764, 0.4810, 0.5124, 0.4964, 0.4485, 0.5497, 0.3971, 0.4239, 0.3701, 0.3494, 0.2630, 0.4053, 0.1505, 0.2001,0.2024,0.1788,0.2124,0.2668,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1},{1.079518113138858, 1.105622953570353, 1.031337449900606, 1.073342032668810, 1.242636589110353, 1.255054927783647, 1.291463834317768, 1.317048698347491, 1.354485054187984, 0.338534029291017, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33,1, 1,1,1,1,1,1},{0.6980, 0.4694, 0.5379, 0.5483, 0.4982, 0.4737, 0.4611, 0.5051, 0.5020, 0.4672, 0.4357, 0.3957, 0.4389, 0.4344, 0.3645, 0.3661, 0.3301, 0.2179, 0.1730, 0.2536, 0.2389,0.2884,0.2936,0.2226}}; - -//real CE MIESM -/* -double beta1_dlsch_MI[6][MCS_COUNT] = { {1.32955, 0.59522, 0.54024, 0.98698, 0.81305, 0.76976, 0.69258, 0.69713, 0.70546, 0.69111, 0.81904, 0.72664, 0.79491, 0.72562, 0.53980, 0.33134, 0.50550, 0.40602,0.40281,0.47012,0.50510,0.23540,0.32045,1}, {0.59632, 1.08475, 1.02431, 1.07020, 0.90170, 0.97719, 0.95464, 0.92764, 0.86721, 0.85986, 0.64558, 0.80631, 0.82673, 0.82888, 0.87122, 0.77245, 0.29771, 0.43477, 0.55321, 0.61027, 0.56111, 0.57292, 0.39737,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1},{1.808065416202085, 1.754544945430673,1.902272019362616, 1.790054645392961, 1.563204092967629, 1.585258289348813, 1.579349443720310, 1.570650121437345, 1.545055626608596, 1.362229442426877, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33, 1,1,1,1,1,1,1},{0.77532, 1.07544, 1.10571, 1.04099, 0.91638, 0.88644, 0.96405, 0.86709, 0.94066, 0.84430, 1.24478, 1.09665, 1.42604, 0.79541, 0.71847, 0.71604, 0.74561, 0.36431, 0.41536, 0.52175, 0.47096, 0.49977, 0.59728,1}}; -double beta2_dlsch_MI[6][MCS_COUNT] = { {1.36875, 0.59304, 0.53870, 0.98239, 0.81637, 0.76847, 0.69842, 0.69885, 0.69967, 0.69826, 0.82660, 0.70559, 0.78404, 0.70670, 0.55393, 0.36893, 0.52225, 0.39752, 0.40494, 0.46239, 0.49247,0.26900,0.34504,1}, {0.43775, 0.78208, 0.72875, 0.77458, 0.64485, 0.69174, 0.66097, 0.63289, 0.59652, 0.61175, 0.44551, 0.56047, 0.57314, 0.57553, 0.58849, 0.52159, 0.21241, 0.30139, 0.37373, 0.32029, 0.37067, 0.36706, 0.27118,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1},{1.079518113138858, 1.105622953570353, 1.031337449900606, 1.073342032668810, 1.242636589110353, 1.255054927783647, 1.291463834317768, 1.317048698347491, 1.354485054187984, 0.338534029291017, 1.85, 1.79, 1.65, 1.54, 1.46, 1.39, 1.33,1, 1,1,1,1,1,1},{0.54448, 0.73731, 0.79165, 0.74407, 0.68042, 0.64906, 0.71349, 0.62109, 0.65815, 0.60940, 0.90549, 0.78708, 1.03176, 0.58431, 0.53379, 0.51224, 0.52767, 0.26848, 0.29642, 0.36879, 0.34148, 0.35279,0.40633,1}}; -*/ -//ideal channel estimation values -//double beta1_dlsch[6][MCS_COUNT] = { {2.3814, 0.4956, 0.5273, 1.1708, 0.8014, 0.7889, 0.8111, 0.8139, 0.8124, 0.8479, 1.9280, 1.9664, 2.3857, 2.5147, 2.4511, 3.0158, 2.8643, 5.3013, 5.8594, 6.5372, 7.8073, 7.8030, 7.5295, 7.1320}, {0.5146, 0.5549, 0.7405, 0.6913, 0.7349, 0.7000, 0.7539, 0.7955, 0.8074, 0.7760, 1.8150, 1.6561, 1.9280, 2.3563, 2.6699, 2.3086, 3.1601, 4.5316, 5.2870, 6.0983, 6.5635, 7.7024, 9.9592, 6.6173}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1.79358, 1.17908, 2.02600, 1.72040, 1.58618, 1.59039, 1.68111, 1.67062, 1.64911, 1.33274, 4.87800, 3.58797, 3.72338, 5.35700, 2.81752, 1.93472, 2.23259, 1,1,1,1,1,1,1}, {0.4445, 0.5918, 0.7118, 0.7115, 0.7284, 0.7202, 0.7117, 0.8111, 0.8239, 0.7907, 1.8456, 1.8144, 2.3830, 2.6634, 2.6129, 2.8127, 2.7372, 4.9424, 4.8763, 6.8413, 7.1493, 9.4180, 10.1230, 8.9613}}; -//double beta2_dlsch[6][MCS_COUNT] = { {2.3639, 0.4952, 0.5207, 1.1572, 0.8026, 0.7864, 0.7996, 0.8034, 0.8200, 0.8367, 1.8701, 1.9212, 2.2947, 2.4472, 2.4091, 2.9479, 2.8973, 5.0591, 5.5134, 6.1483, 7.2166, 7.5177, 7.5704, 7.2248}, {0.5113, 0.5600, 0.7359, 0.6860, 0.7344, 0.6902, 0.7315, 0.7660, 0.7817, 0.7315, 1.7268, 1.5912, 1.8519, 2.2115, 2.4580, 2.1879, 2.9015, 4.1543, 4.6986, 5.3193, 5.6319, 6.5640, 8.2421, 5.6393}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {0.79479, 0.52872, 0.90005, 0.77170, 0.73220, 0.72060, 0.75433, 0.75451, 0.75989, 0.67655, 1.68525, 1.31100, 1.46573, 1.99843, 1.57293, 1.62852, 2.10636, 1,1,1,1,1,1,1}, {0.4398, 0.5823, 0.7094, 0.7043, 0.7282, 0.7041, 0.6979, 0.7762, 0.7871, 0.7469, 1.7752, 1.7443, 2.2266, 2.4767, 2.4146, 2.6040, 2.5708, 4.4488, 4.4944, 5.9630, 6.3740, 8.1097, 8.4210, 7.8027}}; -const double beta1_dlsch[6][MCS_COUNT] = { {1.199175, 1.085656, 0.983872, 0.843789, 0.816093, 0.853078, 0.899236, 0.919665, 0.888673, 0.924181, 0.814176, 0.794108, 0.770653, 0.826266, 0.982043, 0.979621, 0.985176, 0.901741, 0.870311, 0.911303, 0.898923, 1.003359, 0.988535, 1.030639, 1.151038, 1.116939, 1.214118, 1.219148}, {0.5146, 0.5549, 0.7405, 0.6913, 0.7349, 0.7000, 0.7539, 0.7955, 0.8074, 0.7760, 1.8150, 1.6561, 1.9280, 2.3563, 2.6699, 2.3086, 3.1601, 4.5316, 5.2870, 6.0983, 6.5635, 7.7024, 9.9592, 6.6173}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1.79358, 1.17908, 2.02600, 1.72040, 1.58618, 1.59039, 1.68111, 1.67062, 1.64911, 1.33274, 4.87800, 3.58797, 3.72338, 5.35700, 2.81752, 1.93472, 2.23259, 1,1,1,1,1,1,1}, {0.4445, 0.5918, 0.7118, 0.7115, 0.7284, 0.7202, 0.7117, 0.8111, 0.8239, 0.7907, 1.8456, 1.8144, 2.3830, 2.6634, 2.6129, 2.8127, 2.7372, 4.9424, 4.8763, 6.8413, 7.1493, 9.4180, 10.1230, 8.9613}}; -const double beta2_dlsch[6][MCS_COUNT] = { {0.534622, 0.596561, 0.500838, 0.471721, 0.548218, 0.547974, 0.924245, 0.836484, 0.776917, 0.879691, 0.875722, 0.666933, 0.666393, 0.755377, 1.074985, 1.080290, 1.010914, 0.790892, 0.793435, 0.860249, 0.901508, 0.967060, 0.951372, 1.011493, 1.106151, 1.117076, 1.209397, 1.227790}, {0.5113, 0.5600, 0.7359, 0.6860, 0.7344, 0.6902, 0.7315, 0.7660, 0.7817, 0.7315, 1.7268, 1.5912, 1.8519, 2.2115, 2.4580, 2.1879, 2.9015, 4.1543, 4.6986, 5.3193, 5.6319, 6.5640, 8.2421, 5.6393}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {0.79479, 0.52872, 0.90005, 0.77170, 0.73220, 0.72060, 0.75433, 0.75451, 0.75989, 0.67655, 1.68525, 1.31100, 1.46573, 1.99843, 1.57293, 1.62852, 2.10636, 1,1,1,1,1,1,1}, {0.4398, 0.5823, 0.7094, 0.7043, 0.7282, 0.7041, 0.6979, 0.7762, 0.7871, 0.7469, 1.7752, 1.7443, 2.2266, 2.4767, 2.4146, 2.6040, 2.5708, 4.4488, 4.4944, 5.9630, 6.3740, 8.1097, 8.4210, 7.8027}}; - -//real channel estimation valus -/* -double beta1_dlsch[6][MCS_COUNT] = { {2.50200, 0.84047, 0.78195, 1.37929, 1.16871, 1.11906, 1.06303, 1.07447, 1.11403, 1.09223, 2.82502, 2.87556, 3.51254, 3.62920, 3.53638, 2.35980, 3.74126, 8.66532, 7.31772, 9.86882, 10.64939, 6.75208, 9.50664, 13.63057}, {0.92257, 1, 1.80445, 1.43175, 1.42093, 1.37381, 1.45392, 1.47255, 1.47451, 1.41235, 3.9079, 3.38557, 4.13059, 4.93355, 4.97277, 6.04951, 5.88896, 8.68076, 10.23746, 12.37069, 5.50538, 17.29612, 17.95050, 13.27095}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {1.79255, 1.88213, 4.44226, 2.25150, 1.93710, 2.18504, 2.57389, 1.94322, 1.78515, 2.09265, 2.37459, 1.74442, 1.74346, 1.19705, 1.56149, 1.59604, 1.6, 1,1,1,1,1,1,1}, {0.93374, 1.40389, 1.36670, 1.38679, 1.35707, 1.26353, 1.32360, 1.40164, 1.51843, 1.34863, 3.45839, 3.13726, 3.94768, 4.21966, 4.60750, 4.97894, 5.40755, 8.12814, 10.59221, 12.96427, 13.37323, 14.27206, 16.61779, 17.19656}}; -double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.16829, 1.11186, 1.06287, 1.07292, 1.09946, 1.10650, 2.79174, 2.75655, 3.36651, 3.49011, 3.60903, 2.73517, 3.84009, 8.20312, 7.41739, 9.64081, 10.40911, 8.11765, 10.41923, 9.34300}, {0.67252, 0.8600, 1.28633, 1.01624, 1.03066, 0.97590, 1.02560, 1.01840, 1.00547, 0.97093, 2.72573, 2.33283, 2.86181, 3.40452, 3.47957, 4.08916, 3.97628, 6.14541, 7.11017, 8.42369, 4.04812, 11.42082, 11.57171, 9.28462}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1,1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,1}, {0.85784, 0.90361, 2.09766, 1.08385, 0.96300, 1.04432, 1.22763, 0.99249, 0.95544, 1.12333, 1.37924, 1.12913, 1.30644, 1.19253, 1.75488, 2.13813, 2.10636, 1,1,1,1,1,1,1}, {0.66288, 0.96402, 0.98545, 0.99386, 0.99981, 0.92678, 0.98978, 0.99600, 1.05538, 0.97777, 2.52504, 2.29338, 2.89631, 3.10812, 3.41916, 3.58671, 3.84166, 6.05254, 7.45821, 9.15812, 9.66330, 10.17852, 11.50519, 11.16299}}; - -*/ - -const char NB_functions[7][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5","gNodeB_3GPP",}; -const char NB_timing[2][20]={"synch_to_ext_device","synch_to_other"}; const char ru_if_types[MAX_RU_IF_TYPES][20]={"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"}; -/// lookup table for unscrambling in RX -int16_t unscrambling_lut[65536*16] __attribute__((aligned(32))); -/// lookup table for scrambling in TX -uint8_t scrambling_lut[65536*16] __attribute__((aligned(32))); - #endif diff --git a/openair1/SCHED_NR/extern.h b/openair1/SCHED_NR/extern.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair1/SCHED_NR/fapi_nr_l1.h b/openair1/SCHED_NR/fapi_nr_l1.h index f598b263c3..b845bad1c0 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.h +++ b/openair1/SCHED_NR/fapi_nr_l1.h @@ -31,7 +31,6 @@ */ #include "PHY/defs_gNB.h" -#include "PHY/phy_extern.h" #include "SCHED_NR/sched_nr.h" #include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h" diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 2708cbd161..9aca5b48e1 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -31,7 +31,6 @@ */ #include "PHY/defs_gNB.h" -#include "PHY/phy_extern.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "nfapi_nr_interface_scf.h" #include "fapi_nr_l1.h" diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 003871df64..551bc60d95 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -34,7 +34,6 @@ #include "sched_nr.h" #include "PHY/MODULATION/modulation_common.h" #include "PHY/MODULATION/nr_modulation.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "common/utils/LOG/log.h" #include "common/utils/system.h" diff --git a/openair1/SCHED_NR/phy_frame_config_nr.h b/openair1/SCHED_NR/phy_frame_config_nr.h index aba26283ed..487e2aaea7 100644 --- a/openair1/SCHED_NR/phy_frame_config_nr.h +++ b/openair1/SCHED_NR/phy_frame_config_nr.h @@ -29,6 +29,8 @@ * ************************************************************************/ +#include "PHY/defs_gNB.h" + #ifndef PHY_FRAME_CONFIG_NR_H #define PHY_FRAME_CONFIG_NR_H diff --git a/openair1/SCHED_NR/phy_procedures_nr_common.c b/openair1/SCHED_NR/phy_procedures_nr_common.c deleted file mode 100644 index 8d1f615569..0000000000 --- a/openair1/SCHED_NR/phy_procedures_nr_common.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file phy_procedures_lte_eNB.c -* \brief Implementation of common utilities for eNB/UE procedures from 36.213 LTE specifications -* \author R. Knopp, F. Kaltenberger -* \date 2011 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr -* \note -* \warning -*/ - -#include "sched_nr.h" -#include "PHY/INIT/phy_init.h" - diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 32b1e67162..909459f652 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -30,7 +30,6 @@ #include "PHY/defs_gNB.h" #include "PHY_INTERFACE/phy_interface.h" -#include "SCHED/sched_eNB.h" #include "PHY/NR_TRANSPORT/nr_dci.h" #include "phy_frame_config_nr.h" diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index e7fc09e4a2..e3134c24f6 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -35,7 +35,6 @@ #include "fapi_nr_ue_interface.h" #include "fapi_nr_ue_l1.h" #include "harq_nr.h" -//#include "PHY/phy_vars_nr_ue.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" #include "PHY/defs_nr_UE.h" #include "PHY/impl_defs_nr.h" diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 056b986cf1..a68411c4cf 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -43,7 +43,6 @@ #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" -#include "SCHED_NR/extern.h" #include "SCHED_NR_UE/phy_sch_processing_time.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" #ifdef EMOS diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c index 5e53b3e17b..7871b34f32 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c @@ -296,77 +296,3 @@ void set_csi_nr(int csi_status, uint32_t csi_payload) } } -uint8_t get_nb_symbols_pucch(NR_PUCCH_Resource_t *pucch_resource, pucch_format_nr_t format_type) -{ - switch (format_type) { - case pucch_format0_nr: - return pucch_resource->format.choice.format0->nrofSymbols; - - case pucch_format1_nr: - return pucch_resource->format.choice.format1->nrofSymbols; - - case pucch_format2_nr: - return pucch_resource->format.choice.format2->nrofSymbols; - - case pucch_format3_nr: - return pucch_resource->format.choice.format3->nrofSymbols; - - case pucch_format4_nr: - return pucch_resource->format.choice.format4->nrofSymbols; - } - return 0; -} - -uint16_t get_starting_symb_idx(NR_PUCCH_Resource_t *pucch_resource, pucch_format_nr_t format_type) -{ - switch (format_type) { - case pucch_format0_nr: - return pucch_resource->format.choice.format0->startingSymbolIndex; - - case pucch_format1_nr: - return pucch_resource->format.choice.format1->startingSymbolIndex; - - case pucch_format2_nr: - return pucch_resource->format.choice.format2->startingSymbolIndex; - - case pucch_format3_nr: - return pucch_resource->format.choice.format3->startingSymbolIndex; - - case pucch_format4_nr: - return pucch_resource->format.choice.format4->startingSymbolIndex; - } - return 0; -} - -int get_ics_pucch(NR_PUCCH_Resource_t *pucch_resource, pucch_format_nr_t format_type) -{ - switch (format_type) { - case pucch_format0_nr: - return pucch_resource->format.choice.format0->initialCyclicShift; - - case pucch_format1_nr: - return pucch_resource->format.choice.format1->initialCyclicShift; - - case pucch_format2_nr: - return 0; - - default: - return -1; - } - return -1; -} - -NR_PUCCH_Resource_t *select_resource_by_id(int resource_id, NR_PUCCH_Config_t *pucch_config) -{ - int n_list = pucch_config->resourceToAddModList->list.count; - NR_PUCCH_Resource_t *pucchres; - AssertFatal(n_list>0,"PUCCH resourceToAddModList is empty\n"); - - for (int i=0; iresourceToAddModList->list.array[i]; - if (pucchres->pucch_ResourceId == resource_id) - return pucchres; - } - return NULL; -} - diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h index 26404427ce..8bfb692e46 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h @@ -41,7 +41,6 @@ /************** INCLUDE *******************************************/ #include "PHY/defs_nr_UE.h" -#include "RRC/NR_UE/rrc_proto.h" #ifdef DEFINE_VARIABLES_PUCCH_UE_NR_H #define EXTERN @@ -66,11 +65,4 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, void set_csi_nr(int csi_status, uint32_t csi_payload); -uint8_t get_nb_symbols_pucch(NR_PUCCH_Resource_t *pucch_resource, pucch_format_nr_t format_type); - -uint16_t get_starting_symb_idx(NR_PUCCH_Resource_t *pucch_resource, pucch_format_nr_t format_type); - -int get_ics_pucch(NR_PUCCH_Resource_t *pucch_resource, pucch_format_nr_t format_type); - -NR_PUCCH_Resource_t *select_resource_by_id(int resource_id, NR_PUCCH_Config_t *pucch_config); #endif /* PUCCH_UCI_UE_NR_H */ diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index cc30b29dc5..166980da14 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -43,7 +43,6 @@ #include "OCG_extern.h" #include "RRC/LTE/rrc_extern.h" -#include "RRC/NR/nr_rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index d5663e8032..8aee2cc5a3 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -36,6 +36,9 @@ #include "nr_mac.h" #include "common/utils/nr/nr_common.h" +#define NB_SRS_PERIOD (18) +static const uint16_t srs_period[NB_SRS_PERIOD] = { 0, 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560}; + typedef enum { pusch_dmrs_pos0 = 0, pusch_dmrs_pos1 = 1, diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h index 1b47ea6ede..47d578a107 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h @@ -44,20 +44,6 @@ extern dci_pdu_rel15_t *def_dci_pdu_rel15; /* Scheduler */ extern RAN_CONTEXT_t RC; extern uint8_t nfapi_mode; -extern mac_rlc_am_muilist_t rlc_am_mui; -extern SCHEDULER_MODES global_scheduler_mode; - -/*#if defined(PRE_SCD_THREAD) -extern const int cqi_to_mcs[16]; -extern uint8_t rb_table[34]; - -#if defined(PRE_SCD_THREAD) -extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; -extern uint8_t dlsch_ue_select_tbl_in_use; -extern uint8_t new_dlsch_ue_select_tbl_in_use; -extern bool pre_scd_activeUE[NUMBER_OF_UE_MAX]; -extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; -#endif*/ extern const uint32_t NR_SHORT_BSR_TABLE[NR_SHORT_BSR_TABLE_SIZE]; extern const uint32_t NR_LONG_BSR_TABLE[NR_LONG_BSR_TABLE_SIZE]; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 40de95be60..f55a3f1a27 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -42,6 +42,7 @@ #include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "SCHED_NR/phy_frame_config_nr.h" +#include "openair1/PHY/defs_gNB.h" #include "NR_MIB.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 7b545cc45c..1282a0625c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -51,7 +51,6 @@ extern uint16_t sl_ahead; uint8_t DELTA[4]= {2,3,4,6}; -#define MAX_NUMBER_OF_SSB 64 float ssb_per_rach_occasion[8] = {0.125,0.25,0.5,1,2,4,8}; int16_t ssb_index_from_prach(module_id_t module_idP, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 2ce7877eb7..e2b4542a80 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -35,20 +35,6 @@ #include "LAYER2/NR_MAC_COMMON/nr_mac.h" #include "executables/softmodem-common.h" #include "common/utils/nr/nr_common.h" -#include "NR_SCS-SpecificCarrier.h" -#include "NR_TDD-UL-DL-ConfigCommon.h" -#include "NR_FrequencyInfoUL.h" -#include "NR_RACH-ConfigGeneric.h" -#include "NR_RACH-ConfigCommon.h" -#include "NR_PUSCH-TimeDomainResourceAllocation.h" -#include "NR_PUSCH-ConfigCommon.h" -#include "NR_PUCCH-ConfigCommon.h" -#include "NR_PDSCH-TimeDomainResourceAllocation.h" -#include "NR_PDSCH-ConfigCommon.h" -#include "NR_RateMatchPattern.h" -#include "NR_RateMatchPatternLTE-CRS.h" -#include "NR_SearchSpace.h" -#include "NR_ControlResourceSet.h" //#define UL_HARQ_PRINT extern RAN_CONTEXT_t RC; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index e35b1cda71..4814250fd9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -47,7 +47,6 @@ #include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h" /* TODO REMOVE_DU_RRC: the RRC in the DU is a hack and should be taken out in the future */ -#include "RRC/LTE/rrc_extern.h" #include "RRC/NR/nr_rrc_extern.h" #include "RRC/NR/rrc_gNB_UE_context.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" @@ -56,11 +55,6 @@ #include "intertask_interface.h" #include "T.h" -#include "NR_PDCCH-ConfigCommon.h" -#include "NR_ControlResourceSet.h" -#include "NR_SearchSpace.h" - -#include "nfapi_nr_interface.h" #define ENABLE_MAC_PAYLOAD_DEBUG #define DEBUG_gNB_SCHEDULER 1 @@ -2493,7 +2487,7 @@ void reset_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) { add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); } - for (int i = 0; i < NR_MAX_NB_HARQ_PROCESSES; i++) { + for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) { sched_ctrl->harq_processes[i].feedback_slot = -1; sched_ctrl->harq_processes[i].round = 0; sched_ctrl->harq_processes[i].is_waiting = false; @@ -2512,7 +2506,7 @@ void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) { add_tail_nr_list(&sched_ctrl->available_ul_harq, harq); } - for (int i = 0; i < NR_MAX_NB_HARQ_PROCESSES; i++) { + for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) { sched_ctrl->ul_harq_processes[i].feedback_slot = -1; sched_ctrl->ul_harq_processes[i].round = 0; sched_ctrl->ul_harq_processes[i].is_waiting = false; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index d3a9e5ae92..5caea0c2c7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -27,7 +27,6 @@ */ #include -#include "LAYER2/MAC/mac.h" #include "NR_MAC_gNB/nr_mac_gNB.h" #include "NR_MAC_COMMON/nr_mac_extern.h" #include "NR_MAC_gNB/mac_proto.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 37435664da..22c1619ea6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -51,11 +51,8 @@ /* RRC */ #include "NR_BCCH-BCH-Message.h" #include "NR_CellGroupConfig.h" -#include "NR_ServingCellConfigCommon.h" -#include "NR_MeasConfig.h" /* PHY */ -#include "PHY/defs_gNB.h" #include "time_meas.h" /* Interface */ @@ -64,8 +61,6 @@ #include "mac_rrc_ul.h" /* MAC */ -#include "LAYER2/MAC/mac.h" -#include "LAYER2/MAC/mac_proto.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" #include "NR_TAG.h" @@ -80,9 +75,11 @@ /*!\brief Maximum number of random access process */ #define NR_NB_RA_PROC_MAX 4 #define MAX_NUM_OF_SSB 64 - +#define MAX_NUM_NR_PRACH_PREAMBLES 64 #define MIN_NUM_PRBS_TO_SCHEDULE 5 +extern const uint8_t nr_rv_round_map[4]; + /*! \brief NR_list_t is a "list" (of users, HARQ processes, slices, ...). * Especially useful in the scheduler and to keep "classes" of users. */ typedef struct { @@ -586,7 +583,7 @@ typedef struct { struct CSI_Report CSI_report; bool SR; /// information about every HARQ process - NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; + NR_UE_harq_t harq_processes[NR_MAX_HARQ_PROCESSES]; /// HARQ processes that are free NR_list_t available_dl_harq; /// HARQ processes that await feedback @@ -594,7 +591,7 @@ typedef struct { /// HARQ processes that await retransmission NR_list_t retrans_dl_harq; /// information about every UL HARQ process - NR_UE_ul_harq_t ul_harq_processes[NR_MAX_NB_HARQ_PROCESSES]; + NR_UE_ul_harq_t ul_harq_processes[NR_MAX_HARQ_PROCESSES]; /// UL HARQ processes that are free NR_list_t available_ul_harq; /// UL HARQ processes that await feedback @@ -671,8 +668,6 @@ typedef struct { bool Msg3_dcch_dtch; bool Msg4_ACKed; uint32_t ra_timer; - /// Sched CSI-RS: scheduling decisions - NR_gNB_UCI_STATS_t uci_statS; float ul_thr_ue; float dl_thr_ue; } NR_UE_info_t; diff --git a/openair2/RRC/NR/nr_rrc_common.c b/openair2/RRC/NR/nr_rrc_common.c index 85e9c71eaa..d67d15acc1 100644 --- a/openair2/RRC/NR/nr_rrc_common.c +++ b/openair2/RRC/NR/nr_rrc_common.c @@ -39,7 +39,6 @@ #include "asn1_msg.h" #include "pdcp.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "rrc_eNB_UE_context.h" #include "common/ran_context.h" #define DEBUG_NR_RRC 1 diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 0ca8796fb4..b8982d0bd5 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -45,8 +45,6 @@ #include "mac_rrc_dl.h" #include "cucp_cuup_if.h" -//#include "COMMON/mac_rrc_primitives.h" - #include "NR_SIB1.h" #include "NR_RRCReconfigurationComplete.h" #include "NR_RRCReconfiguration.h" @@ -57,11 +55,7 @@ #include "NR_PLMN-IdentityInfo.h" #include "NR_MCC-MNC-Digit.h" #include "NR_NG-5G-S-TMSI.h" -//#include "MCCH-Message.h" -//#include "MBSFNAreaConfiguration-r9.h" -//#include "SCellToAddMod-r10.h" -//#include "AS-Config.h" -//#include "AS-Context.h" + #include "NR_UE-NR-Capability.h" #include "NR_UE-MRDC-Capability.h" #include "NR_MeasResults.h" diff --git a/openair2/RRC/NR/nr_rrc_extern.h b/openair2/RRC/NR/nr_rrc_extern.h index 70493f1010..f5d9f4d2e4 100644 --- a/openair2/RRC/NR/nr_rrc_extern.h +++ b/openair2/RRC/NR/nr_rrc_extern.h @@ -32,9 +32,7 @@ #define __OPENAIR_NR_RRC_EXTERN_H__ #include "nr_rrc_defs.h" #include "COMMON/mac_rrc_primitives.h" -#include "LAYER2/MAC/mac.h" #include "LAYER2/RLC/rlc.h" -#include "openair2/RRC/LTE/rrc_defs.h" #include "openair2/RRC/common.h" #define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits. diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 93e2cea421..8e68e7312c 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -60,8 +60,6 @@ #include "NR_CellGroupConfig.h" #include "NR_MeasResults.h" -#include "LTE_UECapabilityInformation.h" -#include "LTE_UL-DCCH-Message.h" #include "NR_UL-CCCH-Message.h" #include "NR_RRCSetupRequest-IEs.h" #include "NR_RRCSetupComplete-IEs.h" @@ -69,7 +67,6 @@ #include "NR_MIB.h" #include "rlc.h" -#include "rrc_eNB_UE_context.h" #include "platform_types.h" #include "common/utils/LOG/vcd_signal_dumper.h" @@ -82,7 +79,6 @@ #include "UTIL/OSA/osa_defs.h" -#include "rrc_eNB_S1AP.h" #include "rrc_gNB_NGAP.h" #include "rrc_gNB_GTPV1U.h"