From 384d1eedf6e58b7f3e743886c2d57c6e4b581894 Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Mon, 9 Mar 2026 18:21:06 +0100 Subject: [PATCH 1/5] Fix for unit tests --- openair1/PHY/INIT/nr_parms.h | 27 +++++++++++++++++++ openair1/PHY/INIT/nr_phy_init.h | 9 +------ .../PHY/INIT/tests/test_nr_frame_params.cpp | 2 +- .../tests/test_nr_ue_power_procedures.cpp | 2 +- .../tests/test_nr_ue_ra_procedures.cpp | 2 +- 5 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 openair1/PHY/INIT/nr_parms.h diff --git a/openair1/PHY/INIT/nr_parms.h b/openair1/PHY/INIT/nr_parms.h new file mode 100644 index 0000000000..4959f28260 --- /dev/null +++ b/openair1/PHY/INIT/nr_parms.h @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef _NR_PARMS_H_ +#define _NR_PARMS_H_ +#include "fapi_nr_ue_interface.h" +#include "openair1/PHY/defs_nr_UE.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); +int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); +void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell); +int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp, + sl_nr_phy_config_request_t *config, + int threequarter_fs, + uint32_t ofdm_offset_divisor); +void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/openair1/PHY/INIT/nr_phy_init.h b/openair1/PHY/INIT/nr_phy_init.h index 30af36a503..38d691f675 100644 --- a/openair1/PHY/INIT/nr_phy_init.h +++ b/openair1/PHY/INIT/nr_phy_init.h @@ -7,19 +7,12 @@ #include "PHY/defs_gNB.h" #include "PHY/defs_nr_UE.h" +#include "nr_parms.h" int nr_get_ssb_start_symbol(const NR_DL_FRAME_PARMS *fp, uint8_t i_ssb); -void nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); -int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); -void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, const nrUE_cell_params_t *cell); -int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp, - sl_nr_phy_config_request_t *config, - int threequarter_fs, - uint32_t ofdm_offset_divisor); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); void term_nr_ue_signal(PHY_VARS_NR_UE *ue); void init_nr_ue_transport(PHY_VARS_NR_UE *ue); -void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); void phy_init_nr_gNB(PHY_VARS_gNB *gNB); int init_codebook_gNB(PHY_VARS_gNB *gNB); void nr_phy_config_request(NR_PHY_Config_t *gNB); diff --git a/openair1/PHY/INIT/tests/test_nr_frame_params.cpp b/openair1/PHY/INIT/tests/test_nr_frame_params.cpp index 5c44308170..74c24a13e0 100644 --- a/openair1/PHY/INIT/tests/test_nr_frame_params.cpp +++ b/openair1/PHY/INIT/tests/test_nr_frame_params.cpp @@ -6,7 +6,7 @@ extern "C" { #include #include "openair1/PHY/defs_nr_common.h" -#include "openair1/PHY/INIT/nr_phy_init.h" +#include "openair1/PHY/INIT/nr_parms.h" static softmodem_params_t softmodem_params; softmodem_params_t *get_softmodem_params(void) diff --git a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp index a6b051a7c2..c6ac903a4c 100644 --- a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp +++ b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_power_procedures.cpp @@ -691,7 +691,7 @@ TEST(test_srs_power, tpc_accumulation) int main(int argc, char** argv) { logInit(); - uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); + load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); g_log->log_component[MAC].level = OAILOG_DEBUG; g_log->log_component[NR_MAC].level = OAILOG_DEBUG; testing::InitGoogleTest(&argc, argv); diff --git a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp index 296d1e2ab6..47c7ad4027 100644 --- a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp +++ b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp @@ -134,7 +134,7 @@ TEST(test_init_ra, four_step_cfra) int main(int argc, char **argv) { logInit(); - uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); + load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY); g_log->log_component[MAC].level = OAILOG_DEBUG; g_log->log_component[NR_MAC].level = OAILOG_DEBUG; testing::InitGoogleTest(&argc, argv); From a71cd36248c7970caa837944785fc7e327b1526e Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 24 Mar 2026 10:26:43 +0100 Subject: [PATCH 2/5] compilation improvements aroung impl_defs_top file --- common/utils/nr/nr_common.h | 8 ++ executables/nr-ru.c | 2 +- executables/nr-ue.c | 1 - nfapi/oai_integration/nfapi_pnf.c | 15 ++-- .../nfapi/public_inc/fapi_nr_ue_interface.h | 1 - .../pnf/public_inc/nfapi_pnf_interface.h | 6 +- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 18 ++-- openair1/PHY/CODING/coding_defs.h | 32 ++++++++ openair1/PHY/CODING/nrLDPC_defs.h | 1 + .../nrPolar_tools/nr_polar_decoding_tools.c | 3 +- openair1/PHY/INIT/nr_init_ue.c | 35 ++++---- openair1/PHY/INIT/nr_phy_init.h | 8 +- .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 1 + openair1/PHY/MODULATION/modulation_common.h | 8 ++ openair1/PHY/NR_REFSIG/dmrs_nr.c | 82 ------------------- openair1/PHY/NR_REFSIG/dmrs_nr.h | 1 - openair1/PHY/NR_TRANSPORT/nr_dci.h | 4 - openair1/PHY/NR_TRANSPORT/nr_prach.c | 6 +- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 7 +- .../PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 1 - .../PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 2 - .../nr_dl_channel_estimation.c | 4 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 2 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 10 +-- .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 11 ++- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 2 +- openair1/PHY/TOOLS/calibration_scope.c | 2 +- openair1/PHY/TOOLS/calibration_test.c | 2 +- openair1/PHY/defs_RU.h | 10 +-- openair1/PHY/defs_UE.h | 1 + openair1/PHY/defs_common.h | 36 +------- openair1/PHY/defs_gNB.h | 31 ++++++- openair1/PHY/defs_nr_UE.h | 7 +- openair1/PHY/defs_nr_common.h | 36 +------- openair1/PHY/impl_defs_top.h | 12 --- openair1/SCHED_NR/nr_prach_procedures.c | 2 +- openair1/SCHED_NR_UE/defs.h | 2 - openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 +- openair1/SCHED_NR_UE/harq_nr.c | 6 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 12 +-- openair1/SIMULATION/NR_PHY/ulschsim.c | 4 +- openair2/LAYER2/NR_MAC_UE/config_ue_sl.c | 6 +- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 3 +- .../LAYER2/NR_MAC_UE/nr_ue_power_procedures.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/PHY_INTERFACE/phy_stub_UE.h | 1 + openair2/UTIL/OPT/probe.c | 1 + radio/fhi_72/oran_isolate.h | 2 +- 48 files changed, 179 insertions(+), 276 deletions(-) diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d8a16312ad..8580a0491b 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -25,6 +25,9 @@ #define NR_NB_SC_PER_RB 12 #define NR_MAX_NUM_LCID 32 #define NR_MAX_NUM_QFI 64 +#define MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 36 +#define MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER 34 +#define NR_MAX_SLOTS_PER_FRAME 160 #define RNTI_NAMES /* see 38.321 Table 7.1-2 RNTI usage */ \ R(TYPE_C_RNTI_) /* Cell RNTI */ \ R(TYPE_CS_RNTI_) /* Configured Scheduling RNTI */ \ @@ -41,6 +44,11 @@ R(TYPE_TPC_SRS_RNTI_) \ R(TYPE_MCS_C_RNTI_) +/* FFS_NR_TODO it defines ue capability which is the number of slots */ +/* - between reception of pdsch and transmission of its acknowlegment (k1) */ +/* - between reception of un uplink grant and its related transmission (k2) */ +#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3) + #define R(k) k , typedef enum { RNTI_NAMES } nr_rnti_type_t; #undef R diff --git a/executables/nr-ru.c b/executables/nr-ru.c index f6e73b9e6a..8a10fade9a 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -982,7 +982,7 @@ void *ru_thread(void *param) // Do PRACH RU processing prach_item_t *p = - find_nr_prach(&gNB->prach_list, proc->frame_rx, proc->tti_rx, gNB->frame_parms.nb_antennas_rx, SEARCH_EXIST); + find_nr_prach(&gNB->prach_list, proc->frame_rx, proc->tti_rx, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST); if (p) { // need to extract RACH data for later processing by rx_nr_prach() rx_nr_prach_ru(p, ru->common.rxdata, ru->nr_frame_parms, ru->N_TA_offset); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index cf5762e8c7..ac7dace077 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -5,7 +5,6 @@ #include "PHY/defs_nr_common.h" #define _GNU_SOURCE // For pthread_setname_np #include -#include #include "executables/nr-ue-ru.h" #include "executables/nr-uesoftmodem.h" #include "PHY/INIT/nr_phy_init.h" diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index dd10a86a59..187580cd94 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1090,14 +1090,13 @@ void pnf_nr_phy_deallocate_p7_vendor_ext(void *header) } -int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_hi_dci0_request_t *req) { +int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_hi_dci0_request_t *req) { if (req->hi_dci0_request_body.number_of_dci == 0 && req->hi_dci0_request_body.number_of_hi == 0) LOG_D(PHY,"[PNF] HI_DCI0_REQUEST SFN/SF:%05d dci:%d hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi); //phy_info* phy = (phy_info*)(pnf_p7->user_data); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - if (proc ==NULL) - proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; for (int i=0; ihi_dci0_request_body.number_of_dci + req->hi_dci0_request_body.number_of_hi; i++) { //LOG_D(PHY,"[PNF] HI_DCI0_REQ sfn_sf:%d PDU[%d]\n", NFAPI_SFNSF2DEC(req->sfn_sf), i); @@ -1119,7 +1118,7 @@ int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfa } -int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) { +int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) { if (RC.eNB == 0) { return -2; @@ -1137,8 +1136,7 @@ int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n int sfn = NFAPI_SFNSF2SFN(req->sfn_sf); int sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - if (proc==NULL) - proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_dl_config_request_pdu_t *dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[sf&1]; pdcch_vars->num_pdcch_symbols = req->dl_config_request_body.number_pdcch_ofdm_symbols; @@ -1236,7 +1234,7 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) { return 0; } -int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_ul_config_request_t *req) { +int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_ul_config_request_t *req) { if (0)LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), @@ -1262,8 +1260,7 @@ int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n uint16_t curr_sfn = NFAPI_SFNSF2SFN(req->sfn_sf); uint16_t curr_sf = NFAPI_SFNSF2SF(req->sfn_sf); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - if (proc==NULL) - proc = &eNB->proc.L1_proc; + L1_rxtx_proc_t *proc = &eNB->proc.L1_proc; nfapi_ul_config_request_pdu_t *ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list; for (int i=0; iul_config_request_body.number_of_pdus; i++) { diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index da0b0ee78b..1ccaf2ee68 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -10,7 +10,6 @@ #include "stddef.h" #include "common/platform_types.h" #include "fapi_nr_ue_constants.h" -#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_nr.h" #include "common/utils/nr/nr_common.h" #include "executables/position_interface.h" diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h index 6cf323da78..7e6926627a 100644 --- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h +++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h @@ -706,7 +706,7 @@ typedef struct nfapi_pnf_p7_config * \return not currently used */ int (*dl_tti_req_fn)(gNB_L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req); - int (*dl_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req); + int (*dl_config_req)(nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req); /*! A callback for the UL_CONFIG.request * \param config A poiner to the PNF P7 config @@ -714,7 +714,7 @@ typedef struct nfapi_pnf_p7_config * \return not currently used */ int (*ul_tti_req_fn)(gNB_L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req); - int (*ul_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req); + int (*ul_config_req)(nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req); /*! A callback for the HI_DCI0.request * \param config A poiner to the PNF P7 config @@ -722,7 +722,7 @@ typedef struct nfapi_pnf_p7_config * \return not currently used */ int (*ul_dci_req_fn)(gNB_L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req); - int (*hi_dci0_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req); + int (*hi_dci0_req)(nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req); /*! A callback for the TX_REQ.request * \param config A poiner to the PNF P7 config diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index f935e30fb6..0b3ac77d86 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -639,20 +639,20 @@ void send_dummy_subframe(pnf_p7_t* pnf_p7, uint16_t sfn_sf) { pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf; //NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - enter\n"); - (pnf_p7->_public.dl_config_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); + (pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); //NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy dl_config_req - exit\n"); } if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req) { pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf; NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy ul_config_req - enter\n"); - (pnf_p7->_public.ul_config_req)(NULL, &pnf_p7->_public, pnf_p7->_public.dummy_subframe.ul_config_req); + (pnf_p7->_public.ul_config_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.ul_config_req); } if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req) { pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf; NFAPI_TRACE(NFAPI_TRACE_INFO, "Dummy hi_dci0 - enter\n"); - (pnf_p7->_public.hi_dci0_req)(NULL, &pnf_p7->_public, pnf_p7->_public.dummy_subframe.hi_dci0_req); + (pnf_p7->_public.hi_dci0_req)(&pnf_p7->_public, pnf_p7->_public.dummy_subframe.hi_dci0_req); } if(pnf_p7->_public.lbt_dl_config_req && pnf_p7->_public.dummy_subframe.lbt_dl_config_req) { @@ -892,7 +892,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(tx_subframe_buffer->dl_config_req != 0) { if(pnf_p7->_public.dl_config_req) - (pnf_p7->_public.dl_config_req)(NULL, &(pnf_p7->_public), tx_subframe_buffer->dl_config_req); + (pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), tx_subframe_buffer->dl_config_req); //deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7); } @@ -902,14 +902,14 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(pnf_p7->_public.dl_config_req && pnf_p7->_public.dummy_subframe.dl_config_req) { pnf_p7->_public.dummy_subframe.dl_config_req->sfn_sf = sfn_sf_tx; - (pnf_p7->_public.dl_config_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); + (pnf_p7->_public.dl_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.dl_config_req); } } if(tx_subframe_buffer->hi_dci0_req != 0) { if(pnf_p7->_public.hi_dci0_req) - (pnf_p7->_public.hi_dci0_req)(NULL, &(pnf_p7->_public), tx_subframe_buffer->hi_dci0_req); + (pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), tx_subframe_buffer->hi_dci0_req); //deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7); } @@ -919,7 +919,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(pnf_p7->_public.hi_dci0_req && pnf_p7->_public.dummy_subframe.hi_dci0_req) { pnf_p7->_public.dummy_subframe.hi_dci0_req->sfn_sf = sfn_sf_tx; - (pnf_p7->_public.hi_dci0_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.hi_dci0_req); + (pnf_p7->_public.hi_dci0_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.hi_dci0_req); } } @@ -970,7 +970,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(subframe_buffer->ul_config_req != 0) { if(pnf_p7->_public.ul_config_req) - (pnf_p7->_public.ul_config_req)(NULL, &(pnf_p7->_public), subframe_buffer->ul_config_req); + (pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), subframe_buffer->ul_config_req); //deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7); } @@ -980,7 +980,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) if(pnf_p7->_public.ul_config_req && pnf_p7->_public.dummy_subframe.ul_config_req) { pnf_p7->_public.dummy_subframe.ul_config_req->sfn_sf = sfn_sf; - (pnf_p7->_public.ul_config_req)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req); + (pnf_p7->_public.ul_config_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_subframe.ul_config_req); } } diff --git a/openair1/PHY/CODING/coding_defs.h b/openair1/PHY/CODING/coding_defs.h index 7503854c07..b705a1f81f 100644 --- a/openair1/PHY/CODING/coding_defs.h +++ b/openair1/PHY/CODING/coding_defs.h @@ -10,6 +10,7 @@ #include #include +#include #include "common/utils/nr/nr_common.h" #define CRC24_A 0 @@ -20,6 +21,37 @@ #define MAX_TURBO_ITERATIONS_MBSFN 8 #define MAX_TURBO_ITERATIONS max_turbo_iterations +typedef struct { + pthread_mutex_t mutex_failure; + bool failed; +} decode_abort_t; + +static inline void init_abort(decode_abort_t *ab) +{ + int ret = pthread_mutex_init(&ab->mutex_failure, NULL); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + ab->failed = false; +} + +static inline bool check_abort(decode_abort_t *ab) +{ + int ret = pthread_mutex_lock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + bool failed = ab->failed; + ret = pthread_mutex_unlock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + return failed; +} + +static inline void set_abort(decode_abort_t *ab, bool v) +{ + int ret = pthread_mutex_lock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); + ab->failed = v; + ret = pthread_mutex_unlock(&ab->mutex_failure); + AssertFatal(ret == 0, "mutex failed with %d\n", ret); +} + static inline int lenWithCrc(int nbSeg, int len) { if (nbSeg > 1) diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index e63bbf855f..70d4f92761 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -7,6 +7,7 @@ #define __NRLDPC_DEFS__H__ #include #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" +#include "common/utils/threadPool/task_ans.h" /** \brief LDPC encoder parameter structure diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c index 865fbc5dc4..ab11be251d 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c @@ -1,10 +1,9 @@ /* * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ - +#include #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/sse_intrin.h" -#include "PHY/impl_defs_top.h" // #define DEBUG_NEW_IMPL 1 diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 8fb5c3b124..ed3dbfc75a 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -322,8 +322,8 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue) sl_ue_free(ue); } -void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb) { - +void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb) +{ uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; if (num_rb != 273) { a_segments = a_segments*num_rb; @@ -344,8 +344,8 @@ void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES } } -void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) { - +void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) +{ int max_layers = (num_ant_tx < NR_MAX_NB_LAYERS) ? num_ant_tx : NR_MAX_NB_LAYERS; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated @@ -371,12 +371,12 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue) { const int N_RB_DL = ue->frame_parms.N_RB_DL; const int N_RB_UL = ue->frame_parms.N_RB_UL; - free_nr_ue_dl_harq(ue->dl_harq_processes, NR_MAX_DLSCH_HARQ_PROCESSES, N_RB_DL); - free_nr_ue_ul_harq(ue->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, N_RB_UL, ue->frame_parms.nb_antennas_tx); + free_nr_ue_dl_harq(ue->dl_harq_processes, NR_MAX_HARQ_PROCESSES, N_RB_DL); + free_nr_ue_ul_harq(ue->ul_harq_processes, NR_MAX_HARQ_PROCESSES, N_RB_UL, ue->frame_parms.nb_antennas_tx); } -void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb) { - +void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb) +{ int a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated if (num_rb != 273) { a_segments = a_segments*num_rb; @@ -403,8 +403,8 @@ void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PR } } -void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) { - +void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx) +{ int max_layers = (num_ant_tx < NR_MAX_NB_LAYERS) ? num_ant_tx : NR_MAX_NB_LAYERS; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated @@ -447,24 +447,21 @@ void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCE } } -void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { - - nr_init_dl_harq_processes(ue->dl_harq_processes, NR_MAX_DLSCH_HARQ_PROCESSES, ue->frame_parms.N_RB_DL); - nr_init_ul_harq_processes(ue->ul_harq_processes, - NR_MAX_ULSCH_HARQ_PROCESSES, - ue->frame_parms.N_RB_UL, - ue->frame_parms.nb_antennas_tx); +void init_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ + nr_init_dl_harq_processes(ue->dl_harq_processes, NR_MAX_HARQ_PROCESSES, ue->frame_parms.N_RB_DL); + nr_init_ul_harq_processes(ue->ul_harq_processes, NR_MAX_HARQ_PROCESSES, ue->frame_parms.N_RB_UL, ue->frame_parms.nb_antennas_tx); } void clean_UE_harq(PHY_VARS_NR_UE *UE) { - for (int harq_pid = 0; harq_pid < NR_MAX_DLSCH_HARQ_PROCESSES; harq_pid++) { + for (int harq_pid = 0; harq_pid < NR_MAX_HARQ_PROCESSES; harq_pid++) { for (int i = 0; i < 2; i++) { NR_DL_UE_HARQ_t *dl_harq_process = &UE->dl_harq_processes[i][harq_pid]; init_downlink_harq_status(dl_harq_process); } } - for (int harq_pid = 0; harq_pid < NR_MAX_ULSCH_HARQ_PROCESSES; harq_pid++) { + for (int harq_pid = 0; harq_pid < NR_MAX_HARQ_PROCESSES; harq_pid++) { NR_UL_UE_HARQ_t *ul_harq_process = &UE->ul_harq_processes[harq_pid]; ul_harq_process->round = 0; } diff --git a/openair1/PHY/INIT/nr_phy_init.h b/openair1/PHY/INIT/nr_phy_init.h index 38d691f675..d18106c7b9 100644 --- a/openair1/PHY/INIT/nr_phy_init.h +++ b/openair1/PHY/INIT/nr_phy_init.h @@ -24,10 +24,10 @@ void reset_nr_transport(PHY_VARS_gNB *gNB); void RCconfig_nrUE_prs(void *cfg); void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue); -void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb); -void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); -void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_DLSCH_HARQ_PROCESSES], int number_of_processes, int num_rb); -void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_ULSCH_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); +void nr_init_dl_harq_processes(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb); +void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); +void free_nr_ue_dl_harq(NR_DL_UE_HARQ_t harq_list[2][NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb); +void free_nr_ue_ul_harq(NR_UL_UE_HARQ_t harq_list[NR_MAX_HARQ_PROCESSES], int number_of_processes, int num_rb, int num_ant_tx); void phy_init_nr_top(PHY_VARS_NR_UE *ue); void phy_term_nr_top(void); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index af1546a43e..210373ad74 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -8,6 +8,7 @@ #ifndef __LTE_TRANSPORT_PROTO_UE__H__ #define __LTE_TRANSPORT_PROTO_UE__H__ #include "PHY/defs_UE.h" +#include "PHY/defs_eNB.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include #include "nfapi_interface.h" diff --git a/openair1/PHY/MODULATION/modulation_common.h b/openair1/PHY/MODULATION/modulation_common.h index 956e546931..b0b6172175 100644 --- a/openair1/PHY/MODULATION/modulation_common.h +++ b/openair1/PHY/MODULATION/modulation_common.h @@ -10,6 +10,14 @@ * @{ */ +/*! \brief Extension Type */ +typedef enum { + CYCLIC_PREFIX, + CYCLIC_SUFFIX, + ZEROS, + NONE +} Extension_t; + /** \fn void PHY_ofdm_mod(int *input,int *output,int fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype) This function performs OFDM modulation with cyclic extension or zero-padding diff --git a/openair1/PHY/NR_REFSIG/dmrs_nr.c b/openair1/PHY/NR_REFSIG/dmrs_nr.c index 32deaf440e..8b55d14a09 100644 --- a/openair1/PHY/NR_REFSIG/dmrs_nr.c +++ b/openair1/PHY/NR_REFSIG/dmrs_nr.c @@ -154,88 +154,6 @@ void pseudo_random_sequence_optimised(unsigned int size, uint32_t *c, uint32_t c } } -/******************************************************************* -* -* NAME : lte_gold_new -* -* PARAMETERS : -* -* RETURN : generate pseudo-random sequence which is a length-31 Gold sequence -* -* DESCRIPTION : This function is the same as "lte_gold" function in file lte_gold.c -* It allows checking that optimization works fine. -* generated sequence is given in an array as a bit map. -* -*********************************************************************/ - -#define CELL_DMRS_LENGTH (224*2) -#define CHECK_GOLD_SEQUENCE - -void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell) -{ - unsigned char ns,l,Ncp=1-frame_parms->Ncp; - uint32_t cinit; - -#ifdef CHECK_GOLD_SEQUENCE - - uint32_t dmrs_bitmap[20][2][14]; - uint32_t *dmrs_sequence = calloc(CELL_DMRS_LENGTH, sizeof(uint32_t)); - if (dmrs_sequence == NULL) { - msg("Fatal error: memory allocation problem \n"); - assert(0); - } - else - { - printf("Check of demodulation reference signal of pbch sequence \n"); - } - -#endif - - /* for each slot number */ - for (ns=0; ns<20; ns++) { - - /* for each ofdm position */ - for (l=0; l<2; l++) { - - cinit = Ncp + - (Nid_cell<<1) + - (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); - - pseudo_random_sequence_optimised(14, &(lte_gold_table[ns][l][0]), cinit); - -#ifdef CHECK_GOLD_SEQUENCE - - pseudo_random_sequence(CELL_DMRS_LENGTH, dmrs_sequence, cinit); - - int j = 0; - int k = 0; - - /* format for getting bitmap from uint32_t */ - for (int i=0; i<14; i++) { - dmrs_bitmap[ns][l][i] = 0; - for (; j < k + 32; j++) { - dmrs_bitmap[ns][l][i] |= (dmrs_sequence[j]<prach_list_mutex); } -prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, find_type_t type) +prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, nr_find_type_t type) { pthread_mutex_lock(&l->prach_list_mutex); AssertFatal(nb_rx, "Error! Number of antennas set to 0.\n"); @@ -37,7 +37,7 @@ prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, fin if ((*p) && (*p)->frame == frame && ((*p)->slot + (*p)->num_slots - 1) == slot) break; if (p == end) { - if (type == SEARCH_EXIST) { + if (type == NR_SEARCH_EXIST) { pthread_mutex_unlock(&l->prach_list_mutex); return NULL; } @@ -67,7 +67,7 @@ prach_item_t *find_nr_prach(prach_list_t *l, int frame, int slot, int nb_rx, fin prach_item_t *nr_schedule_rx_prach(PHY_VARS_gNB *gNB, int SFN, int Slot, nfapi_nr_prach_pdu_t *prach_pdu) { - prach_item_t *prach = find_nr_prach(&gNB->prach_list, SFN, Slot, gNB->frame_parms.nb_antennas_rx, SEARCH_EXIST_OR_FREE); + prach_item_t *prach = find_nr_prach(&gNB->prach_list, SFN, Slot, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST_OR_FREE); if (!prach) { LOG_W(PHY, "no free space for a new detected rach, discarding\n"); return NULL; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 61d8df03b8..9f0dc43e8d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -178,7 +178,12 @@ rx_prach_out_t rx_nr_prach(const prach_item_t *, int occasion); void rx_nr_prach_ru(prach_item_t *, int32_t **, NR_DL_FRAME_PARMS *frame_parms, int N_TA_offset); -prach_item_t *find_nr_prach(prach_list_t *, int frame, int slot, int nb_rx, find_type_t type); +typedef enum { + NR_SEARCH_EXIST = 0, + NR_SEARCH_EXIST_OR_FREE +} nr_find_type_t; + +prach_item_t *find_nr_prach(prach_list_t *, int frame, int slot, int nb_rx, nr_find_type_t type); void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, int slot, diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 4674800eb6..27d0a25b0f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -5,7 +5,6 @@ #include "PHY/defs_gNB.h" #include "PHY/phy_extern.h" #include "nr_transport_proto.h" -#include "PHY/impl_defs_top.h" #include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/ptrs_nr.h" diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 9a45ab52de..2029287f08 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -5,8 +5,6 @@ #include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" -#include "PHY/impl_defs_top.h" - #include "executables/nr-uesoftmodem.h" //#define DEBUG_PHY diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index bda26b0d52..b2e3c276dc 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -1393,7 +1393,7 @@ void nr_pdsch_ptrs_processing(int nbRx, uint16_t *nb_rb = NULL; int nscid = 0; - if(dlsch0_harq->status == ACTIVE) { + if(dlsch0_harq->status == NR_ACTIVE) { symbInSlot = dlsch[0].dlsch_config.start_symbol + dlsch[0].dlsch_config.number_symbols; startSymbIndex = &dlsch[0].dlsch_config.start_symbol; nbSymb = &dlsch[0].dlsch_config.number_symbols; @@ -1437,7 +1437,7 @@ void nr_pdsch_ptrs_processing(int nbRx, phase_per_symbol[symbol].r = 0; // Real } - if(dlsch0_harq->status == ACTIVE) { + if(dlsch0_harq->status == NR_ACTIVE) { if(symbol == *startSymbIndex) { *ptrsSymbPos = 0; set_ptrs_symb_idx(ptrsSymbPos, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index dcbf382c98..90e66cfb19 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -293,7 +293,7 @@ void nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, if (harq_process->decodeResult) { LOG_D(PHY, "DLSCH received ok \n"); - harq_process->status = SCH_IDLE; + harq_process->status = NR_SCH_IDLE; dlsch->last_iteration_cnt = dlsch->max_ldpc_iterations - 1; } else { LOG_D(PHY, "DLSCH received nok \n"); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index b7de100b57..bcae6e011b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -994,7 +994,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dlsch0_harq->status, dlsch1_harq->status); - if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status == ACTIVE)){ + if ((dlsch0_harq->status == NR_ACTIVE) && (dlsch1_harq->status == NR_ACTIVE)){ codeword_TB0 = dlsch0_harq->codeword; // SV: where is this set? revisit for DL MIMO. codeword_TB1 = dlsch1_harq->codeword; dlsch0_harq = &ue->dl_harq_processes[codeword_TB0][harq_pid]; @@ -1002,14 +1002,14 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, DEBUG_HARQ("[DEMOD] I am assuming both TBs are active, in cw0 %d and cw1 %d \n", codeword_TB0, codeword_TB1); - } else if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status != ACTIVE) ) { + } else if ((dlsch0_harq->status == NR_ACTIVE) && (dlsch1_harq->status != NR_ACTIVE) ) { codeword_TB0 = dlsch0_harq->codeword; dlsch0_harq = &ue->dl_harq_processes[codeword_TB0][harq_pid]; dlsch1_harq = NULL; DEBUG_HARQ("[DEMOD] I am assuming only TB0 is active, in cw %d \n", codeword_TB0); - } else if ((dlsch0_harq->status != ACTIVE) && (dlsch1_harq->status == ACTIVE)){ + } else if ((dlsch0_harq->status != NR_ACTIVE) && (dlsch1_harq->status == NR_ACTIVE)){ codeword_TB1 = dlsch1_harq->codeword; dlsch0_harq = NULL; dlsch1_harq = &ue->dl_harq_processes[codeword_TB1][harq_pid]; @@ -1023,7 +1023,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, return (-1); } } else if (dlsch0_harq) { - if (dlsch0_harq->status == ACTIVE) { + if (dlsch0_harq->status == NR_ACTIVE) { codeword_TB0 = dlsch0_harq->codeword; dlsch0_harq = &ue->dl_harq_processes[0][harq_pid]; DEBUG_HARQ("[DEMOD] I am assuming only TB0 is active\n"); @@ -1310,7 +1310,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, int nbSymb = 0; int pduBitmap = 0; - if(dlsch0_harq->status == ACTIVE) { + if(dlsch0_harq->status == NR_ACTIVE) { startSymbIdx = dlsch_config->start_symbol; nbSymb = dlsch_config->number_symbols; pduBitmap = dlsch_config->pduBitmap; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index 8d55da9d39..c57d0c74ce 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -8,8 +8,6 @@ #ifndef __NR_TRANSPORT_UE__H__ #define __NR_TRANSPORT_UE__H__ #include -#include "PHY/impl_defs_top.h" - #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" #include "nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h" #include "../NR_TRANSPORT/nr_transport_common_proto.h" @@ -54,8 +52,13 @@ typedef struct { uint32_t Z; } NR_UL_UE_HARQ_t; +typedef enum { + NR_SCH_IDLE = 0, + NR_ACTIVE +} NR_SCH_status_t; + typedef struct { - SCH_status_t status; + NR_SCH_status_t status; /// NDAPI struct for UE nfapi_nr_ue_pusch_pdu_t pusch_pdu; // UL number of harq processes @@ -72,7 +75,7 @@ typedef struct { /// Indicator of first reception uint8_t first_rx; /// DLSCH status flag indicating - SCH_status_t status; + NR_SCH_status_t status; /// Pointer to the payload (38.212 V15.4.0 section 5.1) uint8_t *b; /// Pointers to transport block segments diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 4806a48bda..8abd67c231 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -1075,7 +1075,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, int harq_pid = phy_data->ulsch.pusch_pdu.pusch_data.harq_process_id; - if (phy_data->ulsch.status != ACTIVE) + if (phy_data->ulsch.status != NR_ACTIVE) return; start_meas_nr_ue_phy(UE, PUSCH_PROC_STATS); diff --git a/openair1/PHY/TOOLS/calibration_scope.c b/openair1/PHY/TOOLS/calibration_scope.c index 64452fd67a..47a39f9d81 100644 --- a/openair1/PHY/TOOLS/calibration_scope.c +++ b/openair1/PHY/TOOLS/calibration_scope.c @@ -3,7 +3,7 @@ */ #include -#include +#include "common/utils/system.h" #include "executables/softmodem-common.h" #include "executables/nr-softmodem-common.h" #include diff --git a/openair1/PHY/TOOLS/calibration_test.c b/openair1/PHY/TOOLS/calibration_test.c index 6301f496d5..3e5ae03e50 100644 --- a/openair1/PHY/TOOLS/calibration_test.c +++ b/openair1/PHY/TOOLS/calibration_test.c @@ -3,7 +3,7 @@ */ #include -#include +#include "openair1/PHY/defs_common.h" #include #include #include diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index dbdcf8693d..8bca3a5b52 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -34,14 +34,6 @@ typedef enum { rx_dump_frame=7, } runmode_t; -/*! \brief Extension Type */ -typedef enum { - CYCLIC_PREFIX, - CYCLIC_SUFFIX, - ZEROS, - NONE -} Extension_t; - enum transmission_access_mode { NO_ACCESS=0, POSTPONED_ACCESS, @@ -569,7 +561,7 @@ typedef struct RU_t_s { /// beamforming weight vectors int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15]; /// received frequency-domain signal for PRACH (IF4p5 RRU) - int16_t **prach_rxsigF[NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX]; + int16_t **prach_rxsigF[12]; /// received frequency-domain signal for PRACH BR (IF4p5 RRU) int16_t **prach_rxsigF_br[4]; /// sequence number for IF5 diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index c90a592305..ab092dc173 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -42,6 +42,7 @@ #include "common/platform_types.h" #include "PHY/LTE_UE_TRANSPORT/transport_ue.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h" // for SIC +#include "PHY/defs_RU.h" #include #include "assertions.h" diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index c362becaae..482fe0c857 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -33,7 +33,6 @@ #include #include "assertions.h" -//#include #include "time_meas.h" #include "common/platform_types.h" #include "softmodem-common.h" @@ -42,7 +41,7 @@ #include #include "TOOLS/tools_defs.h" - +#include "PHY/CODING/coding_defs.h" #include "common/openairinterface5g_limits.h" #include "common/utils/LOG/log.h" @@ -965,39 +964,6 @@ extern int sync_var; #define MBSFN_FDD_SF7 0x08 #define MBSFN_FDD_SF8 0x04 -#define NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX 12 - -typedef struct { - pthread_mutex_t mutex_failure; - bool failed; -} decode_abort_t; - -static inline void init_abort(decode_abort_t *ab) -{ - int ret = pthread_mutex_init(&ab->mutex_failure, NULL); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - ab->failed = false; -} - -static inline bool check_abort(decode_abort_t *ab) -{ - int ret = pthread_mutex_lock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - bool failed = ab->failed; - ret = pthread_mutex_unlock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - return failed; -} - -static inline void set_abort(decode_abort_t *ab, bool v) -{ - int ret = pthread_mutex_lock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); - ab->failed = v; - ret = pthread_mutex_unlock(&ab->mutex_failure); - AssertFatal(ret == 0, "mutex failed with %d\n", ret); -} - typedef uint8_t(decoder_if_t)(int16_t *y, int16_t *y2, uint8_t *decoded_bytes, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index e0cd78509e..d21c9ab07e 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -13,17 +13,46 @@ #include "defs_nr_common.h" #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" -#include "PHY/impl_defs_top.h" #include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h" #include "PHY/CODING/nrLDPC_extern.h" #include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" #include "nfapi_nr_interface_scf.h" +#include "common/utils/threadPool/task_ans.h" +#include "openair1/PHY/defs_RU.h" #define MAX_NUM_RU_PER_gNB 8 #define MAX_PUCCH0_NID 8 #define NR_SRS_IDFT_OVERSAMP_FACTOR 2 #define NR_SRS_DETECTION_THRESHOLD 10 +#define NUMBER_OF_NR_PRACH_MAX 8 +typedef struct { + int frame; + int slot; + int num_slots; // prach duration in slots + int beams[NFAPI_MAX_NUM_BG_IF]; + nfapi_nr_prach_pdu_t pdu; + int rootSequenceIndex; + int numrootSequenceIndex; + int msg1_frequencystart; + int mu; + int prach_sequence_length; + int restricted_set; + int numerology_index; + int nb_rx; + c16_t (*Xu)[839]; + time_stats_t *rx_prach; + c16_t (*prach_buf)[NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX][NR_PRACH_SEQ_LEN_L]; +} prach_item_t; + +typedef struct { + /// prach commands + prach_item_t *list[NUMBER_OF_NR_PRACH_MAX]; + /// mutex for prach_list access + pthread_mutex_t prach_list_mutex; +} prach_list_t; +void init_prach_list(prach_list_t *); + typedef struct { int nb_id; int Nid[MAX_PUCCH0_NID]; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 385fef3a8e..814b95dae9 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -19,7 +19,7 @@ #include "CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "PHY/defs_nr_sl_UE.h" #include "openair1/PHY/nr_phy_common/inc/nr_ue_phy_meas.h" - +#include "common/utils/threadPool/task_ans.h" #include #include #include @@ -59,7 +59,6 @@ // (0 + 0 * 20) % 512 = 0 #define NUM_PROCESS_SLOT_TX_BARRIERS 512 -#include "impl_defs_top.h" #include "impl_defs_nr.h" #include "time_meas.h" #include "PHY/CODING/coding_defs.h" @@ -338,8 +337,8 @@ typedef struct PHY_VARS_NR_UE_s { NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; uint8_t prs_active_gNBs; - NR_DL_UE_HARQ_t dl_harq_processes[2][NR_MAX_DLSCH_HARQ_PROCESSES]; - NR_UL_UE_HARQ_t ul_harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES]; + NR_DL_UE_HARQ_t dl_harq_processes[2][NR_MAX_HARQ_PROCESSES]; + NR_UL_UE_HARQ_t ul_harq_processes[NR_MAX_HARQ_PROCESSES]; // Scrambling IDs used in PUSCH DMRS c16_t X_u[64][839]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 44d19045f7..7cd439bcee 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -12,7 +12,7 @@ #include "PHY/impl_defs_top.h" #include "impl_defs_nr.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" - +#include "radio/COMMON/common_lib.h" #include #define MAX_NUM_SUBCARRIER_SPACING 5 @@ -41,15 +41,11 @@ #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 MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 36 - -#define MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER 34 - #define MAX_NUM_NR_RE (4*14*273*12) #define MAX_NUM_NR_SRS_SYMBOLS 4 #define MAX_NUM_NR_SRS_AP 4 - +#define NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX 12 #define MAX_DELAY_COMP 20 @@ -102,34 +98,6 @@ typedef struct { int resource_type; } nr_srs_info_t; -#define NUMBER_OF_NR_PRACH_MAX 8 -typedef struct { - int frame; - int slot; - int num_slots; // prach duration in slots - int beams[NFAPI_MAX_NUM_BG_IF]; - nfapi_nr_prach_pdu_t pdu; - int rootSequenceIndex; - int numrootSequenceIndex; - int msg1_frequencystart; - int mu; - int prach_sequence_length; - int restricted_set; - int numerology_index; - int nb_rx; - c16_t (*Xu)[839]; - time_stats_t *rx_prach; - c16_t (*prach_buf)[NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX][NR_PRACH_SEQ_LEN_L]; -} prach_item_t; - -typedef struct { - /// prach commands - prach_item_t *list[NUMBER_OF_NR_PRACH_MAX]; - /// mutex for prach_list access - pthread_mutex_t prach_list_mutex; -} prach_list_t; -void init_prach_list(prach_list_t *); - typedef struct NR_DL_FRAME_PARMS_s { /// frequency range frequency_range_t freq_range; diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 71faf25ac7..1af29b4ba5 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -86,7 +86,6 @@ #include #include -#include "defs_eNB.h" #include "types.h" /** @addtogroup _PHY_STRUCTURES_ @@ -205,17 +204,6 @@ #define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15) #define AMP_OVER_2 (AMP>>1) -#define NB_NUMEROLOGIES_NR (5) -#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */ - -/* FFS_NR_TODO it defines ue capability which is the number of slots */ -/* - between reception of pdsch and transmission of its acknowlegment (k1) */ -/* - between reception of un uplink grant and its related transmission (k2) */ -#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3) - -#define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */ -#define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 5.1 UE procedure for receiving the physical downlink shared channel */ - /// Measurement Variables //#define NUMBER_OF_SUBBANDS_MAX 13 diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 25acac547d..fcaf2f1c1b 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -27,7 +27,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_rac rach_ind->slot = slot; rach_ind->number_of_pdus = 0; - prach_item_t *prach_id = find_nr_prach(&gNB->prach_list, frame, slot, gNB->frame_parms.nb_antennas_rx, SEARCH_EXIST); + prach_item_t *prach_id = find_nr_prach(&gNB->prach_list, frame, slot, gNB->frame_parms.nb_antennas_rx, NR_SEARCH_EXIST); if (!prach_id) { return; } diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index eb952035aa..0c2d2897c6 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -72,8 +72,6 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ void processSlotTX(void *arg); -int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); - /*! \brief UL time alignment procedures for TA application @param ue @param slot_tx diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index a39927f4aa..4a521f5613 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -57,7 +57,7 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0, dlsch0_harq->DLround++; } downlink_harq_process(dlsch0_harq, current_harq_pid, dlsch_config_pdu->new_data_indicator, dlsch_config_pdu->rv, dlsch0->rnti_type); - if (dlsch0_harq->status != ACTIVE) { + if (dlsch0_harq->status != NR_ACTIVE) { // dlsch0_harq->status not ACTIVE due to false retransmission // Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status dlsch0->active = false; @@ -305,7 +305,7 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy, fapi_nr_ul_config_r pdu->pusch_config_pdu.tx_request_body.pdu_length); } - phy_data->ulsch.status = ACTIVE; + phy_data->ulsch.status = NR_ACTIVE; pdu->pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more } break; diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 590ce42ec7..061e43d831 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -95,7 +95,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) { - dl_harq->status = SCH_IDLE; + dl_harq->status = NR_SCH_IDLE; dl_harq->first_rx = 1; dl_harq->DLround = 0; dl_harq->decodeResult = false; @@ -124,7 +124,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int dci_ndi, rnti_type == TYPE_P_RNTI_ || rnti_type == TYPE_RA_RNTI_) { dl_harq->DLround = 0; - dl_harq->status = ACTIVE; + dl_harq->status = NR_ACTIVE; dl_harq->first_rx = 1; } else { LOG_D(PHY, @@ -136,7 +136,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int dci_ndi, rnti_type, dci_ndi ? "yes" : "no"); AssertFatal(rv<4 && rv>=0, "invalid redondancy version %d\n", rv); - dl_harq->status = ACTIVE; + dl_harq->status = NR_ACTIVE; } } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0b853820f3..3d11c2af3b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -836,8 +836,8 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, uint8_t is_cw0_active = dl_harq0->status; uint8_t is_cw1_active = dl_harq1->status; int nb_dlsch = 0; - nb_dlsch += (is_cw0_active == ACTIVE) ? 1 : 0; - nb_dlsch += (is_cw1_active == ACTIVE) ? 1 : 0; + nb_dlsch += (is_cw0_active == NR_ACTIVE) ? 1 : 0; + nb_dlsch += (is_cw1_active == NR_ACTIVE) ? 1 : 0; uint16_t nb_symb_sch = dlsch[0].dlsch_config.number_symbols; uint8_t dmrs_type = dlsch[0].dlsch_config.dmrsConfigType; @@ -852,7 +852,7 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "AbsSubframe %d.%d Start LDPC Decoder for CW1 [harq_pid %d] ? %d \n", frame_rx % 1024, nr_slot_rx, harq_pid, is_cw1_active); // exit dlsch procedures as there are no active dlsch - if (is_cw0_active != ACTIVE && is_cw1_active != ACTIVE) { + if (is_cw0_active != ACTIVE && is_cw1_active != NR_ACTIVE) { // don't wait anymore LOG_E(NR_PHY, "Internal error nr_ue_dlsch_procedure() called but no active cw on slot %d, harq %d\n", nr_slot_rx, harq_pid); if (dlsch[0].dlsch_config.k1_feedback) { @@ -869,7 +869,7 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, uint8_t *p_b[2] = {NULL}; for (uint8_t DLSCH_id = 0; DLSCH_id < 2; DLSCH_id++) { NR_DL_UE_HARQ_t *dl_harq = &ue->dl_harq_processes[DLSCH_id][harq_pid]; - if (dl_harq->status != ACTIVE) continue; + if (dl_harq->status != NR_ACTIVE) continue; DLSCH_ids[pdsch_id++] = DLSCH_id; fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config = &dlsch[DLSCH_id].dlsch_config; @@ -950,9 +950,9 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, } uint32_t dlsch_bytes = a_segments * 1056; // allocated bytes per segment - if (ue->phy_sim_dlsch_b && is_cw0_active == ACTIVE) + if (ue->phy_sim_dlsch_b && is_cw0_active == NR_ACTIVE) memcpy(ue->phy_sim_dlsch_b, p_b[0], dlsch_bytes); - else if (ue->phy_sim_dlsch_b && is_cw1_active == ACTIVE) + else if (ue->phy_sim_dlsch_b && is_cw1_active == NR_ACTIVE) memcpy(ue->phy_sim_dlsch_b, p_b[1], dlsch_bytes); } diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 3299363c51..f07ad92ca9 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -406,7 +406,7 @@ int main(int argc, char **argv) exit(-1); } - nr_init_ul_harq_processes(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); + nr_init_ul_harq_processes(UE->ul_harq_processes, NR_MAX_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); initFloatingCoresTpool(1, &nrUE_params.Tpool, false, "UE-tpool"); @@ -585,7 +585,7 @@ int main(int argc, char **argv) printf("\n"); } - free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_ULSCH_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); + free_nr_ue_ul_harq(UE->ul_harq_processes, NR_MAX_HARQ_PROCESSES, UE->frame_parms.N_RB_UL, UE->frame_parms.nb_antennas_tx); int nb_slots_to_set = (1 << mu) * NR_NUMBER_OF_SUBFRAMES_PER_FRAME; for (int i = 0; i < nb_slots_to_set; ++i) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c b/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c index f70eb83c32..b0ce4ffb1f 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue_sl.c @@ -172,10 +172,10 @@ static void sl_prepare_phy_config(int module_id, phycfg->sl_bwp_config.sl_start_symbol = (bwp_generic->sl_StartSymbol_r16) ? *bwp_generic->sl_StartSymbol_r16 : 0; - //0-EXTENDED, 1-NORMAL CP - phycfg->sl_bwp_config.sl_cyclic_prefix = (sl_bwp->cyclicPrefix) ? EXTENDED : NORMAL; + //0-NORMAL CP, 1-EXTENDED + phycfg->sl_bwp_config.sl_cyclic_prefix = (sl_bwp->cyclicPrefix) ? 1 : 0; - AssertFatal(phycfg->sl_bwp_config.sl_cyclic_prefix == NORMAL, "Only NORMAL-CP Supported. Ext CP not yet supported\n"); + AssertFatal(phycfg->sl_bwp_config.sl_cyclic_prefix == 0, "Only NORMAL-CP Supported. Ext CP not yet supported\n"); AssertFatal(phycfg->sl_bwp_config.sl_start_symbol >= 0 && phycfg->sl_bwp_config.sl_start_symbol <=7, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 9d725418ae..224887252d 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -13,6 +13,7 @@ #include #include #include "common/platform_types.h" +#include "common/utils/threadPool/notified_fifo.h" /* IF */ #include "NR_IF_Module.h" @@ -405,7 +406,7 @@ typedef struct { typedef struct { /// SSB RSRP in dBm int ssb_rsrp_dBm; - float_t ssb_sinr_dB; + float ssb_sinr_dB; } NR_SSB_meas_t; typedef struct { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c index d29e0c6bfa..66c5104458 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_power_procedures.c @@ -14,7 +14,7 @@ // TODO: This should be part of mac instance /* TS 38.213 9.2.5.2 UE procedure for multiplexing HARQ-ACK/SR and CSI in a PUCCH */ /* this is a counter of number of pucch format 4 per subframe */ -static int nb_pucch_format_4_in_subframes[LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] = {0}; +static int nb_pucch_format_4_in_subframes[NR_NUMBER_OF_SUBFRAMES_PER_FRAME] = {0}; /* TS 38.211 Table 6.4.1.3.3.2-1: DM-RS positions for PUCCH format 3 and 4 */ static const int nb_symbols_excluding_dmrs[11][2][2] diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 035b750745..15c59716be 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2552,7 +2552,7 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) // Schedule ULSCH only if the current frame and slot match those in ul_config_req // AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus) - uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES]; + uint8_t ulsch_input_buffer_array[FAPI_NR_UL_CONFIG_LIST_NUM][MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER * NR_MAX_NB_LAYERS * 1056]; int number_of_pdus = 0; fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = lockGet_ul_iterator(mac, frame_tx, slot_tx); diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.h b/openair2/PHY_INTERFACE/phy_stub_UE.h index c0de476ad9..efc0371752 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.h +++ b/openair2/PHY_INTERFACE/phy_stub_UE.h @@ -12,6 +12,7 @@ #include #include "openair2/PHY_INTERFACE/IF_Module.h" +#include "PHY/defs_eNB.h" #include "nfapi_interface.h" #include "nfapi_pnf_interface.h" #include diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index eb522d4bd4..45743bb9be 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -466,6 +466,7 @@ static void SendFrameNR(guint8 radioType, ws_trace_t *t) #include extern RAN_CONTEXT_t RC; #include +#include "openair1/PHY/defs_eNB.h" /* Remote serveraddress (where Wireshark is running) */ void trace_pdu_implementation(ws_trace_t *t) diff --git a/radio/fhi_72/oran_isolate.h b/radio/fhi_72/oran_isolate.h index bf4ced15ca..afdf443596 100644 --- a/radio/fhi_72/oran_isolate.h +++ b/radio/fhi_72/oran_isolate.h @@ -13,7 +13,7 @@ #include "xran_fh_o_du.h" #include "openair1/PHY/impl_defs_nr.h" #include "openair1/PHY/TOOLS/tools_defs.h" -#include "openair1/PHY/defs_common.h" +#include "openair1/PHY/defs_nr_common.h" /* * Structure added to bear the information needed from OAI RU */ From f94dad6893d43bfb387ab290a1643fffc0b57b50 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 24 Mar 2026 16:49:50 +0100 Subject: [PATCH 3/5] rename and take out gold generic function from lte files to specific file to avoid cross-compilation --- openair1/PHY/LTE_REFSIG/defs_NB_IoT.h | 4 -- openair1/PHY/LTE_REFSIG/lte_refsig.h | 2 +- openair1/PHY/LTE_TRANSPORT/dci.c | 4 +- openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c | 12 ++--- openair1/PHY/LTE_TRANSPORT/edci.c | 8 ++-- openair1/PHY/LTE_TRANSPORT/group_hopping.c | 6 +-- openair1/PHY/LTE_TRANSPORT/pbch.c | 8 ++-- openair1/PHY/LTE_TRANSPORT/pcfich.c | 4 +- openair1/PHY/LTE_TRANSPORT/phich.c | 4 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 4 +- openair1/PHY/LTE_TRANSPORT/pucch_common.c | 2 +- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 48 ------------------- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 2 +- openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c | 4 +- openair1/PHY/LTE_UE_TRANSPORT/pbch_ue.c | 8 ++-- openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 4 +- openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c | 4 +- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 6 +-- .../PHY/LTE_UE_TRANSPORT/ulsch_modulation.c | 6 +-- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 4 +- openair1/PHY/NR_REFSIG/refsig.c | 6 +-- openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c | 7 +-- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 - openair1/PHY/gold.h | 46 ++++++++++++++++++ 24 files changed, 99 insertions(+), 106 deletions(-) create mode 100644 openair1/PHY/gold.h diff --git a/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h b/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h index 8adf92c189..85342f006f 100644 --- a/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h +++ b/openair1/PHY/LTE_REFSIG/defs_NB_IoT.h @@ -41,10 +41,6 @@ int lte_dl_cell_spec_NB_IoT(PHY_VARS_eNB_NB_IoT *phy_vars_eNB, unsigned char p, unsigned short RB_IoT_ID); - -unsigned int lte_gold_generic_NB_IoT(unsigned int *x1, - unsigned int *x2, - unsigned char reset); void generate_ul_ref_sigs_rx_NB_IoT(void); diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 0521c9d3a5..66ac6e25a5 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -10,7 +10,7 @@ #define __LTE_REFSIG_DEFS__H__ #include "PHY/defs_eNB.h" #include "PHY/defs_UE.h" - +#include "PHY/gold.h" /** @ingroup _PHY_REF_SIG * @{ */ diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index bc6065606c..e15a3a35ec 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -184,12 +184,12 @@ void pdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1 = 0, x2 = 0, s = 0; //LOG_D(PHY, "%s(fp, subframe:%d, e, length:%d)\n", __FUNCTION__, subframe, length); reset = 1; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.8.2 for (i=0; i>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 for PMCH } - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); for (n=0; n<(1+(G>>5)); n++) { #ifdef DEBUG_SCRAMBLING @@ -132,7 +132,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, // This is not faster for some unknown reason // ((simde__m128i *)e)[0] = simde_mm_xor_si128(((simde__m128i *)e)[0],((simde__m128i *)scrambling_lut)[s&65535]); // ((simde__m128i *)e)[1] = simde_mm_xor_si128(((simde__m128i *)e)[1],((simde__m128i *)scrambling_lut)[s>>16]); - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); e += 32; } @@ -163,7 +163,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1, x2, s=0; // reset = 1; - // x1 is set in first call to lte_gold_generic + // x1 is set in first call to gold_generic if (mbsfn_flag == 0) x2 = (dlsch->rnti<<14) + (q<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 @@ -173,7 +173,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, #ifdef DEBUG_SCRAMBLING printf("unscrambling: rnti %x, q %d, Ns %d, Nid_cell %d G %d, x2 %x\n",dlsch->rnti,q,Ns,frame_parms->Nid_cell,G,x2); #endif - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); for (i=0; i<(1+(G>>5)); i++) { for (j=0; j<32; j++,k++) { @@ -186,7 +186,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, #endif } - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); } } diff --git a/openair1/PHY/LTE_TRANSPORT/edci.c b/openair1/PHY/LTE_TRANSPORT/edci.c index 7c46de8bba..f12ecb6838 100644 --- a/openair1/PHY/LTE_TRANSPORT/edci.c +++ b/openair1/PHY/LTE_TRANSPORT/edci.c @@ -38,7 +38,7 @@ void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, mDCI_ALLOC_t *mdci, uint uint16_t i0 = mdci->i0; // Note: we could actually not do anything if i-i0 < Nacc, save it for later reset = 1; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic if ((mdci->rnti == 0xFFFE) || (mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI Nacc = frame_parms->frame_type == FDD ? 4 : 10; @@ -59,7 +59,7 @@ void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, mDCI_ALLOC_t *mdci, uint for (n = 0; n < length; n++) { if ((n & 0x1f) == 0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); reset = 0; } @@ -354,7 +354,7 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe, int16_t amp, // pilot scrambling initiatlization (note: this is for a single repetition) - // x1 is set in lte_gold_generic + // x1 is set in gold_generic // rule for BL/CE UEs from Section 6.10.3A.1 in 36.211 @@ -394,7 +394,7 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe, int16_t amp, for (int mprime=0; mprime<3; mprime++,ii+=2) { if ((ii & 0x1f) == 0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); reset = 0; } diff --git a/openair1/PHY/LTE_TRANSPORT/group_hopping.c b/openair1/PHY/LTE_TRANSPORT/group_hopping.c index 4c60eee146..3feae398a7 100644 --- a/openair1/PHY/LTE_TRANSPORT/group_hopping.c +++ b/openair1/PHY/LTE_TRANSPORT/group_hopping.c @@ -34,7 +34,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms) } else { if ((ns&3) == 0) { - s = lte_gold_generic(&x1,&x2,reset); + s = gold_generic(&x1,&x2,reset); reset = 0; } @@ -62,7 +62,7 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms) x2 = (32*(frame_parms->Nid_cell/30) + fss_pusch)%30; - s = lte_gold_generic(&x1,&x2,reset); + s = gold_generic(&x1,&x2,reset); #ifdef DEBUG_GROUPHOP printf("[PHY] SeqHop:"); #endif @@ -105,7 +105,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms) for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate if ((n&3) == 0) { - s = lte_gold_generic(&x1,&x2,reset); + s = gold_generic(&x1,&x2,reset); reset = 0; // printf("n %d : s (%d,%d,%d,%d)\n",n,((uint8_t*)&s)[0],((uint8_t*)&s)[1],((uint8_t*)&s)[2],((uint8_t*)&s)[3]); } diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c index 971dad59f7..d9962a2c8e 100644 --- a/openair1/PHY/LTE_TRANSPORT/pbch.c +++ b/openair1/PHY/LTE_TRANSPORT/pbch.c @@ -125,13 +125,13 @@ void pbch_scrambling_fembms(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1 = 0, x2 = 0, s = 0; reset = 1; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = frame_parms->Nid_cell + (1<<9); //this is c_init for FeMBMS in 36.211 Sec 6.6.1 // msg("pbch_scrambling: Nid_cell = %d\n",x2); for (i=0; iNid_cell; //this is c_init in 36.211 Sec 6.6.1 // msg("pbch_scrambling: Nid_cell = %d\n",x2); for (i=0; iNid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 for (i=0; i<32; i++) { if ((i&0x1f)==0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); reset = 0; } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 7ba5c344fa..efdedf7399 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -60,10 +60,10 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms, // c = (1-(2*HI))*SSS_AMP; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (((subframe+1)*((frame_parms->Nid_cell<<1)+1))<<9) + frame_parms->Nid_cell; - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); // compute scrambling sequence for (i=0; i<12; i++) { diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 73ed4d1940..2e8fc4004f 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -645,8 +645,8 @@ uint16_t pucchfmt3_Descramble( int16_t IFFTOutData_Fmt3[2][12][2], uint32_t x1; uint32_t s,s0,s1; cinit = (subframe + 1) * ((2 * Nid_cell + 1)<<16) + rnti; - s0 = lte_gold_generic(&x1,&cinit,1); - s1 = lte_gold_generic(&x1,&cinit,0); + s0 = gold_generic(&x1,&cinit,1); + s1 = gold_generic(&x1,&cinit,0); i=0; for (m=0; m>3) ^ (*x2>>2) + (*x2>>1) + *x2 - *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); - - // x1 and x2 contain bits n = 0,1,...,31 - - // Nc = 1600 bits are skipped at the beginning - // i.e., 1600 / 32 = 50 32bit words - - for (n = 1; n < 50; n++) - { - // Compute x1(0),...,x1(27) - *x1 = (*x1>>1) ^ (*x1>>4); - // Compute x1(28),..,x1(31) and xor - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - // Compute x2(0),...,x2(27) - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - // Compute x2(28),..,x2(31) and xor - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - } - } - - *x1 = (*x1>>1) ^ (*x1>>4); - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - return(*x1^*x2); -} - - /**@}*/ #endif diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index 8b71450d48..e0208e8435 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -405,7 +405,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, else harq_pid = subframe2harq_pid(frame_parms,proc->frame_rx,subframe); - // x1 is set in lte_gold_generic + // x1 is set in gold_generic uint32_t x2 = ((uint32_t)ulsch->rnti << 14) + ((uint32_t)subframe << 9) + frame_parms->Nid_cell; // this is c_init in 36.211 Sec 6.3.1 LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c index 909d3e96d1..32aa367fd6 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_ue.c @@ -1199,13 +1199,13 @@ void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, uint32_t x1 = 0, x2 = 0, s = 0; reset = 1; - // x1 is set in first call to lte_gold_generic + // x1 is set in first call to gold_generic x2 = (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.8.2 for (i=0; iNid_cell; //this is c_init in 36.211 Sec 6.6.1 // msg("pbch_unscrambling: Nid_cell = %d\n",x2); for (i=0; iNid_cell+(1<<9); //this is c_init for FeMBMS in 36.211 Sec 6.6.1 //msg("pbch_unscrambling: Nid_cell = %d, x2 = %d, frame_mod4 %d length %d\n",frame_parms->Nid_cell,x2,frame_mod4,length); for (i=0; iNid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); reset = 0; } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c index b3c7673088..c922f32908 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c @@ -111,10 +111,10 @@ void rx_phich(PHY_VARS_UE *ue, memset(d,0,24*sizeof(int8_t)); phich_d_ptr = phich_d; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (((subframe+1)*((frame_parms->Nid_cell<<1)+1))<<9) + frame_parms->Nid_cell; - s = lte_gold_generic(&x1, &x2, reset); + s = gold_generic(&x1, &x2, reset); // compute scrambling sequence for (i=0; i<12; i++) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 2b856b63bb..dfece3a4a0 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -321,7 +321,7 @@ static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16 uint8_t c; x2 = (rnti) + ((uint32_t)(1+subframe)<<16)*(1+(fp->Nid_cell<<1)); //this is c_init in 36.211 Sec 6.3.1 - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); for (i=0;i<19;i++) { c = (uint8_t)((s>>i)&1); btilde[i] = (((B>>i)&1) ^ c); @@ -632,8 +632,8 @@ void generate_pucch3x(int32_t **txdataF, // Scrambling cinit = (subframe + 1) * ((2 * frame_parms->Nid_cell + 1)<<16) + rnti; - s0 = lte_gold_generic(&x1,&cinit,1); - s1 = lte_gold_generic(&x1,&cinit,0); + s0 = gold_generic(&x1,&cinit,1); + s1 = gold_generic(&x1,&cinit,0); for (i=0; i<48; i++) { s = (i<32)? s0:s1; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c index c4ef20c98e..ae9ea15a26 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c @@ -164,7 +164,7 @@ void ulsch_modulation(int32_t **txdataF, return; } - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 if (harq_pid>=8) { @@ -203,7 +203,7 @@ void ulsch_modulation(int32_t **txdataF, // scrambling (Note the placeholding bits are handled in ulsch_coding.c directly!) //printf("ulsch bits: "); - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); k=0; //printf("G %d\n",G); @@ -224,7 +224,7 @@ void ulsch_modulation(int32_t **txdataF, } - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); } //printf("\n"); diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index 5fb5758ee2..d0ad168716 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -3,7 +3,7 @@ */ #include "sl_refsig_defs.h" -#include "openair1/PHY/LTE_TRANSPORT/transport_proto.h" // for lte_gold_generic() +#include "openair1/PHY/gold.h" void sl_init_psbch_dmrs_gold_sequences(PHY_VARS_NR_UE *UE) { @@ -20,7 +20,7 @@ void sl_init_psbch_dmrs_gold_sequences(PHY_VARS_NR_UE *UE) #endif for (uint8_t n = 0; n < SL_NR_NUM_PSBCH_DMRS_RE_DWORD; n++) { - UE->SL_UE_PHY_PARAMS.init_params.psbch_dmrs_gold_sequences[slss_id][n] = lte_gold_generic(&x1, &x2, reset); + UE->SL_UE_PHY_PARAMS.init_params.psbch_dmrs_gold_sequences[slss_id][n] = gold_generic(&x1, &x2, reset); reset = 0; #ifdef SL_DEBUG_INIT_DATA diff --git a/openair1/PHY/NR_REFSIG/refsig.c b/openair1/PHY/NR_REFSIG/refsig.c index b22dcb6c2f..418d6aa702 100644 --- a/openair1/PHY/NR_REFSIG/refsig.c +++ b/openair1/PHY/NR_REFSIG/refsig.c @@ -3,7 +3,7 @@ */ #include "nr_refsig.h" -#include "openair1/PHY/LTE_TRANSPORT/transport_proto.h" // for lte_gold_generic() +#include "openair1/PHY/gold.h" #define REFRESH_RATE (1000 * 100) @@ -141,9 +141,9 @@ uint32_t *gold_cache(uint32_t key, int length) *new = (gold_cache_t){.key = key, .length = length, .usage = 1}; unsigned int x1 = 0, x2 = key; uint32_t *sequence = firstFree + roundedHeaderSz; - *sequence++ = lte_gold_generic(&x1, &x2, 1); + *sequence++ = gold_generic(&x1, &x2, 1); for (int n = 1; n < length; n++) - *sequence++ = lte_gold_generic(&x1, &x2, 0); + *sequence++ = gold_generic(&x1, &x2, 0); LOG_D(PHY, "created a gold sequence, start %d; len %d\n", key, length); return firstFree + roundedHeaderSz; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c b/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c index f649d62a4b..6504b06c9a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c @@ -7,6 +7,7 @@ #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h" #include "PHY/MODULATION/nr_modulation.h" +#include "PHY/gold.h" // #define SL_DEBUG @@ -19,7 +20,7 @@ void sl_psbch_scrambling(uint32_t *output, uint32_t id, uint16_t length) { uint32_t x1, x2, s = 0; - // x1 is set in lte_gold_generic + // x1 is set in gold_generic x2 = id; // C_INIT #ifdef SL_DEBUG @@ -29,7 +30,7 @@ void sl_psbch_scrambling(uint32_t *output, uint32_t id, uint16_t length) #endif // get initial 32 scrambing bits - s = lte_gold_generic(&x1, &x2, 1); + s = gold_generic(&x1, &x2, 1); #ifdef SL_DEBUG printf("s: %04x\t", s); #endif @@ -40,7 +41,7 @@ void sl_psbch_scrambling(uint32_t *output, uint32_t id, uint16_t length) output[i >> 5] ^= s; i += 32; - s = lte_gold_generic(&x1, &x2, 0); + s = gold_generic(&x1, &x2, 0); #ifdef SL_DEBUG printf("s: %04x\t", s); #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index 157b5efd46..32d03c1010 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -11,8 +11,6 @@ #include "SCHED_NR_UE/defs.h" #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include -#include "nfapi_interface.h" -#include #define NR_PUSCH_x 2 // UCI placeholder bit TS 38.212 V15.4.0 subclause 5.3.3.1 #define NR_PUSCH_y 3 // UCI placeholder bit diff --git a/openair1/PHY/gold.h b/openair1/PHY/gold.h new file mode 100644 index 0000000000..fbaa580fe0 --- /dev/null +++ b/openair1/PHY/gold.h @@ -0,0 +1,46 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#ifndef __openair_GOLD_H__ +#define __openair_GOLD_H__ + +static inline uint32_t gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) +{ + int32_t n; + // 3GPP 3x.211 + // Nc = 1600 + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + // x1(n+31) = [x1(n+3) + x1(n)]mod2 + // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 + if (reset) { + // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 + // x1(31) = [x1(3) + x1(0)]mod2 = 1 + *x1 = 1 + (1U << 31); + // Init value for x2: cinit = sum_{i=0}^30 x2*2^i + // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 + // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 + *x2 = *x2 ^ ((*x2 ^ (*x2 >> 1) ^ (*x2 >> 2) ^ (*x2 >> 3)) << 31); + // x1 and x2 contain bits n = 0,1,...,31 + // Nc = 1600 bits are skipped at the beginning + // i.e., 1600 / 32 = 50 32bit words + for (n = 1; n < 50; n++) { + // Compute x1(0),...,x1(27) + *x1 = (*x1 >> 1) ^ (*x1 >> 4); + // Compute x1(28),..,x1(31) and xor + *x1 = *x1 ^ (*x1 << 31) ^ (*x1 << 28); + // Compute x2(0),...,x2(27) + *x2 = (*x2 >> 1) ^ (*x2 >> 2) ^ (*x2 >> 3) ^ (*x2 >> 4); + // Compute x2(28),..,x2(31) and xor + *x2 = *x2 ^ (*x2 << 31) ^ (*x2 << 30) ^ (*x2 << 29) ^ (*x2 << 28); + } + } + *x1 = (*x1 >> 1) ^ (*x1 >> 4); + *x1 = *x1 ^ (*x1 << 31) ^ (*x1 << 28); + *x2 = (*x2 >> 1) ^ (*x2 >> 2) ^ (*x2 >> 3) ^ (*x2 >> 4); + *x2 = *x2 ^ (*x2 << 31) ^ (*x2 << 30) ^ (*x2 << 29) ^ (*x2 << 28); + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + return(*x1 ^ *x2); +} + +#endif From 0b3216f8896f2a0d42b58f5a58e9937e0f81b4a8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 24 Mar 2026 18:43:42 +0100 Subject: [PATCH 4/5] further compilation cleanup --- executables/nr-ru.c | 1 - executables/nr-softmodem-common.h | 1 - executables/nr-softmodem.c | 2 -- executables/nr-uesoftmodem.c | 9 --------- nfapi/oai_integration/nfapi_vnf.c | 1 - .../PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h | 2 +- openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c | 1 - openair1/PHY/NR_REFSIG/dmrs_nr.h | 1 - openair1/PHY/NR_REFSIG/pss_nr.h | 1 - openair1/PHY/NR_REFSIG/sss_nr.h | 1 - openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h | 2 -- openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c | 4 +--- openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 1 - openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h | 1 - openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 1 - openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 1 - openair1/PHY/defs_nr_UE.h | 1 + 17 files changed, 3 insertions(+), 28 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 8a10fade9a..ecf2096e7c 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -22,7 +22,6 @@ #include "PHY/LTE_TRANSPORT/if4_tools.h" -#include "PHY/types.h" #include "PHY/defs_nr_common.h" #include "PHY/phy_extern.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 13dabb2ace..bbf023998b 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -30,7 +30,6 @@ #include #include "radio/COMMON/common_lib.h" #include "assertions.h" -#include "PHY/types.h" /* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ #define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n" diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index c0b766cc13..1198e5bd02 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -55,7 +55,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "gnb_paramdef.h" #include "intertask_interface.h" #include "nfapi/oai_integration/vendor_ext.h" -#include "nfapi_interface.h" #include "nfapi_nr_interface_scf.h" #include "ngap_gNB.h" #include "nr-softmodem-common.h" @@ -595,7 +594,6 @@ int main( int argc, char **argv ) { : TIME_SOURCE_REALTIME); // start the main threads - number_of_cards = 1; wait_gNBs(); int sl_ahead = NFAPI_MODE == NFAPI_MODE_AERIAL ? 0 : 6; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 50a1c7352b..c31bab06d5 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -12,25 +12,18 @@ #include "T.h" #include "common/oai_version.h" #include "assertions.h" -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "SCHED_NR_UE/defs.h" #include "common/ran_context.h" #include "common/config/config_userapi.h" #include "common/utils/load_module_shlib.h" -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "common/utils/nr/nr_common.h" - #include "radio/COMMON/common_lib.h" #include "radio/ETHERNET/if_defs.h" - -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all #include "openair1/PHY/MODULATION/nr_modulation.h" #include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h" #include "PHY/phy_vars_nr_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -#include "PHY/NR_TRANSPORT/nr_dlsch.h" -//#include "../../SIMU/USER/init_lte.h" #include "PHY_INTERFACE/phy_interface_vars.h" #include "NR_IF_Module.h" @@ -69,8 +62,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "executables/thread-common.h" #include "nr_nas_msg.h" -#include -#include "openair2/GNB_APP/gnb_paramdef.h" #include "actor.h" THREAD_STRUCT thread_struct; diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 9873337b80..1d4488841a 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -37,7 +37,6 @@ #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" #include "gnb_ind_vars.h" diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h index 42bcd4aafe..901dfa1986 100644 --- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h +++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h @@ -7,7 +7,7 @@ */ #include "common/utils/time_meas.h" -#include "openair1/PHY/defs_common.h" +#include "openair1/PHY/CODING/coding_defs.h" #include "common/utils/threadPool/thread-pool.h" #ifndef __NRLDPC_CODING_INTERFACE__H__ diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index 88f87326df..a901f8dba1 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -6,7 +6,6 @@ * \brief gNB measurement routines */ -#include "PHY/types.h" #include "PHY/defs_gNB.h" #include "nr_ul_estimation.h" diff --git a/openair1/PHY/NR_REFSIG/dmrs_nr.h b/openair1/PHY/NR_REFSIG/dmrs_nr.h index b0cbb4364d..e7ce4b50d2 100644 --- a/openair1/PHY/NR_REFSIG/dmrs_nr.h +++ b/openair1/PHY/NR_REFSIG/dmrs_nr.h @@ -16,7 +16,6 @@ #ifndef DMRS_NR_H #define DMRS_NR_H -#include "PHY/types.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/sss_nr.h" diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index 598ffbe9f4..39a9dd3a4e 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -16,7 +16,6 @@ #define PSS_NR_H #include "PHY/defs_nr_common.h" -#include "PHY/types.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" /************** CODE GENERATION ***********************************/ diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h index 3d095d4c88..9b8998c317 100644 --- a/openair1/PHY/NR_REFSIG/sss_nr.h +++ b/openair1/PHY/NR_REFSIG/sss_nr.h @@ -16,7 +16,6 @@ #define SSS_NR_H #include "limits.h" -#include "PHY/types.h" #include "pss_nr.h" /************** DEFINE ********************************************/ diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index 5d95525d21..5e19fb979f 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -16,10 +16,8 @@ #ifndef LOWPAPR_SEQUENCES_NR_H #define LOWPAPR_SEQUENCES_NR_H -#include "PHY/types.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/defs_nr_common.h" -#include "PHY/defs_gNB.h" /************** DEFINE ********************************************/ #define U_GROUP_NUMBER (30) /* maximum number of sequence-group */ diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c index de25e5c7ea..e64f74a291 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c @@ -2,11 +2,9 @@ * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" -void -phy_adjust_gain_nr (PHY_VARS_NR_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) +void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) { LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n", diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 2029287f08..5b526ed65c 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" #include "executables/nr-uesoftmodem.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h index e4f32eb160..25a8f6ff81 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h @@ -17,7 +17,6 @@ #define CIC_FILTER_NR_H #include "PHY/defs_nr_UE.h" -#include "PHY/types.h" /************** DEFINE ********************************************/ diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 87ab4abc57..5091b2c35d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -5,7 +5,6 @@ /*! * \brief Routines for initial UE synchronization procedure (PSS,SSS,PBCH and frame format detection) */ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" #include "PHY/MODULATION/modulation_UE.h" #include "nr_transport_proto_ue.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index b985f10f92..df691ea362 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -5,7 +5,6 @@ /*! \file PHY/NR_UE_TRANSPORT/nr_ulsch_coding_slot.c */ -#include "PHY/defs_UE.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/CODING/coding_defs.h" #include "PHY/CODING/coding_extern.h" diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 814b95dae9..a61cb30b95 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -66,6 +66,7 @@ #include "PHY/TOOLS/tools_defs.h" #include "common/platform_types.h" #include "NR_UE_TRANSPORT/nr_transport_ue.h" +#include "openair1/PHY/defs_common.h" #if defined(UPGRADE_RAT_NR) #include "PHY/NR_REFSIG/ss_pbch_nr.h" From 74cc133a13184370c9ca6f13d5ca64f5744cc22e Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 31 Mar 2026 13:26:17 +0200 Subject: [PATCH 5/5] fix for ldpc_aal compilation error --- .../CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c index 0da16183eb..534d103929 100644 --- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c +++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c @@ -7,6 +7,8 @@ #include "PHY/sse_intrin.h" #include "reverse_bits.h" #include +#include "common/config/config_paramdesc.h" +#include "common/config/config_userapi.h" #define NR_LDPC_ENABLE_PARITY_CHECK #include "PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h"