From 4e144dba6a9a87e336c0f9ea8dc2b5f693528b2b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Feb 2023 17:08:50 +0100 Subject: [PATCH 01/13] Remove useless MBMS_NFAPI_SCHEDULER definition --- openair1/SCHED/phy_procedures_lte_eNb.c | 51 ------------------------- 1 file changed, 51 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index ebc3b76ec7..3d2226b3c3 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -48,8 +48,6 @@ #include "intertask_interface.h" -#define MBMS_NFAPI_SCHEDULER - #include "common/ran_context.h" extern RAN_CONTEXT_t RC; @@ -122,7 +120,6 @@ lte_subframe_t get_subframe_direction(uint8_t Mod_id,uint8_t CC_id,uint8_t subfr return(subframe_select(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe)); } -#ifdef MBMS_NFAPI_SCHEDULER void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, int fembms_flag) { int subframe = proc->subframe_tx; // This is DL-Cell spec pilots in Control region @@ -151,46 +148,6 @@ void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, int fembms_flag) { } eNB->dlsch_MCH->active = 0; } -#else -void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { - MCH_PDU *mch_pduP=NULL; - // uint8_t sync_area=255; - int subframe = proc->subframe_tx; - AssertFatal (1 == 1, "pmch not tested for the moment, exiting\n"); - // This is DL-Cell spec pilots in Control region - generate_pilots_slot (eNB, eNB->common_vars.txdataF, AMP, subframe << 1, 1); - - // if mcch is active, send regardless of the node type: eNB or RN - // when mcch is active, MAC sched does not allow MCCH and MTCH multiplexing - /* - mch_pduP = mac_xface->get_mch_sdu(eNB->Mod_id, - eNB->CC_id, - proc->frame_tx, - subframe); - */ - mch_pduP= &RC.mac[eNB->Mod_id]->common_channels[eNB->CC_id].MCH_pdu; - if ((mch_pduP->Pdu_size > 0) && (mch_pduP->sync_area == 0)) // TEST: only transmit mcch for sync area 0 - LOG_D(PHY,"[eNB%"PRIu8"] Frame %d subframe %d : Got MCH pdu for MBSFN (MCS %"PRIu8", TBS %d) \n", - eNB->Mod_id,proc->frame_tx,subframe,mch_pduP->mcs, - eNB->dlsch_MCH->harq_processes[0]->TBS>>3); - else { - LOG_D(PHY,"[DeNB %"PRIu8"] Frame %d subframe %d : Do not transmit MCH pdu for MBSFN sync area %"PRIu8" (%s)\n", - eNB->Mod_id,proc->frame_tx,subframe,mch_pduP->sync_area, - (mch_pduP->Pdu_size == 0)? "Empty MCH PDU":"Let RN transmit for the moment"); - mch_pduP = NULL; - } - - if (mch_pduP) { - fill_eNB_dlsch_MCH (eNB, mch_pduP->mcs, 1, 0); - eNB->dlsch_MCH->harq_ids[proc->frame_tx%2][subframe] = 0; - eNB->dlsch_MCH->harq_processes[0]->pdu=(uint8_t *) mch_pduP->payload; - // Generate PMCH - generate_mch (eNB, proc, NULL/*(uint8_t *) mch_pduP->payload*/); - } else { - LOG_D (PHY, "[eNB/RN] Frame %d subframe %d: MCH not generated \n", proc->frame_tx, subframe); - } -} -#endif void common_signal_procedures_fembms (PHY_VARS_eNB *eNB,int frame, int subframe) { LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; @@ -507,11 +464,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) { if (is_fembms_pmch_subframe(frame,subframe,fp)) { -#ifdef MBMS_NFAPI_SCHEDULER pmch_procedures(eNB,proc,1); LOG_D(MAC,"frame %d, subframe %d -> PMCH\n",frame,subframe); return; -#endif }else if(is_fembms_cas_subframe(frame,subframe,fp) || is_fembms_nonMBSFN_subframe(frame,subframe,fp)){ LOG_D(MAC,"frame %d, subframe %d -> CAS\n",frame,subframe); common_signal_procedures_fembms(eNB,proc->frame_tx, proc->subframe_tx); @@ -520,11 +475,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, if((!is_fembms_cas_subframe(frame,subframe,fp)) && (!is_fembms_nonMBSFN_subframe(frame,subframe,fp))){ if (is_pmch_subframe(frame,subframe,fp)) { -#ifdef MBMS_NFAPI_SCHEDULER pmch_procedures(eNB,proc,0); -#else - pmch_procedures(eNB,proc); -#endif } else { // this is not a pmch subframe, so generate PSS/SSS/PBCH common_signal_procedures(eNB,proc->frame_tx, proc->subframe_tx); @@ -617,10 +568,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) { if (is_fembms_pmch_subframe(frame,subframe,fp)) { -#ifdef MBMS_NFAPI_SCHEDULER pmch_procedures(eNB,proc,1); return; -#endif }else if(is_fembms_cas_subframe(frame,subframe,fp)){ common_signal_procedures_fembms(eNB,proc->frame_tx, proc->subframe_tx); } From 6d90aaaae2cf133fd54fa3816e672bf40ce3e7b1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 28 Feb 2023 14:01:16 +0100 Subject: [PATCH 02/13] (Almost) Remove all PHY/phy_vars* and PHY/phy_extern --- doc/Doxyfile | 1 - executables/lte-ru.c | 8 +- executables/main_ru.c | 2 + openair1/PHY/INIT/lte_init_ru.c | 3 +- openair1/PHY/INIT/nr_init_ru.c | 3 +- openair1/PHY/LTE_ESTIMATION/lte_sync_time.c | 2 +- .../PHY/LTE_ESTIMATION/lte_sync_timefreq.c | 1 + .../PHY/LTE_ESTIMATION/lte_ue_measurements.c | 1 + .../lte_ul_channel_estimation.c | 4 +- openair1/PHY/LTE_REFSIG/README.txt | 1 - openair1/PHY/LTE_REFSIG/primary_synch.h | 27 - openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c | 4 +- openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h | 5 + openair1/PHY/LTE_TRANSPORT/print_stats.c | 753 ------------------ openair1/PHY/LTE_TRANSPORT/pss.c | 2 +- .../PHY/LTE_TRANSPORT/ulsch_demodulation.c | 3 - openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 59 +- .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 2 +- openair1/PHY/LTE_UE_TRANSPORT/pbch_ue.c | 2 +- openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c | 2 +- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 1 + openair1/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c | 1 + .../PHY/LTE_UE_TRANSPORT/srs_modulation.c | 66 +- openair1/PHY/LTE_UE_TRANSPORT/sss_ue.c | 4 +- openair1/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c | 1 - openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c | 1 + .../PHY/LTE_UE_TRANSPORT/ulsch_modulation.c | 1 + openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 2 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 +- openair1/PHY/phy_extern.h | 145 ++-- openair1/PHY/phy_extern_nr_ue.h | 83 -- openair1/PHY/phy_extern_ue.h | 72 +- openair1/PHY/phy_vars.h | 92 +-- openair1/PHY/phy_vars_nr_ue.h | 8 - openair1/PHY/phy_vars_ue.h | 86 +- openair1/SCHED_UE/phy_procedures_lte_ue.c | 2 +- openair1/SCHED_UE/pusch_pc.c | 3 +- openair1/SCHED_UE/srs_pc.c | 1 + openair1/SIMULATION/LTE_PHY/ulsim.c | 6 +- openair2/LAYER2/MAC/mac.h | 2 + 40 files changed, 198 insertions(+), 1266 deletions(-) delete mode 100644 openair1/PHY/LTE_REFSIG/primary_synch.h delete mode 100644 openair1/PHY/LTE_TRANSPORT/print_stats.c diff --git a/doc/Doxyfile b/doc/Doxyfile index 51492143d7..198bede607 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -2244,7 +2244,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/defs_L1_NB_IoT.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/phy_extern_ue.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/defs_gNB.h \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_REFSIG/primary_synch.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_REFSIG/defs_NB_IoT.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_REFSIG/lte_refsig.h \ diff --git a/executables/lte-ru.c b/executables/lte-ru.c index 8d5f4254ee..a784ee5a09 100644 --- a/executables/lte-ru.c +++ b/executables/lte-ru.c @@ -51,6 +51,7 @@ #include "PHY/defs_common.h" #include "PHY/types.h" #include "PHY/INIT/phy_init.h" +#include "PHY/phy_extern.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_TRANSPORT/if4_tools.h" @@ -105,13 +106,6 @@ void wait_eNBs(void); const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERROR","RU_SYNC"}; -extern const char NB_functions[7][20]; -extern const char NB_timing[2][20]; - - -extern const char ru_if_types[MAX_RU_IF_TYPES][20]; - - #if defined(PRE_SCD_THREAD) #include "common/ran_context.h" #include "nfapi/oai_integration/vendor_ext.h" diff --git a/executables/main_ru.c b/executables/main_ru.c index ee2e6dc39c..33e01f5bff 100644 --- a/executables/main_ru.c +++ b/executables/main_ru.c @@ -49,12 +49,14 @@ #include "radio/ETHERNET/USERSPACE/LIB/if_defs.h" #include "PHY/phy_vars.h" +#include "PHY/phy_extern.h" #include "PHY/TOOLS/phy_scope_interface.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "PHY/INIT/phy_init.h" #include "openair2/ENB_APP/enb_paramdef.h" #include "system.h" +#include "nfapi/oai_integration/vendor_ext.h" #include #include diff --git a/openair1/PHY/INIT/lte_init_ru.c b/openair1/PHY/INIT/lte_init_ru.c index a856c33999..c07c9230d8 100644 --- a/openair1/PHY/INIT/lte_init_ru.c +++ b/openair1/PHY/INIT/lte_init_ru.c @@ -20,6 +20,7 @@ */ #include "phy_init.h" +#include "PHY/phy_extern.h" #include "SCHED/sched_eNB.h" #include "PHY/LTE_REFSIG/lte_refsig.h" //#include "SIMULATION/TOOLS/sim.h" @@ -33,8 +34,6 @@ void init_7_5KHz(void); -extern const char ru_if_types[MAX_RU_IF_TYPES][20]; - int phy_init_RU(RU_t *ru) { LTE_DL_FRAME_PARMS *fp = ru->frame_parms; RU_CALIBRATION *calibration = &ru->calibration; diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index f1810e5541..6b433f17d1 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -20,6 +20,7 @@ */ #include "phy_init.h" +#include "PHY/phy_extern.h" #include "SCHED/sched_common.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" @@ -28,8 +29,6 @@ void init_prach_ru_list(RU_t *ru); -extern const char ru_if_types[MAX_RU_IF_TYPES][20]; - int nr_phy_init_RU(RU_t *ru) { NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index d699e7ebd9..8587bf1f70 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -28,7 +28,7 @@ //#include #include #include "PHY/defs_UE.h" -#include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "PHY/LTE_REFSIG/lte_refsig.h" // Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c index 524b200e1a..780c3955cf 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c @@ -38,6 +38,7 @@ //#include "defs.h" #include "PHY/defs_UE.h" #include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #if defined(__x86_64__) || defined(__i386__) #include "pss6144.h" diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c index 16b818e90f..340da97d48 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c @@ -23,6 +23,7 @@ #include "PHY/defs_UE.h" #include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "common/utils/LOG/log.h" #include "PHY/sse_intrin.h" diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 152a298398..5d5e9c5d56 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -20,7 +20,7 @@ */ #include "PHY/defs_eNB.h" -//#include "PHY/phy_extern.h" +#include "PHY/phy_extern.h" #include "PHY/sse_intrin.h" //#define DEBUG_CH #include "common/utils/LOG/log.h" @@ -35,8 +35,6 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 #define SCALE 0x3FFF -static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; - int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, L1_rxtx_proc_t *proc, LTE_eNB_ULSCH_t * ulsch, diff --git a/openair1/PHY/LTE_REFSIG/README.txt b/openair1/PHY/LTE_REFSIG/README.txt index eae92fb389..8d0014f39b 100644 --- a/openair1/PHY/LTE_REFSIG/README.txt +++ b/openair1/PHY/LTE_REFSIG/README.txt @@ -5,7 +5,6 @@ lte_gold.c : Generators for LTE gold sequences (used for pilots and scr lte_ul_ref.c : UL DRS signal generation for TX and RX defs.h : data structures and function prototypes mod_table.h : lookup tables for QAM modulation (CBMIMO1 tables) -primary_synch.h : 3 PSS sequences primary_synch.m : MATLAB/OCTAVE generator for PSS gen_mod_table.m : MATLAB/OCTAVE generator for CBMIMO1 mod_table.h lte_ul.m : MATLAB/OCTAVE generator for UL (SC-FDMA) DFT sizes diff --git a/openair1/PHY/LTE_REFSIG/primary_synch.h b/openair1/PHY/LTE_REFSIG/primary_synch.h deleted file mode 100644 index 8152722df3..0000000000 --- a/openair1/PHY/LTE_REFSIG/primary_synch.h +++ /dev/null @@ -1,27 +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 - */ - -short primary_synch0[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-26120,-19785,11971,-30502,-24020,-22288,32117,6492,31311,9658,-16384,-28378,25100,-21063,-7292,-31946,20429,25618,14948,29158,11971,-30502,31311,9658,25100,-21063,-16384,28377,-24020,22287,32117,6492,-7292,31945,20429,25618,-26120,-19785,-16384,-28378,-16384,28377,-26120,-19785,-32402,4883,31311,-9659,32117,6492,-7292,-31946,32767,-1,25100,-21063,-24020,22287,-32402,4883,-32402,4883,-24020,22287,25100,-21063,32767,-1,-7292,-31946,32117,6492,31311,-9659,-32402,4883,-26120,-19785,-16384,28377,-16384,-28378,-26120,-19785,20429,25618,-7292,31945,32117,6492,-24020,22287,-16384,28377,25100,-21063,31311,9658,11971,-30502,14948,29158,20429,25618,-7292,-31946,25100,-21063,-16384,-28378,31311,9658,32117,6492,-24020,-22288,11971,-30502,-26120,-19785,32767,0,0,0,0,0,0,0,0,0,0,0}; -short primary_synch1[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,-8086,-24020,-22288,2448,32675,-26120,19784,27073,18458,-16384,28377,25100,21062,-29523,14217,-7292,31945,-13477,-29868,-24020,-22288,27073,18458,25100,21062,-16384,-28378,2448,-32676,-26120,19784,-29523,-14218,-7292,31945,-31754,-8086,-16384,28377,-16384,-28378,-31754,-8086,31311,-9659,27073,-18459,-26120,19784,-29523,14217,32767,-1,25100,21062,2448,-32676,31311,-9659,31311,-9659,2448,-32676,25100,21062,32767,0,-29523,14217,-26120,19784,27073,-18459,31311,-9659,-31754,-8086,-16384,-28378,-16384,28377,-31754,-8086,-7292,31945,-29523,-14218,-26120,19784,2448,-32676,-16384,-28378,25100,21062,27073,18458,-24020,-22288,-13477,-29868,-7292,31945,-29523,14217,25100,21062,-16384,28377,27073,18458,-26120,19784,2448,32675,-24020,-22288,-31754,-8086,32767,0,0,0,0,0,0,0,0,0,0,0}; -short primary_synch2[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,8085,-24020,22287,2448,-32676,-26120,-19785,27073,-18459,-16384,-28378,25100,-21063,-29523,-14218,-7292,-31946,-13477,29867,-24020,22287,27073,-18459,25100,-21063,-16384,28377,2448,32675,-26120,-19785,-29523,14217,-7292,-31946,-31754,8085,-16384,-28378,-16384,28377,-31754,8085,31311,9658,27073,18458,-26120,-19785,-29523,-14218,32767,0,25100,-21063,2448,32675,31311,9658,31311,9658,2448,32675,25100,-21063,32767,0,-29523,-14218,-26120,-19785,27073,18458,31311,9658,-31754,8085,-16384,28377,-16384,-28378,-31754,8085,-7292,-31946,-29523,14217,-26120,-19785,2448,32675,-16384,28377,25100,-21063,27073,-18459,-24020,22287,-13477,29867,-7292,-31946,-29523,-14218,25100,-21063,-16384,-28378,27073,-18459,-26120,-19785,2448,-32676,-24020,22287,-31754,8085,32767,-1,0,0,0,0,0,0,0,0,0,0}; -unsigned char primary_synch0_tab[72] = {0,0,0,0,0,85,110,97,109,146,145,106,92,103,139,137,97,145,92,127,124,146,130,139,110,106,127,110,118,88,146,103,85,92,124,118,118,124,92,85,103,146,88,118,110,127,106,110,139,130,146,124,127,92,145,97,137,139,103,92,106,145,146,109,97,110,85,0,0,0,0,0}; -unsigned char primary_synch1_tab[72] = {0,0,0,0,0,85,114,109,133,123,142,127,141,121,130,105,109,142,141,106,100,123,112,130,114,127,106,114,88,91,123,121,85,141,100,88,88,100,141,85,121,123,91,88,114,106,127,114,130,112,123,100,106,141,142,109,105,130,121,141,127,142,123,133,109,114,85,0,0,0,0,0}; -unsigned char primary_synch2_tab[72] = {0,0,0,0,0,85,119,124,100,110,91,106,92,112,103,128,124,91,92,127,133,110,121,103,119,106,127,119,145,142,110,112,85,92,133,145,145,133,92,85,112,110,142,145,119,127,106,119,103,121,110,133,127,92,91,124,128,103,112,92,106,91,110,100,124,119,85,0,0,0,0,0}; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c index 015a95a862..7075b74fe1 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c @@ -163,8 +163,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_SCRAMBLING, VCD_FUNCTION_OUT); } - - +uint8_t scrambling_lut[65536*16] __attribute__((aligned(32))); void init_scrambling_lut(void) { uint32_t s; int i=0,j; @@ -215,6 +214,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, } } +int16_t unscrambling_lut[65536*16] __attribute__((aligned(32))); void init_unscrambling_lut(void) { uint32_t s; int i=0,j; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h b/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h index 3a18924fe4..863eb33d34 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h @@ -19,6 +19,9 @@ * contact@openairinterface.org */ +#ifndef DLSCH_TBS_H_ +#define DLSCH_TBS_H_ + static const unsigned int dlsch_tbs25[27][25] = { {16, 32, 56, 88, 120, 152, 176, 208, 224, 256, 288, 328, 344, 376, 392, 424, 456, 488, 504, 536, 568, 600, 616, 648, 680}, {24, 56, 88, 144, 176, 208, 224, 256, 328, 344, 376, 424, 456, 488, 520, 568, 600, 632, 680, 712, 744, 776, 808, 872, 904}, @@ -47,3 +50,5 @@ static const unsigned int dlsch_tbs25[27][25] = { {584, 1192, 1800, 2408, 2984, 3624, 4264, 4968, 5544, 5992, 6712, 7224, 7992, 8504, 9144, 9912, 10296, 11064, 11448, 12216, 12960, 13536, 14112, 14688, 15264}, {616, 1256, 1864, 2536, 3112, 3752, 4392, 5160, 5736, 6200, 6968, 7480, 8248, 8760, 9528, 10296, 10680, 11448, 12216, 12576, 13536, 14112, 14688, 15264, 15840}, {712, 1480, 2216, 2984, 3752, 4392, 5160, 5992, 6712, 7480, 8248, 8760, 9528, 10296, 11064, 11832, 12576, 13536, 14112, 14688, 15264, 16416, 16992, 17568, 18336}}; + +#endif /* DLSCH_TBS_H_ */ diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c deleted file mode 100644 index 856e392070..0000000000 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ /dev/null @@ -1,753 +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/LTE_TRANSPORT/print_stats.c -* \brief PHY statstic logging function -* \author R. Knopp, F. Kaltenberger, navid nikaein -* \date 2011 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr -* \note -* \warning -*/ - -#include "PHY/LTE_TRANSPORT/proto.h" -#include "executables/lte-softmodem.h" -#include "PHY/defs.h" -#include "PHY/extern.h" -#include "SCHED/extern.h" - - #include "openair2/LAYER2/MAC/proto.h" - #include "openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.h" - -extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index); - -#include "common_lib.h" -extern openair0_config_t openair0_cfg[]; - - -int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char *buffer, int length, runmode_t mode, int input_level_dBm) { - uint8_t eNB=0; - uint32_t RRC_status; - int len=length; - int harq_pid,round; - - if (ue==NULL) - return 0; - - if ((mode == normal_txrx) || (mode == no_L2_connect)) { - len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",ue->Mod_id, ue->pdcch_vars[0][0]->crnti); - len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n", - 10*log10(ue->measurements.rsrp[0])-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rssi)-ue->rx_total_gain_dB, - 10*log10(ue->measurements.rsrq[0]), - ue->measurements.n0_power_tot_dBm, - (double)ue->measurements.n0_power_tot_dBm+132.24); - /* - len += sprintf(&buffer[len], - "[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n", - proc->frame_rx, - ue->measurements.rx_rssi_dBm[0], - ue->measurements.rx_power_dB[0][0], - ue->measurements.rx_power_dB[0][1], - ue->measurements.rx_rssi_dBm[1], - ue->measurements.rx_power_dB[1][0], - ue->measurements.rx_power_dB[1][1], - ue->measurements.rx_rssi_dBm[2], - ue->measurements.rx_power_dB[2][0], - ue->measurements.rx_power_dB[2][1], - ue->measurements.n0_power_tot_dBm, - ue->measurements.n0_power_tot_dBm+10*log10(12*ue->frame_parms.N_RB_DL), - ue->frame_parms.N_RB_DL, - ue->measurements.n0_power_dB[0], - ue->measurements.n0_power_dB[1]); - */ - len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",ue->rx_total_gain_dB); - len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz, estimated carrier frequency %f Hz\n",ue->common_vars.freq_offset,openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset); - len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[ue->UE_mode[0]],ue->UE_mode[0]); - len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",ue->timing_advance); - - if (ue->UE_mode[0]==PUSCH) { - len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", - ue->ulsch[0]->Po_PUSCH, - get_PL(ue->Mod_id,ue->CC_id,0), - ue->frame_parms.ul_power_control_config_common.p0_NominalPUSCH, - ue->ulsch[0]->PHR); - len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", - get_PL(ue->Mod_id,ue->CC_id,0)+ - ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH+ - ue->dlsch[0][0][0]->g_pucch, - ue->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - ue->dlsch[0][0][0]->g_pucch); - } - - //for (eNB=0;eNBmeasurements.rx_spatial_power_dB[eNB][0][0], - ue->measurements.rx_spatial_power_dB[eNB][0][1], - ue->measurements.rx_spatial_power_dB[eNB][1][0], - ue->measurements.rx_spatial_power_dB[eNB][1][1]); - len += sprintf(&buffer[len], "[UE PROC] RX total power eNB%d: %d dB, avg: %d dB\n",eNB,ue->measurements.rx_power_tot_dB[eNB],ue->measurements.rx_power_avg_dB[eNB]); - len += sprintf(&buffer[len], "[UE PROC] RX total power lin: %d, avg: %d, RX total noise lin: %d, avg: %d\n",ue->measurements.rx_power_tot[eNB], - ue->measurements.rx_power_avg[eNB], ue->measurements.n0_power_tot, ue->measurements.n0_power_avg); - len += sprintf(&buffer[len], "[UE PROC] effective SINR %.2f dB\n",ue->sinr_eff); - len += sprintf(&buffer[len], "[UE PROC] Wideband CQI eNB %d: %d dB, avg: %d dB\n",eNB,ue->measurements.wideband_cqi_tot[eNB],ue->measurements.wideband_cqi_avg[eNB]); - - switch (ue->frame_parms.N_RB_DL) { - case 6: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5]); - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1]); - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5]); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,6))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,6)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,6))); - break; - - case 25: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6]); - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1]); - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6]); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,7))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,7)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,7))); - break; - - case 50: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6], - ue->measurements.subband_cqi_dB[eNB][0][7], - ue->measurements.subband_cqi_dB[eNB][0][8]); - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6], - ue->measurements.subband_cqi_dB[eNB][1][7], - ue->measurements.subband_cqi_dB[eNB][1][8]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0], - ue->measurements.subband_pmi_re[eNB][7][0], - ue->measurements.subband_pmi_im[eNB][7][0], - ue->measurements.subband_pmi_re[eNB][8][0], - ue->measurements.subband_pmi_im[eNB][8][0]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1], - ue->measurements.subband_pmi_re[eNB][7][1], - ue->measurements.subband_pmi_im[eNB][7][1], - ue->measurements.subband_pmi_re[eNB][8][1], - ue->measurements.subband_pmi_im[eNB][8][1]); - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6], - ue->measurements.selected_rx_antennas[eNB][7], - ue->measurements.selected_rx_antennas[eNB][8]); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,9))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,9)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,9))); - break; - - case 100: - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 0): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][0][0], - ue->measurements.subband_cqi_dB[eNB][0][1], - ue->measurements.subband_cqi_dB[eNB][0][2], - ue->measurements.subband_cqi_dB[eNB][0][3], - ue->measurements.subband_cqi_dB[eNB][0][4], - ue->measurements.subband_cqi_dB[eNB][0][5], - ue->measurements.subband_cqi_dB[eNB][0][6], - ue->measurements.subband_cqi_dB[eNB][0][7], - ue->measurements.subband_cqi_dB[eNB][0][8], - ue->measurements.subband_cqi_dB[eNB][0][9], - ue->measurements.subband_cqi_dB[eNB][0][10], - ue->measurements.subband_cqi_dB[eNB][0][11], - ue->measurements.subband_cqi_dB[eNB][0][12]); - len += sprintf(&buffer[len], "[UE PROC] Subband CQI eNB%d (Ant 1): [%d %d %d %d %d %d %d %d %d %d %d %d %d] dB\n", - eNB, - ue->measurements.subband_cqi_dB[eNB][1][0], - ue->measurements.subband_cqi_dB[eNB][1][1], - ue->measurements.subband_cqi_dB[eNB][1][2], - ue->measurements.subband_cqi_dB[eNB][1][3], - ue->measurements.subband_cqi_dB[eNB][1][4], - ue->measurements.subband_cqi_dB[eNB][1][5], - ue->measurements.subband_cqi_dB[eNB][1][6], - ue->measurements.subband_cqi_dB[eNB][1][7], - ue->measurements.subband_cqi_dB[eNB][1][8], - ue->measurements.subband_cqi_dB[eNB][1][9], - ue->measurements.subband_cqi_dB[eNB][1][10], - ue->measurements.subband_cqi_dB[eNB][1][11], - ue->measurements.subband_cqi_dB[eNB][1][12]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 0): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][0], - ue->measurements.subband_pmi_im[eNB][0][0], - ue->measurements.subband_pmi_re[eNB][1][0], - ue->measurements.subband_pmi_im[eNB][1][0], - ue->measurements.subband_pmi_re[eNB][2][0], - ue->measurements.subband_pmi_im[eNB][2][0], - ue->measurements.subband_pmi_re[eNB][3][0], - ue->measurements.subband_pmi_im[eNB][3][0], - ue->measurements.subband_pmi_re[eNB][4][0], - ue->measurements.subband_pmi_im[eNB][4][0], - ue->measurements.subband_pmi_re[eNB][5][0], - ue->measurements.subband_pmi_im[eNB][5][0], - ue->measurements.subband_pmi_re[eNB][6][0], - ue->measurements.subband_pmi_im[eNB][6][0], - ue->measurements.subband_pmi_re[eNB][7][0], - ue->measurements.subband_pmi_im[eNB][7][0], - ue->measurements.subband_pmi_re[eNB][8][0], - ue->measurements.subband_pmi_im[eNB][8][0], - ue->measurements.subband_pmi_re[eNB][9][0], - ue->measurements.subband_pmi_im[eNB][9][0], - ue->measurements.subband_pmi_re[eNB][10][0], - ue->measurements.subband_pmi_im[eNB][10][0], - ue->measurements.subband_pmi_re[eNB][11][0], - ue->measurements.subband_pmi_im[eNB][11][0], - ue->measurements.subband_pmi_re[eNB][12][0], - ue->measurements.subband_pmi_im[eNB][12][0]); - len += sprintf(&buffer[len], "[UE PROC] Subband PMI eNB%d (Ant 1): [(%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d) (%d %d)]\n", - eNB, - ue->measurements.subband_pmi_re[eNB][0][1], - ue->measurements.subband_pmi_im[eNB][0][1], - ue->measurements.subband_pmi_re[eNB][1][1], - ue->measurements.subband_pmi_im[eNB][1][1], - ue->measurements.subband_pmi_re[eNB][2][1], - ue->measurements.subband_pmi_im[eNB][2][1], - ue->measurements.subband_pmi_re[eNB][3][1], - ue->measurements.subband_pmi_im[eNB][3][1], - ue->measurements.subband_pmi_re[eNB][4][1], - ue->measurements.subband_pmi_im[eNB][4][1], - ue->measurements.subband_pmi_re[eNB][5][1], - ue->measurements.subband_pmi_im[eNB][5][1], - ue->measurements.subband_pmi_re[eNB][6][1], - ue->measurements.subband_pmi_im[eNB][6][1], - ue->measurements.subband_pmi_re[eNB][7][1], - ue->measurements.subband_pmi_im[eNB][7][1], - ue->measurements.subband_pmi_re[eNB][8][1], - ue->measurements.subband_pmi_im[eNB][8][1], - ue->measurements.subband_pmi_re[eNB][9][1], - ue->measurements.subband_pmi_im[eNB][9][1], - ue->measurements.subband_pmi_re[eNB][10][1], - ue->measurements.subband_pmi_im[eNB][10][1], - ue->measurements.subband_pmi_re[eNB][11][1], - ue->measurements.subband_pmi_im[eNB][11][1], - ue->measurements.subband_pmi_re[eNB][12][1], - ue->measurements.subband_pmi_im[eNB][12][1]); - len += sprintf(&buffer[len], "[UE PROC] PMI Antenna selection eNB%d : [%d %d %d %d %d %d %d %d %d %d %d %d %d]\n", - eNB, - ue->measurements.selected_rx_antennas[eNB][0], - ue->measurements.selected_rx_antennas[eNB][1], - ue->measurements.selected_rx_antennas[eNB][2], - ue->measurements.selected_rx_antennas[eNB][3], - ue->measurements.selected_rx_antennas[eNB][4], - ue->measurements.selected_rx_antennas[eNB][5], - ue->measurements.selected_rx_antennas[eNB][6], - ue->measurements.selected_rx_antennas[eNB][7], - ue->measurements.selected_rx_antennas[eNB][8], - ue->measurements.selected_rx_antennas[eNB][9], - ue->measurements.selected_rx_antennas[eNB][10], - ue->measurements.selected_rx_antennas[eNB][11], - ue->measurements.selected_rx_antennas[eNB][12]); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (max): %jx\n",eNB,pmi2hex_2Ar1(quantize_subband_pmi(&ue->measurements,eNB,13))); - len += sprintf(&buffer[len], "[UE PROC] Quantized PMI eNB %d (both): %jx,%jx\n",eNB, - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,0,13)), - pmi2hex_2Ar1(quantize_subband_pmi2(&ue->measurements,eNB,1,13))); - break; - } - - RRC_status = mac_UE_get_rrc_status(ue->Mod_id, 0); - len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status); - len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d \n",ue->transmission_mode[eNB]); - len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n", - ue->pbch_vars[eNB]->pdu_errors_conseq, - ue->pbch_vars[eNB]->pdu_errors, - ue->pbch_vars[eNB]->pdu_fer); - - if (ue->transmission_mode[eNB] == 6) - len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,ue->measurements.precoded_cqi_dB[eNB][0]); - - for (harq_pid=0; harq_pid<8; harq_pid++) { - len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][0]->harq_processes[harq_pid]->mcs); - - for (round=0; round<8; round++) - len+=sprintf(&buffer[len],"%d/%d ", - ue->dlsch[0][0][0]->harq_processes[harq_pid]->errors[round], - ue->dlsch[0][0][0]->harq_processes[harq_pid]->trials[round]); - - len+=sprintf(&buffer[len],"\n"); - } - - if (ue->dlsch[0][0] && ue->dlsch[0][0][0] && ue->dlsch[0][0][1]) { - len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(ue->dlsch[0][0][0]->pmi_alloc),ue->dlsch[0][0][0]); - len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,ue->dlsch[0][0][0]->harq_processes[0]->dl_power_off); - - for (harq_pid=0; harq_pid<8; harq_pid++) { - len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,ue->dlsch[0][0][1]->harq_processes[0]->mcs); - - for (round=0; round<8; round++) - len+=sprintf(&buffer[len],"%d/%d ", - ue->dlsch[0][0][1]->harq_processes[harq_pid]->errors[round], - ue->dlsch[0][0][1]->harq_processes[harq_pid]->trials[round]); - - len+=sprintf(&buffer[len],"\n"); - } - } - - len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",ue->dlsch_received[0],ue->dlsch_errors[0],ue->dlsch_fer[0]); - len += sprintf(&buffer[len], "[UE PROC] DLSCH (SI) Total %d, Error %d\n",ue->dlsch_SI_received[0],ue->dlsch_SI_errors[0]); - len += sprintf(&buffer[len], "[UE PROC] DLSCH (RA) Total %d, Error %d\n",ue->dlsch_ra_received[0],ue->dlsch_ra_errors[0]); - int i=0; - - //len += sprintf(&buffer[len], "[UE PROC] MCH Total %d\n", ue->dlsch_mch_received[0]); - for(i=0; i frame_parms.num_MBSFN_config; i++ ) { - len += sprintf(&buffer[len], "[UE PROC] MCH (MCCH MBSFN %d) Total %d, Error %d, Trials %d\n", - i, ue->dlsch_mcch_received[i][0],ue->dlsch_mcch_errors[i][0],ue->dlsch_mcch_trials[i][0]); - len += sprintf(&buffer[len], "[UE PROC] MCH (MTCH MBSFN %d) Total %d, Error %d, Trials %d\n", - i, ue->dlsch_mtch_received[i][0],ue->dlsch_mtch_errors[i][0],ue->dlsch_mtch_trials[i][0]); - } - - len += sprintf(&buffer[len], "[UE PROC] DLSCH Bitrate %dkbps\n",(ue->bitrate[0]/1000)); - len += sprintf(&buffer[len], "[UE PROC] Total Received Bits %dkbits\n",(ue->total_received_bits[0]/1000)); - len += sprintf(&buffer[len], "[UE PROC] IA receiver %d\n",ue->use_ia_receiver); - } - } else { - len += sprintf(&buffer[len], "[UE PROC] Frame count: %d, RSSI %3.2f dB (%d dB, %d dB), N0 %3.2f dB (%d dB, %d dB)\n", - proc->frame_rx, - 10*log10(ue->measurements.rssi), - ue->measurements.rx_power_dB[0][0], - ue->measurements.rx_power_dB[0][1], - 10*log10(ue->measurements.n0_power_tot), - ue->measurements.n0_power_dB[0], - ue->measurements.n0_power_dB[1]); - } - - len += sprintf(&buffer[len],"EOF\n"); - return len; -} // is_clusterhead - -/* -int dump_eNB_stats(PHY_VARS_eNB *eNB, char* buffer, int length) -{ - - unsigned int success=0; - uint8_t eNB_id,UE_id,i,j,number_of_cards_l=1; - uint32_t ulsch_errors=0,dlsch_errors=0; - uint32_t ulsch_round_attempts[4]= {0,0,0,0},ulsch_round_errors[4]= {0,0,0,0}; - uint32_t dlsch_round_attempts[4]= {0,0,0,0},dlsch_round_errors[4]= {0,0,0,0}; - uint32_t UE_id_mac, RRC_status; - eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0]; - if (eNB==NULL) - return 0; - - int len = length; - - // if(eNB->frame==0){ - eNB->total_dlsch_bitrate = 0;//eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate; - eNB->total_transmitted_bits = 0;// eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_transmitted_bits; - eNB->total_system_throughput = 0;//eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput; - // } - - for (eNB_id=0; eNB_idframe_tx, - eNB->rx_total_gain_dB, - eNB->measurements.n0_power_tot_dBm, - eNB->measurements.n0_power_dB[0], - eNB->measurements.n0_power_dB[1]); - - len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ", - eNB->rb_mask_ul[0], - eNB->rb_mask_ul[1],eNB->rb_mask_ul[2],eNB->rb_mask_ul[3]); - - for (i=0; iframe_parms.N_RB_UL; i++) { - len += sprintf(&buffer[len],"%4d ", - eNB->measurements.n0_subband_power_tot_dBm[i]); - if ((i>0) && ((i%25) == 0)) - len += sprintf(&buffer[len],"\n"); - } - len += sprintf(&buffer[len],"\n"); - len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n"); - - for (UE_id=0; UE_iddlsch!=NULL) && - (eNB->dlsch[(uint8_t)UE_id]!=NULL) && - (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& - (eNB->UE_stats[UE_id].mode == PUSCH)) { - - eNB->total_dlsch_bitrate = eNB->UE_stats[UE_id].dlsch_bitrate + eNB->total_dlsch_bitrate; - eNB->total_transmitted_bits = eNB->UE_stats[UE_id].total_TBS + eNB->total_transmitted_bits; - - //eNB->total_system_throughput = eNB->UE_stats[UE_id].total_transmitted_bits + eNB->total_system_throughput; - - for (i=0; i<8; i++) - success = success + (eNB->UE_stats[UE_id].dlsch_trials[i][0] - eNB->UE_stats[UE_id].dlsch_l2_errors[i]); - - - - len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(eNB->total_transmitted_bits/1000),proc->frame_tx+1); - len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(eNB->total_dlsch_bitrate/1000)); - len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,proc->frame_tx+1); - //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->FULL_MUMIMO_transmissions,eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_MUMIMO_transmissions,eNB->check_for_total_transmissions); - //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",eNB->check_for_SUMIMO_transmissions,eNB->check_for_total_transmissions); - - len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm, PUCCH1 Thres %d dBm \n", - UE_id, - eNB->UE_stats[UE_id].crnti, - dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[0]), - dB_fixed(eNB->pusch_vars[UE_id]->ulsch_power[1]), - eNB->UE_stats[UE_id].UL_rssi[0], - eNB->UE_stats[UE_id].UL_rssi[1], - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - eNB->frame_parms.ul_power_control_config_common.p0_NominalPUCCH, - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_below/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - dB_fixed(eNB->UE_stats[UE_id].Po_PUCCH1_above/eNB->frame_parms.N_RB_UL)-eNB->rx_total_gain_dB, - PUCCH1_THRES+eNB->measurements.n0_power_tot_dBm-dB_fixed(eNB->frame_parms.N_RB_UL)); - - len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ", - eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[0]->mcs, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->mcs, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->nb_rb, - eNB->ulsch[(uint8_t)UE_id]->harq_processes[0]->delta_TF); - - len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n", - eNB->measurements.wideband_cqi_dB[UE_id][0], - eNB->measurements.wideband_cqi_dB[UE_id][1]); - - len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ", - eNB->transmission_mode[UE_id], - eNB->UE_stats[UE_id].DL_cqi[0], - pmi2hex_2Ar1(eNB->UE_stats[UE_id].DL_pmi_single)); - - len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ", - eNB->UE_stats[UE_id].UE_timing_offset, - eNB->UE_stats[UE_id].UE_timing_offset>>2, - eNB->UE_stats[UE_id].timing_advance_update); - - len += sprintf(&buffer[len],"Mode = %s(%d) ", - mode_string[eNB->UE_stats[UE_id].mode], - eNB->UE_stats[UE_id].mode); - UE_id_mac = find_UE_id(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); - - if (UE_id_mac != -1) { - RRC_status = mac_eNB_get_rrc_status(eNB->Mod_id,eNB->dlsch[(uint8_t)UE_id][0]->rnti); - len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status); - } else - len += sprintf(&buffer[len],"UE_id_mac = -1\n"); - - len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n", - eNB->UE_stats[UE_id].sr_received, - eNB->UE_stats[UE_id].sr_total, - eNB->UE_stats[UE_id].sr_total-eNB->UE_stats[UE_id].sr_received); - - len += sprintf(&buffer[len],"DL Subband CQI: "); - - int nb_sb; - switch (eNB->frame_parms.N_RB_DL) { - case 6: - nb_sb=0; - break; - case 15: - nb_sb = 4; - case 25: - nb_sb = 7; - break; - case 50: - nb_sb = 9; - break; - case 75: - nb_sb = 10; - break; - case 100: - nb_sb = 13; - break; - default: - nb_sb=0; - break; - } - for (i=0; iUE_stats[UE_id].DL_subband_cqi[0][i]); - len += sprintf(&buffer[len],"\n"); - - - - ulsch_errors = 0; - - for (j=0; j<4; j++) { - ulsch_round_attempts[j]=0; - ulsch_round_errors[j]=0; - } - - len += sprintf(&buffer[len],"ULSCH errors/attempts per harq (per round): \n"); - - for (i=0; i<8; i++) { - len += sprintf(&buffer[len]," harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d) ", - i, - eNB->UE_stats[UE_id].ulsch_errors[i], - eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][0], - eNB->UE_stats[UE_id].ulsch_round_fer[i][0], - eNB->UE_stats[UE_id].ulsch_round_errors[i][0], - eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][0], - eNB->UE_stats[UE_id].ulsch_round_errors[i][1], - eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][1], - eNB->UE_stats[UE_id].ulsch_round_errors[i][2], - eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][2], - eNB->UE_stats[UE_id].ulsch_round_errors[i][3], - eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][3]); - if ((i&1) == 1) - len += sprintf(&buffer[len],"\n"); - - ulsch_errors+=eNB->UE_stats[UE_id].ulsch_errors[i]; - - for (j=0; j<4; j++) { - ulsch_round_attempts[j]+=eNB->UE_stats[UE_id].ulsch_decoding_attempts[i][j]; - ulsch_round_errors[j]+=eNB->UE_stats[UE_id].ulsch_round_errors[i][j]; - } - } - - len += sprintf(&buffer[len],"ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n", - ulsch_errors,ulsch_round_attempts[0], - - ulsch_round_errors[0],ulsch_round_attempts[0], - ulsch_round_errors[1],ulsch_round_attempts[1], - ulsch_round_errors[2],ulsch_round_attempts[2], - ulsch_round_errors[3],ulsch_round_attempts[3]); - - dlsch_errors = 0; - - for (j=0; j<4; j++) { - dlsch_round_attempts[j]=0; - dlsch_round_errors[j]=0; - } - - len += sprintf(&buffer[len],"DLSCH errors/attempts per harq (per round): \n"); - - for (i=0; i<8; i++) { - len += sprintf(&buffer[len]," harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d) ", - i, - eNB->UE_stats[UE_id].dlsch_l2_errors[i], - eNB->UE_stats[UE_id].dlsch_trials[i][0], - eNB->UE_stats[UE_id].dlsch_ACK[i][0], - eNB->UE_stats[UE_id].dlsch_NAK[i][0], - eNB->UE_stats[UE_id].dlsch_trials[i][0], - eNB->UE_stats[UE_id].dlsch_ACK[i][1], - eNB->UE_stats[UE_id].dlsch_NAK[i][1], - eNB->UE_stats[UE_id].dlsch_trials[i][1], - eNB->UE_stats[UE_id].dlsch_ACK[i][2], - eNB->UE_stats[UE_id].dlsch_NAK[i][2], - eNB->UE_stats[UE_id].dlsch_trials[i][2], - eNB->UE_stats[UE_id].dlsch_ACK[i][3], - eNB->UE_stats[UE_id].dlsch_NAK[i][3], - eNB->UE_stats[UE_id].dlsch_trials[i][3]); - if ((i&1) == 1) - len += sprintf(&buffer[len],"\n"); - - - dlsch_errors+=eNB->UE_stats[UE_id].dlsch_l2_errors[i]; - - for (j=0; j<4; j++) { - dlsch_round_attempts[j]+=eNB->UE_stats[UE_id].dlsch_trials[i][j]; - dlsch_round_errors[j]+=eNB->UE_stats[UE_id].dlsch_NAK[i][j]; - } - } - - len += sprintf(&buffer[len],"DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n", - dlsch_errors,dlsch_round_attempts[0], - dlsch_round_errors[0],dlsch_round_attempts[0], - dlsch_round_errors[1],dlsch_round_attempts[1], - dlsch_round_errors[2],dlsch_round_attempts[2], - dlsch_round_errors[3],dlsch_round_attempts[3]); - - - len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(eNB->UE_stats[UE_id].total_TBS_MAC)/1000); - len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(eNB->UE_stats[UE_id].total_TBS)/1000); - len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(eNB->UE_stats[UE_id].dlsch_bitrate/1000)); - // len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",eNB->transmission_mode[UE_id]); - } - } - - len += sprintf(&buffer[len],"\n"); - } - - len += sprintf(&buffer[len],"EOF\n"); - - return len; -} -*/ diff --git a/openair1/PHY/LTE_TRANSPORT/pss.c b/openair1/PHY/LTE_TRANSPORT/pss.c index 34a7ba7007..8d95001c0e 100644 --- a/openair1/PHY/LTE_TRANSPORT/pss.c +++ b/openair1/PHY/LTE_TRANSPORT/pss.c @@ -48,7 +48,7 @@ int generate_pss(int32_t **txdataF, unsigned int Nsymb; unsigned short k,m,aa,a; uint8_t Nid2; - short *primary_sync; + const short *primary_sync; Nid2 = frame_parms->Nid_cell % 3; switch (Nid2) { diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 39d1a86e5b..190e3c47c0 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -40,8 +40,6 @@ #include "T.h" -//extern char* namepointer_chMag ; -//eren //extern int **ulchmag_eren; //eren @@ -1044,7 +1042,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc, uint8_t UE_id) { LTE_eNB_ULSCH_t **ulsch = eNB->ulsch; - // flagMag = 0; LTE_eNB_COMMON *common_vars = &eNB->common_vars; LTE_eNB_PUSCH *pusch_vars = eNB->pusch_vars[UE_id]; LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index b5e5b490a3..42a83a2cda 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -37,6 +37,7 @@ #include "PHY/phy_vars.h" #endif #include "assertions.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" //#define DEBUG_HARQ @@ -60,10 +61,67 @@ #define LOG_I(A,B...) printf(B) */ +int flag_LA=0; + extern uint16_t beta_cqi[16]; extern uint16_t beta_ri[16]; extern uint16_t beta_ack[16]; +static const double p_qpsk[8] = {5982.42405670359, + -21568.1135917693, + 31293.9987036905, + -23394.6795043871, + 9608.34750585489, + -2158.15802349899, + 267.731968719036, + -20.6145324295965}; +static const double p_qam16[8] = {7862.12690694170, + -28510.3207048338, + 41542.2150287122, + -31088.3036957379, + 12690.1982361016, + -2785.66604739984, + 326.595462489375, + -18.9911849872089}; +static const double p_qam64[8] = {8832.57933013696, + -32119.1802555952, + 46914.2578990397, + -35163.8150557183, + 14343.7419388853, + -3126.61025510092, + 360.954930562237, + -18.0358548533343}; +static 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}; +static 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}; +static 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}; +static 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} +}; + static int errorRB(int rb, char * table, int line) { LOG_E(PHY,"Received %d rb, impossble in table %s, at line %d\n", rb, table, line); return 0; @@ -2926,7 +2984,6 @@ uint16_t quantize_wideband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id) uint8_t sinr2cqi(double sinr,uint8_t trans_mode) { - // int flag_LA=0; uint8_t retValue = 0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 096c0fd442..8c0681e162 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -30,7 +30,7 @@ * \warning */ #include "PHY/defs_UE.h" -#include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "SCHED_UE/sched_UE.h" #include "transport_ue.h" #include "transport_proto_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pbch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pbch_ue.c index ad7bb6c8bf..108680c640 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pbch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pbch_ue.c @@ -36,7 +36,7 @@ #include "PHY/CODING/coding_extern.h" #include "PHY/CODING/lte_interleaver_inline.h" #include "transport_ue.h" -#include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "PHY/sse_intrin.h" #include "PHY/LTE_REFSIG/lte_refsig.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c index ae5a608da1..eb9e3bc742 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pmch_ue.c @@ -32,7 +32,7 @@ #include "PHY/defs_UE.h" -#include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "PHY/sse_intrin.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 9427ec3a5b..6df56d6c53 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -32,6 +32,7 @@ #include "PHY/defs_UE.h" #include "PHY/phy_extern_ue.h" #include "PHY/LTE_REFSIG/lte_refsig.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c index b4273095ba..b856976638 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c @@ -35,6 +35,7 @@ #include "LAYER2/MAC/mac.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "transport_proto_ue.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" #include "assertions.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c index 9c0edb467c..534228a935 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c @@ -30,20 +30,22 @@ * \warning */ #include "PHY/defs_UE.h" -#include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "common/utils/LOG/log.h" -unsigned short msrsb_6_40[8][4] = {{36,12,4,4}, - {32,16,8,4}, - {24,4,4,4}, - {20,4,4,4}, - {16,4,4,4}, - {12,4,4,4}, - {8,4,4,4}, - {4,4,4,4} +static unsigned short msrsb_6_40[8][4] = { + {36, 12, 4, 4}, + {32, 16, 8, 4}, + {24, 4, 4, 4}, + {20, 4, 4, 4}, + {16, 4, 4, 4}, + {12, 4, 4, 4}, + {8, 4, 4, 4}, + {4, 4, 4, 4} }; -unsigned short msrsb_41_60[8][4] = {{48,24,12,4}, +static unsigned short msrsb_41_60[8][4] = { + {48,24,12,4}, {48,16,8,4}, {40,20,4,4}, {36,12,4,4}, @@ -53,47 +55,8 @@ unsigned short msrsb_41_60[8][4] = {{48,24,12,4}, {16,4,4,4} }; -unsigned short msrsb_61_80[8][4] = {{72,24,12,4}, - {64,32,16,4}, - {60,20,4,4}, - {48,24,12,4}, - {48,16,8,4}, - {40,20,4,4}, - {36,12,4,4}, - {32,16,8,4} -}; - -unsigned short msrsb_81_110[8][4] = {{96,48,24,4}, - {96,32,16,4}, - {80,40,20,4}, +static unsigned short msrsb_61_80[8][4] = { {72,24,12,4}, - {64,32,16,4}, - {60,20,4,4}, - {48,24,12,4}, - {48,16,8,4} -}; - -unsigned short Nb_6_40[8][4] = {{36,12,4,4}, - {32,16,8,4}, - {24,4,4,4}, - {20,4,4,4}, - {16,4,4,4}, - {12,4,4,4}, - {8,4,4,4}, - {4,4,4,4} -}; - -unsigned short Nb_41_60[8][4] = {{48,24,12,4}, - {48,16,8,4}, - {40,20,4,4}, - {36,12,4,4}, - {32,16,8,4}, - {24,4,4,4}, - {20,4,4,4}, - {16,4,4,4} -}; - -unsigned short Nb_61_80[8][4] = {{72,24,12,4}, {64,32,16,4}, {60,20,4,4}, {48,24,12,4}, @@ -103,7 +66,8 @@ unsigned short Nb_61_80[8][4] = {{72,24,12,4}, {32,16,8,4} }; -unsigned short Nb_81_110[8][4] = {{96,48,24,4}, +static unsigned short msrsb_81_110[8][4] = { + {96,48,24,4}, {96,32,16,4}, {80,40,20,4}, {72,24,12,4}, diff --git a/openair1/PHY/LTE_UE_TRANSPORT/sss_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/sss_ue.c index 7087b83bca..79b20dc10c 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/sss_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/sss_ue.c @@ -31,7 +31,7 @@ */ #include "PHY/defs_UE.h" #include "transport_ue.h" -#include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "PHY/MODULATION/modulation_UE.h" //#define DEBUG_SSS @@ -44,7 +44,7 @@ int pss_ch_est(PHY_VARS_UE *ue, int32_t sss_ext[4][72]) { - int16_t *pss; + const int16_t *pss; int16_t *pss_ext2,*sss_ext2,*sss_ext3,tmp_re,tmp_im,tmp_re2,tmp_im2; uint8_t aarx,i; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c index e687ccfd04..642659f674 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/uci_tools_ue.c @@ -56,7 +56,6 @@ void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id,int N_RB_DL) switch(uci_format) { case wideband_cqi_rank1_2A: #ifdef DEBUG_UCI - LOG_D(PHY,"[PRINT CQI] flat_LA %d\n", flag_LA); switch(N_RB_DL) { case 6: LOG_I(PHY,"[PRINT CQI] wideband_cqi rank 1: eNB %d, cqi %d\n",eNB_id, diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c index f7566abebf..293ebc2a4f 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_coding.c @@ -38,6 +38,7 @@ #include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/LTE_UE_TRANSPORT/transport_ue.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" //#define DEBUG_ULSCH_CODING //#define DEBUG_ULSCH_FREE 1 diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c index 341e1e90b6..838da36289 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c @@ -38,6 +38,7 @@ #include "PHY/LTE_TRANSPORT/transport_eNB.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "PHY/LTE_REFSIG/lte_refsig.h" +#include "PHY/LTE_TRANSPORT/transport_vars.h" //#define DEBUG_ULSCH_MODULATION diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index d4ffb66b65..5a7bd8a020 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -38,7 +38,7 @@ #include "executables/softmodem-common.h" #include "nr_transport_proto_ue.h" #include "PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h" -#include "PHY/phy_extern_nr_ue.h" +#include "PHY/phy_extern.h" #include "PHY/CODING/coding_extern.h" #include "PHY/sse_intrin.h" #include "common/utils/nr/nr_common.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index d568172153..1a28d42cdc 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -29,7 +29,7 @@ * \warning */ #include "PHY/defs_nr_UE.h" -#include "PHY/phy_extern_nr_ue.h" +#include "PHY/phy_extern.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "nr_transport_proto_ue.h" #include "PHY/sse_intrin.h" diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h index 71db7df2bd..97a0046bc4 100644 --- a/openair1/PHY/phy_extern.h +++ b/openair1/PHY/phy_extern.h @@ -24,80 +24,107 @@ #include "PHY/defs_common.h" -extern char* namepointer_chMag ; -extern char* namepointer_log2; -extern char fmageren_name2[512]; - -extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; -extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; - #include "PHY/LTE_TRANSPORT/transport_vars.h" #include "PHY/defs_RU.h" -extern unsigned int DAQ_MBOX; extern int number_of_cards; -extern const short conjugate[8],conjugate2[8]; +static const short conjugate[8] __attribute__((aligned(16))) = {-1, 1, -1, 1, -1, 1, -1, 1}; +static const short conjugate2[8] __attribute__((aligned(16))) = {1, -1, 1, -1, 1, -1, 1, -1}; - -extern short primary_synch0[144]; -extern short primary_synch1[144]; -extern short primary_synch2[144]; -extern unsigned char primary_synch0_tab[72]; -extern unsigned char primary_synch1_tab[72]; -extern unsigned char primary_synch2_tab[72]; - -extern int flagMag; -//extern short **txdataF_rep_tmp; - -extern char mode_string[4][20]; +static const short primary_synch0[144] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, -26120, -19785, 11971, -30502, + -24020, -22288, 32117, 6492, 31311, 9658, -16384, -28378, 25100, -21063, -7292, -31946, 20429, 25618, 14948, 29158, + 11971, -30502, 31311, 9658, 25100, -21063, -16384, 28377, -24020, 22287, 32117, 6492, -7292, 31945, 20429, 25618, + -26120, -19785, -16384, -28378, -16384, 28377, -26120, -19785, -32402, 4883, 31311, -9659, 32117, 6492, -7292, -31946, + 32767, -1, 25100, -21063, -24020, 22287, -32402, 4883, -32402, 4883, -24020, 22287, 25100, -21063, 32767, -1, + -7292, -31946, 32117, 6492, 31311, -9659, -32402, 4883, -26120, -19785, -16384, 28377, -16384, -28378, -26120, -19785, + 20429, 25618, -7292, 31945, 32117, 6492, -24020, 22287, -16384, 28377, 25100, -21063, 31311, 9658, 11971, -30502, + 14948, 29158, 20429, 25618, -7292, -31946, 25100, -21063, -16384, -28378, 31311, 9658, 32117, 6492, -24020, -22288, + 11971, -30502, -26120, -19785, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static const short primary_synch1[144] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, -31754, -8086, -24020, -22288, + 2448, 32675, -26120, 19784, 27073, 18458, -16384, 28377, 25100, 21062, -29523, 14217, -7292, 31945, -13477, -29868, + -24020, -22288, 27073, 18458, 25100, 21062, -16384, -28378, 2448, -32676, -26120, 19784, -29523, -14218, -7292, 31945, + -31754, -8086, -16384, 28377, -16384, -28378, -31754, -8086, 31311, -9659, 27073, -18459, -26120, 19784, -29523, 14217, + 32767, -1, 25100, 21062, 2448, -32676, 31311, -9659, 31311, -9659, 2448, -32676, 25100, 21062, 32767, 0, + -29523, 14217, -26120, 19784, 27073, -18459, 31311, -9659, -31754, -8086, -16384, -28378, -16384, 28377, -31754, -8086, + -7292, 31945, -29523, -14218, -26120, 19784, 2448, -32676, -16384, -28378, 25100, 21062, 27073, 18458, -24020, -22288, + -13477, -29868, -7292, 31945, -29523, 14217, 25100, 21062, -16384, 28377, 27073, 18458, -26120, 19784, 2448, 32675, + -24020, -22288, -31754, -8086, 32767, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static const short primary_synch2[144] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, -31754, 8085, -24020, 22287, + 2448, -32676, -26120, -19785, 27073, -18459, -16384, -28378, 25100, -21063, -29523, -14218, -7292, -31946, -13477, 29867, + -24020, 22287, 27073, -18459, 25100, -21063, -16384, 28377, 2448, 32675, -26120, -19785, -29523, 14217, -7292, -31946, + -31754, 8085, -16384, -28378, -16384, 28377, -31754, 8085, 31311, 9658, 27073, 18458, -26120, -19785, -29523, -14218, + 32767, 0, 25100, -21063, 2448, 32675, 31311, 9658, 31311, 9658, 2448, 32675, 25100, -21063, 32767, 0, + -29523, -14218, -26120, -19785, 27073, 18458, 31311, 9658, -31754, 8085, -16384, 28377, -16384, -28378, -31754, 8085, + -7292, -31946, -29523, 14217, -26120, -19785, 2448, 32675, -16384, 28377, 25100, -21063, 27073, -18459, -24020, 22287, + -13477, 29867, -7292, -31946, -29523, -14218, 25100, -21063, -16384, -28378, 27073, -18459, -26120, -19785, 2448, -32676, + -24020, 22287, -31754, 8085, 32767, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; extern unsigned char NB_RU; -extern int flag_LA; -extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX]; -extern double sinr_bler_map_up[MCS_COUNT][2][16]; -extern int table_length[MCS_COUNT]; -extern const double sinr_to_cqi[4][16]; -extern const int cqi_to_mcs[16]; - -//for MU-MIMO abstraction using MIESM -//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively -extern double MI_map_4qam[3][162]; -extern double MI_map_16qam[3][197]; -extern double MI_map_64qam[3][227]; - -extern const double beta1_dlsch_MI[6][MCS_COUNT]; -extern const double beta2_dlsch_MI[6][MCS_COUNT]; - -extern const double q_qpsk[8]; -extern const double q_qam16[8]; -extern const double q_qam64[8]; -extern const double p_qpsk[8]; -extern const double p_qam16[8]; -extern const double p_qam64[8]; - -extern const double beta1_dlsch[6][MCS_COUNT]; -extern const double beta2_dlsch[6][MCS_COUNT]; - -extern const char NB_functions[7][20]; -extern const char NB_timing[2][20]; -extern const char ru_if_types[MAX_RU_IF_TYPES][20]; +static const char NB_functions[7][20] = { + "eNodeB_3GPP", + "eNodeB_3GPP_BBU", + "NGFI_RAU_IF4p5", + "NGFI_RRU_IF5", + "NGFI_RRU_IF4p5", + "gNodeB_3GPP", +}; +static const char NB_timing[2][20] = {"synch_to_ext_device", "synch_to_other"}; +static const char ru_if_types[MAX_RU_IF_TYPES][20] = {"local RF", "IF5 RRU", "IF5 Mobipass", "IF4p5 RRU", "IF1pp RRU"}; extern int16_t unscrambling_lut[65536*16]; extern uint8_t scrambling_lut[65536*16]; -extern unsigned short msrsb_6_40[8][4]; -extern unsigned short msrsb_41_60[8][4]; -extern unsigned short msrsb_61_80[8][4]; -extern unsigned short msrsb_81_110[8][4]; -extern unsigned short Nb_6_40[8][4]; -extern unsigned short Nb_41_60[8][4]; -extern unsigned short Nb_61_80[8][4]; -extern unsigned short Nb_81_110[8][4]; +static const unsigned short Nb_6_40[8][4] = { + {36,12,4,4}, + {32,16,8,4}, + {24,4,4,4}, + {20,4,4,4}, + {16,4,4,4}, + {12,4,4,4}, + {8,4,4,4}, + {4,4,4,4} +}; +static const unsigned short Nb_41_60[8][4] = { + {48,24,12,4}, + {48,16,8,4}, + {40,20,4,4}, + {36,12,4,4}, + {32,16,8,4}, + {24,4,4,4}, + {20,4,4,4}, + {16,4,4,4} +}; +static const unsigned short Nb_61_80[8][4] = { + {72,24,12,4}, + {64,32,16,4}, + {60,20,4,4}, + {48,24,12,4}, + {48,16,8,4}, + {40,20,4,4}, + {36,12,4,4}, + {32,16,8,4} +}; +static const unsigned short Nb_81_110[8][4] = { + {96,48,24,4}, + {96,32,16,4}, + {80,40,20,4}, + {72,24,12,4}, + {64,32,16,4}, + {60,20,4,4}, + {48,24,12,4}, + {48,16,8,4} +}; + +static const uint8_t alpha_lut[8] = {0, 40, 50, 60, 70, 80, 90, 100}; -extern uint8_t alpha_lut[8]; extern uint8_t max_turbo_iterations; +extern double cpuf; + #endif /*__PHY_EXTERN_H__ */ diff --git a/openair1/PHY/phy_extern_nr_ue.h b/openair1/PHY/phy_extern_nr_ue.h index 4701a16012..98765730bb 100644 --- a/openair1/PHY/phy_extern_nr_ue.h +++ b/openair1/PHY/phy_extern_nr_ue.h @@ -23,90 +23,7 @@ #define __PHY_EXTERN_NR_UE__H__ #include "PHY/defs_nr_UE.h" -//#include "common/ran_context.h" - -#ifdef XFORMS - #include "PHY/TOOLS/nr_phy_scope.h" - extern uint32_t do_forms; -#endif - -extern char* namepointer_chMag ; -extern char* namepointer_log2; -extern char fmageren_name2[512]; - -extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; -extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; - -extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; -extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; - -extern const short conjugate[8],conjugate2[8]; -extern int number_of_cards; - - extern PHY_VARS_NR_UE ***PHY_vars_UE_g; -extern short primary_synch0[144]; -extern short primary_synch1[144]; -extern short primary_synch2[144]; -extern unsigned char primary_synch0_tab[72]; -extern unsigned char primary_synch1_tab[72]; -extern unsigned char primary_synch2_tab[72]; -extern int16_t *primary_synch0_time; //!< index: [0..ofdm_symbol_size*2[ -extern int16_t *primary_synch1_time; //!< index: [0..ofdm_symbol_size*2[ -extern int16_t *primary_synch2_time; //!< index: [0..ofdm_symbol_size*2[ - -extern int flagMag; -//extern short **txdataF_rep_tmp; - -extern char mode_string[4][20]; - -extern unsigned char NB_RU; - -extern int flag_LA; -extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX]; -extern double sinr_bler_map_up[MCS_COUNT][2][16]; -extern int table_length[MCS_COUNT]; -extern const double sinr_to_cqi[4][16]; -extern const int cqi_to_mcs[16]; - -//for MU-MIMO abstraction using MIESM -//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively -extern double MI_map_4qam[3][162]; -extern double MI_map_16qam[3][197]; -extern double MI_map_64qam[3][227]; - -extern const double beta1_dlsch_MI[6][MCS_COUNT]; -extern const double beta2_dlsch_MI[6][MCS_COUNT]; - -extern const double q_qpsk[8]; -extern const double q_qam16[8]; -extern const double q_qam64[8]; - -extern const double beta1_dlsch[6][MCS_COUNT]; -extern const double beta2_dlsch[6][MCS_COUNT]; - -extern const char NB_functions[7][20]; -extern const char NB_timing[2][20]; -extern const char ru_if_types[MAX_RU_IF_TYPES][20]; - -extern int16_t unscrambling_lut[65536*16]; -extern uint8_t scrambling_lut[65536*16]; - -extern unsigned short msrsb_6_40[8][4]; -extern unsigned short msrsb_41_60[8][4]; -extern unsigned short msrsb_61_80[8][4]; -extern unsigned short msrsb_81_110[8][4]; -extern unsigned short Nb_6_40[8][4]; -extern unsigned short Nb_41_60[8][4]; -extern unsigned short Nb_61_80[8][4]; -extern unsigned short Nb_81_110[8][4]; - -extern uint16_t hundred_times_log10_NPRB[100]; -extern uint8_t alpha_lut[8]; -extern uint8_t max_turbo_iterations; - -extern double cpuf; - #endif /*__PHY_EXTERN_H__ */ diff --git a/openair1/PHY/phy_extern_ue.h b/openair1/PHY/phy_extern_ue.h index 0249ed0147..dd4740e27a 100644 --- a/openair1/PHY/phy_extern_ue.h +++ b/openair1/PHY/phy_extern_ue.h @@ -24,79 +24,9 @@ #include "PHY/defs_UE.h" -extern char* namepointer_chMag ; -extern char* namepointer_log2; -extern char fmageren_name2[512]; - -extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX]; -extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; - -#include "PHY/LTE_TRANSPORT/transport_vars.h" - -extern int number_of_cards; - -extern const short conjugate[8],conjugate2[8]; - - extern PHY_VARS_UE ***PHY_vars_UE_g; -extern short primary_synch0[144]; -extern short primary_synch1[144]; -extern short primary_synch2[144]; -extern unsigned char primary_synch0_tab[72]; -extern unsigned char primary_synch1_tab[72]; -extern unsigned char primary_synch2_tab[72]; - -extern int flagMag; -//extern short **txdataF_rep_tmp; - -extern char mode_string[4][20]; - - -extern int flag_LA; -extern double sinr_bler_map[MCS_COUNT][2][MCS_TABLE_LENGTH_MAX]; -extern double sinr_bler_map_up[MCS_COUNT][2][16]; -extern int table_length[MCS_COUNT]; -extern const double sinr_to_cqi[4][16]; -extern const int cqi_to_mcs[16]; - -//for MU-MIMO abstraction using MIESM -//this 2D arrarays contains SINR, MI and RBIR in rows 1, 2, and 3 respectively -extern double MI_map_4qam[3][162]; -extern double MI_map_16qam[3][197]; -extern double MI_map_64qam[3][227]; - -extern const double beta1_dlsch_MI[6][MCS_COUNT]; -extern const double beta2_dlsch_MI[6][MCS_COUNT]; - -extern const double q_qpsk[8]; -extern const double q_qam16[8]; -extern const double q_qam64[8]; - -extern const double p_qpsk[8]; -extern const double p_qam16[8]; -extern const double p_qam64[8]; - -extern const double beta1_dlsch[6][MCS_COUNT]; -extern const double beta2_dlsch[6][MCS_COUNT]; - -extern const char NB_functions[7][20]; -extern const char NB_timing[2][20]; -extern const char ru_if_types[MAX_RU_IF_TYPES][20]; - -extern int16_t unscrambling_lut[65536*16]; -extern uint8_t scrambling_lut[65536*16]; - -extern unsigned short msrsb_6_40[8][4]; -extern unsigned short msrsb_41_60[8][4]; -extern unsigned short msrsb_61_80[8][4]; -extern unsigned short msrsb_81_110[8][4]; -extern unsigned short Nb_6_40[8][4]; -extern unsigned short Nb_41_60[8][4]; -extern unsigned short Nb_61_80[8][4]; -extern unsigned short Nb_81_110[8][4]; - -extern uint8_t alpha_lut[8]; extern uint8_t max_turbo_iterations; + #endif /*__PHY_EXTERN_H__ */ diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h index b1899639fb..89063c5be2 100644 --- a/openair1/PHY/phy_vars.h +++ b/openair1/PHY/phy_vars.h @@ -22,104 +22,18 @@ #ifndef __PHY_VARS_H__ #define __PHY_VARS_H__ -#include "PHY/types.h" -#include "PHY/defs_eNB.h" -#include "PHY/defs_gNB.h" #include "PHY/defs_UE.h" -char* namepointer_chMag ; -char fmageren_name2[512]; -char* namepointer_log2; - - -#include "PHY/LTE_REFSIG/primary_synch.h" - -#include "PHY/LTE_TRANSPORT/transport_vars.h" - -#include "nfapi/oai_integration/vendor_ext.h" +#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" +#include "openair2/PHY_INTERFACE/IF_Module.h" PHY_VARS_UE ***PHY_vars_UE_g; UL_RCC_IND_t UL_RCC_INFO; NR_UL_IND_t UL_INFO; -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} -}; - -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; - -//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))); - uint8_t max_turbo_iterations=4; + #endif /*__PHY_VARS_H__ */ diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h index 99b22ab69d..2201091270 100644 --- a/openair1/PHY/phy_vars_nr_ue.h +++ b/openair1/PHY/phy_vars_nr_ue.h @@ -22,16 +22,8 @@ #ifndef __PHY_VARS_NR_UE_H__ #define __PHY_VARS_NR_UE_H__ -#include "PHY/types.h" #include "PHY/defs_nr_UE.h" -#include "common/ran_context.h" - PHY_VARS_NR_UE ***PHY_vars_UE_g; -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}; - -const char ru_if_types[MAX_RU_IF_TYPES][20]={"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"}; - #endif diff --git a/openair1/PHY/phy_vars_ue.h b/openair1/PHY/phy_vars_ue.h index 92a135b44e..12f49d6b0a 100644 --- a/openair1/PHY/phy_vars_ue.h +++ b/openair1/PHY/phy_vars_ue.h @@ -22,95 +22,11 @@ #ifndef __PHY_VARS_UE__H__ #define __PHY_VARS_UE__H__ -#include "PHY/types.h" #include "PHY/defs_UE.h" -#include "common/ran_context.h" - -char *namepointer_chMag ; -char fmageren_name2[512]; -char *namepointer_log2; - - -#include "PHY/LTE_REFSIG/primary_synch.h" - PHY_VARS_UE ***PHY_vars_UE_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}; - 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} -}; - -const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; - -//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))); - uint8_t max_turbo_iterations=4; + #endif /* __PHY_VARS_UE__H__ */ diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index 7cff63b4bb..47ab3c7a91 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -68,7 +68,7 @@ #define NS_PER_SLOT 500000 -char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; +static const char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; extern double cpuf; diff --git a/openair1/SCHED_UE/pusch_pc.c b/openair1/SCHED_UE/pusch_pc.c index 55c8c7c547..831007c138 100644 --- a/openair1/SCHED_UE/pusch_pc.c +++ b/openair1/SCHED_UE/pusch_pc.c @@ -35,6 +35,7 @@ #include "PHY/defs_UE.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "nfapi/oai_integration/vendor_ext.h" @@ -62,8 +63,6 @@ int16_t get_hundred_times_delta_IF(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t harq_p -uint8_t alpha_lut[8] = {0,40,50,60,70,80,90,100}; - void pusch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag) { uint8_t harq_pid = subframe2harq_pid(&ue->frame_parms, proc->frame_tx, diff --git a/openair1/SCHED_UE/srs_pc.c b/openair1/SCHED_UE/srs_pc.c index 8026eb8307..ad3cde7609 100644 --- a/openair1/SCHED_UE/srs_pc.c +++ b/openair1/SCHED_UE/srs_pc.c @@ -33,6 +33,7 @@ #include "PHY/defs_UE.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "openair1/SCHED/sched_common_extern.h" diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 05e4273577..dc83ce57bf 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -54,6 +54,7 @@ #include "executables/lte-softmodem.h" #include "common/ran_context.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" +#include "openair1/PHY/LTE_TRANSPORT/dlsch_tbs.h" const char *__asan_default_options() { @@ -69,10 +70,8 @@ channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX]; node_desc_t *enb_data[NUMBER_OF_eNB_MAX]; node_desc_t *ue_data[NUMBER_OF_UE_MAX]; -//double sinr_bler_map[MCS_COUNT][2][16]; extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16]; -//extern char* namepointer_chMag ; THREAD_STRUCT thread_struct; nfapi_ue_release_request_body_t release_rntis; @@ -1005,14 +1004,11 @@ int main(int argc, char **argv) { if (abstx) { if (trials==0 && round==0 && SNR==snr0) { //generate a new channel hold_channel = 0; - flagMag=0; } else { hold_channel = 1; - flagMag = 1; } } else { hold_channel = 0; - flagMag=1; } /////////////////////////////////////// diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index c958d7cf85..c1f9a51335 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -162,6 +162,8 @@ #define U_PLANE_INACTIVITY_VALUE 0 /* defined 10ms order (zero means infinity) */ +static const int cqi_to_mcs[16]= {0, 0, 1, 2, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 27, 28}; + /* * eNB part */ From cd8df70e5c46dbbcc5435cea861c24cd19429249 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 31 Jan 2023 14:47:30 +0100 Subject: [PATCH 03/13] Do not spill LTE/NR ASN.1 RRC all over: clean up platform_constants.h --- CMakeLists.txt | 5 --- common/platform_constants.h | 61 +++---------------------------------- 2 files changed, 5 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9061f2f71c..0fbcaabec4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -655,11 +655,6 @@ add_boolean_option(NAS_BUILT_IN_UE True "UE NAS layer present in this e add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)" ON) -########################## -# ACCESS STRATUM LAYER2 OPTIONS -########################## -add_boolean_option(JUMBO_FRAME True "ENABLE LARGE SDU in ACCESS STRATUM (larger than common MTU)" ON) - ########################## # PDCP LAYER OPTIONS ########################## diff --git a/common/platform_constants.h b/common/platform_constants.h index 38ec11d49e..c33ae37742 100644 --- a/common/platform_constants.h +++ b/common/platform_constants.h @@ -19,26 +19,11 @@ * contact@openairinterface.org */ -/* - platform_constants.h - ------------------- - AUTHOR : Lionel GAUTHIER and Navid Nikaein - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - - ***************************************************************************/ #ifndef __PLATFORM_CONSTANTS_H__ #define __PLATFORM_CONSTANTS_H__ -#include "LTE_asn_constant.h" -#include "NR_asn_constant.h" -#define NR_MAXDRB 14 -#ifdef JUMBO_FRAME #define NL_MAX_PAYLOAD 18000 /* this should cover the max mtu size*/ -#else -#define NL_MAX_PAYLOAD 9000 /* this should cover the max mtu size*/ -#endif #ifdef LARGE_SCALE #define NB_MODULES_MAX 128 @@ -48,19 +33,7 @@ #define NB_NODE_MAX 32 #endif -#ifdef JUMBO_FRAME #define MAX_IP_PACKET_SIZE 10000 // 9000 -#else -#if defined(OAI_NW_DRIVER_TYPE_ETHERNET) -/* SR: When using ethernet network driver the packet size is 1512 : - * 1500 bytes IP packet + 14 bytes ethernet header - */ -#define MAX_IP_PACKET_SIZE 1514 -#else -#define MAX_IP_PACKET_SIZE 1500 // 3000 -#endif -#endif -// overwrite the previous deinitions #define MAX_MODULES NB_MODULES_MAX #define MAX_NR_RRC_UE_CONTEXTS 64 @@ -89,47 +62,26 @@ #define MAX_MANAGED_GNB_PER_MOBILE 2 /// NB-IOT -#define NB_RB_MAX_NB_IOT (LTE_maxDRB_NB_r13 + 3) // MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5 +#define NB_RB_MAX_NB_IOT (2 + 3) /* 2 from LTE_maxDRB_NB_r13 in LTE_asn_constant.h + 3 SRBs */ #define DEFAULT_RAB_ID 1 -#define NB_RB_MAX (LTE_maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */ -#define NR_NB_RB_MAX (NR_maxDRB + 3) +#define NB_RB_MAX (11 + 3) /* LTE_maxDRB from LTE_asn_constant.h + 3 SRBs */ +#define NR_NB_RB_MAX (29 + 3) /* NR_maxDRB from NR_asn_constant.hm + 3 SRBs */ #define NGAP_MAX_PDU_SESSION (256) /* As defined in TS 38.413 9.2.1.1 Range Bound for PDU Sessions. */ #define NGAP_MAX_DRBS_PER_UE (32) /* As defined in TS 38.413 9.2.1.1 - maxnoofDRBs */ -#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH * LTE_maxServiceCount) +#define NB_RB_MBMS_MAX (29 * 16) /* 29 = LTE_maxSessionPerPMCH + 16 = LTE_maxServiceCount from LTE_asn_constant.h */ -#define NB_RAB_MAX LTE_maxDRB /* was 8, now 11 */ -#define RAB_SHIFT1 9 -#define RAB_SHIFT2 3 -//#define RAB_OFFSET 0x0007 +#define NB_RAB_MAX 11 /* from LTE_maxDRB in LTE_asn_constant.h */ #define RAB_OFFSET 0x000F -#define RAB_OFFSET1 0x7E00 -#define RAB_OFFSET2 0x01F8 -#define DIR_OFFSET 0x8000 -#define DIR_SHIFT 15 -#define CH_OFFSET 0x0004 -#define CH_SHIFT 2 // RLC Entity #define RLC_TX_MAXSIZE 10000000 #define RLC_RX_MAXSIZE 10000000 - -// RLC_AM_SEND_MRW -#define SEND_MRW_OFF 15 #define SEND_MRW_ON 240 -// RLC_SEGMENTATION_INDICATION -#define SEGMENTATION_NOT_ALLOWED 0 -#define SEGMENTATION_ALLOWED 1 - -// RLC_DELIVERY_OF_ERRONEOUS_SDU -#define DELIVERY_OF_ERRONEOUS_SDU_NO 0 -#define DELIVERY_OF_ERRONEOUS_SDU_YES 1 -#define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 2 - // CBA constant #define NUM_MAX_CBA_GROUP 4 @@ -142,9 +94,6 @@ #endif #endif -#define UNUSED_PARAM_MBMS_SESSION_ID 0 -#define UNUSED_PARAM_MBMS_SERVICE_ID 0 - #define printk printf #define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE) From 035b5bb6651a92fb4e6a070a9c619ce87c19ea31 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Feb 2023 16:58:23 +0100 Subject: [PATCH 04/13] Remove definition of null --- common/platform_constants.h | 9 --------- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/common/platform_constants.h b/common/platform_constants.h index c33ae37742..8fc8d9c237 100644 --- a/common/platform_constants.h +++ b/common/platform_constants.h @@ -85,15 +85,6 @@ // CBA constant #define NUM_MAX_CBA_GROUP 4 -#ifndef __cplusplus -#ifndef NULL -#define NULL 0 -#endif -#ifndef null -#define null 0 -#endif -#endif - #define printk printf #define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index e7a690b7c1..c1b393ba88 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -478,7 +478,7 @@ uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, UL->initialUplinkBWP.genericParameters = configuration->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; UL->initialUplinkBWP.rach_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon; UL->initialUplinkBWP.pusch_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon; - UL->initialUplinkBWP.pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = null; + UL->initialUplinkBWP.pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = NULL; UL->initialUplinkBWP.pucch_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon; From f30185bc0e73a5ddb69f0825f5a7ad920b42d881 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 28 Feb 2023 11:23:51 +0100 Subject: [PATCH 05/13] Add license header to file without license --- nfapi/oai_integration/gnb_ind_vars.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nfapi/oai_integration/gnb_ind_vars.c b/nfapi/oai_integration/gnb_ind_vars.c index 148c28a5c4..f1f22bcc66 100644 --- a/nfapi/oai_integration/gnb_ind_vars.c +++ b/nfapi/oai_integration/gnb_ind_vars.c @@ -1,3 +1,24 @@ +/* + * 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 + */ + #include "gnb_ind_vars.h" queue_t gnb_rach_ind_queue; From 8a15fb7c637b510f64f85b121f2ab118f76b6db0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Mar 2023 11:51:21 +0100 Subject: [PATCH 06/13] RC: forward declarations and link physims better The simulators have been changed: due to linker errors that would arise otherwise, a lot of functions are defined in them to avoid such errors. Some functions are also defined in header files; in this commit, we define most functoins in nr_dummy_functions.c, which is compiled in, not by including the C file, but by adding it to the target in CMakeLists.txt - nr_dlsim+nr_ulsim need NR_IF_Module_init(), so it cannot be in nr_dummy_functions, but the others need it - Link correcr NR_IF_Module_init() into these simulators, and reduce overall link list - Correctly link remaining simulators --- CMakeLists.txt | 23 ++-- common/ran_context.h | 23 ++-- .../telnetsrv/telnetsrv_enb_measurements.c | 2 + common/utils/telnetsrv/telnetsrv_enb_phycmd.c | 4 + executables/lte-softmodem.c | 1 + executables/lte-uesoftmodem.c | 1 + executables/nr-cuup.c | 2 +- executables/nr-softmodem.c | 1 + executables/nr-ue.c | 1 + executables/nr-uesoftmodem.c | 1 + .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.h | 2 + openair1/SCHED/fapi_l1.c | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 2 - openair1/SCHED_NR/nr_prach_procedures.c | 2 - openair1/SCHED_NR/phy_procedures_nr_gNB.c | 3 +- openair1/SCHED_NR/sched_nr.h | 1 - openair1/SIMULATION/NR_PHY/dlschsim.c | 11 +- openair1/SIMULATION/NR_PHY/dlsim.c | 71 +--------- .../SIMULATION/NR_PHY/nr_dummy_functions.c | 122 ++++++------------ .../NR_PHY/nr_dummy_functions_prach.c | 20 --- openair1/SIMULATION/NR_PHY/nr_unitary_defs.h | 7 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 19 ++- openair1/SIMULATION/NR_PHY/prachsim.c | 55 +------- openair1/SIMULATION/NR_PHY/pucchsim.c | 7 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 9 +- openair1/SIMULATION/NR_PHY/ulsim.c | 53 -------- openair2/E1AP/e1ap.c | 1 + openair2/F1AP/f1ap_cu_rrc_message_transfer.c | 1 + openair2/F1AP/f1ap_cu_ue_context_management.c | 1 + openair2/GNB_APP/gnb_config.c | 1 + openair2/LAYER2/MAC/pre_processor.c | 1 + openair2/LAYER2/NR_MAC_UE/config_ue.c | 1 + openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 3 + openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 + .../LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c | 1 + openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c | 1 + openair2/LAYER2/NR_MAC_gNB/main.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 + openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 1 + openair2/NR_PHY_INTERFACE/NR_IF_Module.h | 1 + openair2/RRC/LTE/rrc_UE.c | 4 + openair2/RRC/LTE/rrc_eNB.c | 6 + openair2/RRC/LTE/rrc_eNB_GTPV1U.c | 1 + openair2/RRC/LTE/rrc_eNB_GTPV1U.h | 1 + openair2/RRC/LTE/rrc_eNB_M2AP.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 1 + openair2/X2AP/x2ap_eNB_defs.h | 2 + 49 files changed, 163 insertions(+), 318 deletions(-) delete mode 100644 openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fbcaabec4..cddfc7ddeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2444,8 +2444,8 @@ target_link_libraries(ldpctest PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_dlschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -2457,6 +2457,7 @@ target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_pbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} @@ -2471,8 +2472,8 @@ target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc asn1_lte_rrc) #PUCCH ---> Prashanth add_executable(nr_pucchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -2484,41 +2485,39 @@ target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_dlsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c + ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) target_link_libraries(nr_dlsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/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 - ${NFAPI_USER_DIR}/nfapi.c - ${PHY_INTERFACE_DIR}/queue_t.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES}) target_link_libraries(nr_prachsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl) target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_ulschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${PHY_INTERFACE_DIR}/queue_t.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} @@ -2531,12 +2530,14 @@ target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_ulsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c + ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c + ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} @@ -2547,7 +2548,7 @@ if (ENABLE_LDPC_T1) endif() target_link_libraries(nr_ulsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON lte_rrc nr_rrc CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE x2ap SECU_CN ngap NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc asn1_lte_rrc) diff --git a/common/ran_context.h b/common/ran_context.h index 320d431e73..244e6fd30d 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -34,17 +34,18 @@ #define __RAN_CONTEXT_H__ #include -#include "common/platform_constants.h" -#include "PHY/defs_eNB.h" -#include "PHY/types.h" -#include "PHY/impl_defs_top.h" - -#include "PHY/defs_L1_NB_IoT.h" -#include "RRC/LTE/defs_NB_IoT.h" -#include "RRC/LTE/rrc_defs.h" -#include "RRC/NR/nr_rrc_defs.h" -#include +#include +// forward declarations to avoid including the full typess ***eNB; +struct PHY_VARS_gNB_s; +struct PHY_VARS_eNB_NB_IoT_s; +struct eNB_RRC_INST_s; +struct gNB_RRC_INST_s; +struct eNB_MAC_INST_s; +struct eNB_MAC_INST_NB_IoT_s; +struct gNB_MAC_INST_s; +struct gtpv1u_data_s; +struct RU_t_s; typedef struct { /// RAN context config file name @@ -98,7 +99,7 @@ typedef struct { /// NR MAC context variables struct gNB_MAC_INST_s **nrmac; /// GTPu descriptor - gtpv1u_data_t *gtpv1u_data_g; + struct gtpv1u_data_s *gtpv1u_data_g; /// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces struct RU_t_s **ru; /// Mask to indicate fronthaul setup status of RU (hard-limit to 64 RUs) diff --git a/common/utils/telnetsrv/telnetsrv_enb_measurements.c b/common/utils/telnetsrv/telnetsrv_enb_measurements.c index b3f52a5e27..b8898b665e 100644 --- a/common/utils/telnetsrv/telnetsrv_enb_measurements.c +++ b/common/utils/telnetsrv/telnetsrv_enb_measurements.c @@ -51,6 +51,8 @@ #include "telnetsrv_cpumeasur_def.h" #include "openair2/LAYER2/MAC/mac.h" #include "openair1/PHY/phy_extern.h" +#include "openair2/LAYER2/RLC/rlc.h" +#include "openair2/LAYER2/PDCP_v10.1.0/pdcp.c" void measurcmd_display_macstats(telnet_printfunc_t prnt); void measurcmd_display_macstats_ue(telnet_printfunc_t prnt); diff --git a/common/utils/telnetsrv/telnetsrv_enb_phycmd.c b/common/utils/telnetsrv/telnetsrv_enb_phycmd.c index f7deec1801..f3b40980f1 100644 --- a/common/utils/telnetsrv/telnetsrv_enb_phycmd.c +++ b/common/utils/telnetsrv/telnetsrv_enb_phycmd.c @@ -38,6 +38,10 @@ #include "telnetsrv.h" #define TELNETSRV_PHYCMD_MAIN #include "telnetsrv_phycmd.h" + +#include "PHY/defs_eNB.h" +#include "LAYER2/MAC/mac_proto.h" + char *prnbuff; extern int dump_eNB_stats(PHY_VARS_eNB *eNB, char *buffer, int length); diff --git a/executables/lte-softmodem.c b/executables/lte-softmodem.c index 7c25548349..db9912a05e 100644 --- a/executables/lte-softmodem.c +++ b/executables/lte-softmodem.c @@ -77,6 +77,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "create_tasks.h" +#include "pdcp.h" #include "PHY/INIT/phy_init.h" diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c index 04358c7ec9..2193d59b07 100644 --- a/executables/lte-uesoftmodem.c +++ b/executables/lte-uesoftmodem.c @@ -39,6 +39,7 @@ #include "assertions.h" #include "PHY/types.h" +#include "pdcp.h" #include "PHY/defs_UE.h" #include "common/ran_context.h" diff --git a/executables/nr-cuup.c b/executables/nr-cuup.c index 14fff00a70..800e18d537 100644 --- a/executables/nr-cuup.c +++ b/executables/nr-cuup.c @@ -28,6 +28,7 @@ #include "nfapi/oai_integration/vendor_ext.h" #include "openair2/F1AP/f1ap_common.h" #include "openair2/GNB_APP/gnb_config.h" +#include "pdcp.h" RAN_CONTEXT_t RC; THREAD_STRUCT thread_struct; @@ -36,7 +37,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; int asn1_xer_print; int oai_exit = 0; instance_t CUuniqInstance = 0; -RRC_release_list_t rrc_release_info; void exit_function(const char *file, const char *function, const int line, const char *s) { diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 7d75dfbe36..cfaea4b9c0 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -59,6 +59,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" +#include "pdcp.h" #include "intertask_interface.h" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 61e12a158f..bcbc57e07a 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -33,6 +33,7 @@ #include "executables/softmodem-common.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "radio/COMMON/common_lib.h" +#include "pdcp.h" /* * NR SLOT PROCESSING SEQUENCE diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index d64d2cdb2e..887ce75958 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -59,6 +59,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "UTIL/OPT/opt.h" #include "enb_config.h" +#include "pdcp.h" #include "intertask_interface.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h index 5feea8d9ce..803aada84a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h @@ -33,6 +33,8 @@ #ifndef SRS_MODULATION_NR_H #define SRS_MODULATION_NR_H +#include "PHY/defs_nr_UE.h" + #ifdef DEFINE_VARIABLES_SRS_MODULATION_NR_H #define EXTERN #define INIT_VARIABLES_SRS_MODULATION_NR_H diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index f7aa81c199..7dfd14c158 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -1014,7 +1014,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, void *arg) { UL_req->ul_config_request_body.number_of_pdus=0; number_ul_pdu=0; }else if (RC.mac[Mod_id]->scheduler_mode == SCHED_MODE_FAIR_RR) { - if(ulsch_pdu_num <= RC.rrc[Mod_id]->configuration.radioresourceconfig[CC_id].ue_multiple_max){ + if(ulsch_pdu_num <= fp->ue_multiple_max){ UL_req->sfn_sf = frame << 4 | subframe; oai_nfapi_ul_config_req(UL_req); UL_req->ul_config_request_body.number_of_pdus=0; diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 3d2226b3c3..e48d9f30a4 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -46,8 +46,6 @@ #include -#include "intertask_interface.h" - #include "common/ran_context.h" extern RAN_CONTEXT_t RC; diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 9aca5b48e1..b0167dce9e 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -43,8 +43,6 @@ #include -#include "intertask_interface.h" - extern uint8_t nfapi_mode; uint8_t get_nr_prach_duration(uint8_t prach_format){ diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 6a1a8f7b36..d372bd36b7 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -38,13 +38,12 @@ #include "executables/nr-softmodem.h" #include "executables/softmodem-common.h" #include "nfapi/oai_integration/vendor_ext.h" +#include "NR_SRS-ResourceSet.h" #include "assertions.h" #include -#include "intertask_interface.h" - //#define DEBUG_RXDATA //#define SRS_IND_DEBUG diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 909459f652..eb9a790e45 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -29,7 +29,6 @@ #define __openair_SCHED_NR_DEFS_H__ #include "PHY/defs_gNB.h" -#include "PHY_INTERFACE/phy_interface.h" #include "PHY/NR_TRANSPORT/nr_dci.h" #include "phy_frame_config_nr.h" diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index f5de60a297..94d712d185 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -46,10 +46,9 @@ #include "openair1/SIMULATION/TOOLS/sim.h" #include "openair1/SIMULATION/RF/rf.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" -#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h" #include "executables/nr-uesoftmodem.h" - +#include "nfapi/oai_integration/vendor_ext.h" //#define DEBUG_NR_DLSCHSIM @@ -73,8 +72,14 @@ PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } }; uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; +uint64_t get_softmodem_optmask(void) {return 0;} +static softmodem_params_t softmodem_params; +softmodem_params_t *get_softmodem_params(void) { + return &softmodem_params; +} void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} - +NR_IF_Module_t *NR_IF_Module_init(int Mod_id) { return (NULL); } +nfapi_mode_t nfapi_getmode(void) { return NFAPI_MODE_UNKNOWN; } nrUE_params_t nrUE_params={0}; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index ed171523de..259883ed45 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -89,7 +89,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; char *uecap_file; -uint16_t sf_ahead=4 ; uint16_t sl_ahead=0; //uint8_t nfapi_mode = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; @@ -104,21 +103,7 @@ int nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t return 0; } -// dummy functions -int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); } - -int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, - const int CC_id, - const uint8_t gNB_index, - const frame_t frame, - const sub_frame_t sub_frame, - const rnti_t rnti, - const channel_t channel, - const uint8_t* pduP, - const sdu_size_t pdu_len) -{ - return 0; -} +int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); } void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index) { @@ -135,70 +120,16 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP, return 0; } -void -rrc_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const rb_id_t Srb_id, - const sdu_size_t sdu_sizeP, - const uint8_t *const buffer_pP -) -{ -} - int nr_derive_key(int alg_type, uint8_t alg_id, const uint8_t key[32], uint8_t **out) { return 0; } -void config_common(int Mod_idP, - int pdsch_AntennaPorts, - int pusch_AntennaPorts, - NR_ServingCellConfigCommon_t *scc); - -int generate_dlsch_header(unsigned char *mac_header, - unsigned char num_sdus, - unsigned short *sdu_lengths, - unsigned char *sdu_lcids, - unsigned char drx_cmd, - unsigned short timing_advance_cmd, - unsigned char *ue_cont_res_id, - unsigned char short_padding, - unsigned short post_padding){return 0;} - -// Dummy function to avoid linking error at compilation of nr-dlsim -int is_x2ap_enabled(void) -{ - return 0; -} - -int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, - int CC_idP, - int UE_id, - rnti_t rntiP, - const uint8_t *sduP, - sdu_size_t sdu_lenP, - const uint8_t *sdu2P, - sdu_size_t sdu2_lenP) { - return 0; -} - void processSlotTX(void *arg) {} nr_bler_struct nr_bler_data[NR_NUM_MCS]; -//nFAPI P7 dummy functions to avoid linking errors - -int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } -int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); } -int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); } -int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); } -int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { return(0); } -int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); } -int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); } -int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); } -int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); } - // needed for some functions openair0_config_t openair0_cfg[MAX_CARDS]; void update_ptrs_config(NR_CellGroupConfig_t *secondaryCellGroup, uint16_t *rbSize, uint8_t *mcsIndex,int8_t *ptrs_arg); diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c index dd5082d756..5a1c2be6e8 100644 --- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c +++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c @@ -1,89 +1,45 @@ #include "nfapi/oai_integration/vendor_ext.h" +#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h" +#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" +#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" +#include "openair1/PHY/defs_nr_UE.h" -int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); } -int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); } -int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); } -//int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } -int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) -{ - return (0); -} -int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req) -{ - return (0); -} -int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req) -{ - return (0); -} -int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req) -{ - return (0); -} -int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) -{ - return (0); -} -int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) -{ - return (0); -} -int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) -{ - return (0); -} -int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) -{ - return (0); -} -int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) -{ - return (0); -} +int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return (0); } +int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req) { return (0); } +int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req) { return (0); } +int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req) { return (0); } +int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return (0); } +int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return (0); } +int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return (0); } +int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return (0); } +int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { return 0; } -int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) -{ - return 0; -} -int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) -{ - return 0; -} +int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { return 0; } +int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; } +int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { return 0; } +int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; } -int32_t get_uldl_offset(int nr_bandP) -{ - return (0); -} -NR_IF_Module_t *NR_IF_Module_init(int Mod_id) -{ - return (NULL); -} -nfapi_mode_t nfapi_mod; -nfapi_mode_t nfapi_getmode(void) -{ - return nfapi_mod; -} -void nfapi_setmode(nfapi_mode_t nfapi_mode) -{ -} +int32_t get_uldl_offset(int nr_bandP) { return (0); } -int dummy_nr_ue_dl_indication(nr_downlink_indication_t *dl_info) -{ - return (0); -} -int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); } -void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, - fapi_nr_dci_indication_t *dci_ind, - fapi_nr_rx_indication_t *rx_ind, - UE_nr_rxtx_proc_t *proc, - PHY_VARS_NR_UE *ue, - void *phy_data) {} -void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, - uint8_t pdu_type, - PHY_VARS_NR_UE *ue, - NR_UE_DLSCH_t *dlsch0, - NR_UE_DLSCH_t *dlsch1, - uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc, - void *typeSpecific ) {} +void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {} +void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {} +int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config) { return 0; } +int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config) { return 0; } +int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { return 0; } + +void rrc_data_ind(const protocol_ctxt_t *const ctxt_pP, + const rb_id_t Srb_id, + const sdu_size_t sdu_sizeP, + const uint8_t *const buffer_pP) { } + +typedef uint32_t channel_t; +int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, + const int CC_id, + const uint8_t gNB_index, + const frame_t frame, + const sub_frame_t sub_frame, + const rnti_t rnti, + const channel_t channel, + const uint8_t* pduP, + const sdu_size_t pdu_len) { return 0; } diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c deleted file mode 100644 index 71e2577ec3..0000000000 --- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c +++ /dev/null @@ -1,20 +0,0 @@ -int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); } -int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); } -int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); } -int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } -int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } -int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); } -int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); } -int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); } -int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { return(0); } -int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); } -int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); } -int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); } -int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); } - -int32_t get_uldl_offset(int nr_bandP) { return(0); } -NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return(NULL);} -int dummy_nr_ue_dl_indication(nr_downlink_indication_t *dl_info) { return(0); } -int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); } - - diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h index c556f66361..b15aaccf11 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h @@ -33,6 +33,9 @@ #ifndef __NR_UNITARY_DEFS__H__ #define __NR_UNITARY_DEFS__H__ +#include "NR_ServingCellConfigCommon.h" +#include "NR_ServingCellConfig.h" + int oai_exit=0; void exit_function(const char* file, const char* function, const int line, const char *s) { @@ -64,9 +67,5 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap); void prepare_scc(NR_ServingCellConfigCommon_t *scc); void prepare_scd(NR_ServingCellConfig_t *scd); uint32_t ngap_generate_gNB_id(void) {return 0;} -void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;} -void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;} -void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;} -void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;} #endif diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 42fa279018..1d149026b5 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -47,10 +47,10 @@ #include "openair1/SIMULATION/TOOLS/sim.h" #include "openair1/SIMULATION/RF/rf.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" -#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include "openair1/PHY/MODULATION/nr_modulation.h" #include #include +#include "nfapi/oai_integration/vendor_ext.h" //#define DEBUG_NR_PBCHSIM PHY_VARS_gNB *gNB; @@ -80,6 +80,23 @@ nrUE_params_t *get_nrUE_params(void) { } void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} +NR_IF_Module_t *NR_IF_Module_init(int Mod_id) { return (NULL); } +nfapi_mode_t nfapi_getmode(void) { return NFAPI_MODE_UNKNOWN; } + +void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, + fapi_nr_dci_indication_t *dci_ind, + fapi_nr_rx_indication_t *rx_ind, + UE_nr_rxtx_proc_t *proc, + PHY_VARS_NR_UE *ue, + void *phy_data) {} +void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, + uint8_t pdu_type, + PHY_VARS_NR_UE *ue, + NR_UE_DLSCH_t *dlsch0, + NR_UE_DLSCH_t *dlsch1, + uint16_t n_pdus, + UE_nr_rxtx_proc_t *proc, + void *typeSpecific ) {} int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index cb7094fe77..a5589041f5 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -51,9 +51,9 @@ #include #include #include -//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include #include "executables/nr-uesoftmodem.h" +#include "nfapi/oai_integration/vendor_ext.h" #define NR_PRACH_DEBUG 1 #define PRACH_WRITE_OUTPUT_DEBUG 1 @@ -76,20 +76,13 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; uint16_t sl_ahead = 0; uint32_t N_RB_DL = 106; -//void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); +NR_IF_Module_t *NR_IF_Module_init(int Mod_id) { return (NULL); } +nfapi_mode_t nfapi_getmode(void) { return NFAPI_MODE_UNKNOWN; } +void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) { } /* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */ uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} -int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } -int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); } -int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); } -int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); } -int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { return(0); } -int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); } -int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); } -int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); } -int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); } //Fixme: Uniq dirty DU instance, by global var, datamodel need better management instance_t DUuniqInstance=0; instance_t CUuniqInstance=0; @@ -99,29 +92,6 @@ int nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t return 0; } -void -rrc_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const rb_id_t Srb_id, - const sdu_size_t sdu_sizeP, - const uint8_t *const buffer_pP -) -{ -} - -int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, - const int CC_id, - const uint8_t gNB_index, - const frame_t frame, - const sub_frame_t sub_frame, - const rnti_t rnti, - const channel_t channel, - const uint8_t* pduP, - const sdu_size_t pdu_len) -{ - return 0; -} - void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index) { return; @@ -137,29 +107,12 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP, return 0; } -// Dummy function to avoid linking error at compilation of nr-prachsim -int is_x2ap_enabled(void) -{ - return 0; -} - int nr_derive_key(int alg_type, uint8_t alg_id, const uint8_t key[32], uint8_t **out) { return 0; } -int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, - int CC_idP, - int UE_id, - rnti_t rntiP, - const uint8_t *sduP, - sdu_size_t sdu_lenP, - const uint8_t *sdu2P, - sdu_size_t sdu2_lenP) { - return 0; -} - nrUE_params_t nrUE_params; nrUE_params_t *get_nrUE_params(void) { diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 498b31ec8f..ae2e46d3b1 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -46,8 +46,8 @@ #include "openair1/SIMULATION/TOOLS/sim.h" #include "openair1/SIMULATION/RF/rf.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" -#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include "executables/nr-uesoftmodem.h" +#include "nfapi/oai_integration/vendor_ext.h" THREAD_STRUCT thread_struct; PHY_VARS_gNB *gNB; @@ -66,7 +66,12 @@ const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; // needed for some functions PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}}; +uint64_t get_softmodem_optmask(void) {return 0;} +softmodem_params_t *get_softmodem_params(void) {return 0;} + void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} +NR_IF_Module_t *NR_IF_Module_init(int Mod_id) { return (NULL); } +nfapi_mode_t nfapi_getmode(void) { return NFAPI_MODE_UNKNOWN; } nrUE_params_t nrUE_params={0}; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 0227788877..9caf881423 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -45,10 +45,10 @@ #include "openair1/SIMULATION/TOOLS/sim.h" #include "openair1/SIMULATION/RF/rf.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" -#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include "common/utils/threadPool/thread-pool.h" #include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h" #include "executables/nr-uesoftmodem.h" +#include "nfapi/oai_integration/vendor_ext.h" //#define DEBUG_NR_ULSCHSIM @@ -59,7 +59,14 @@ RAN_CONTEXT_t RC; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; uint64_t downlink_frequency[MAX_NUM_CCs][4]; +uint64_t get_softmodem_optmask(void) {return 0;} +static softmodem_params_t softmodem_params; +softmodem_params_t *get_softmodem_params(void) { + return &softmodem_params; +} void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} +NR_IF_Module_t *NR_IF_Module_init(int Mod_id) { return (NULL); } +nfapi_mode_t nfapi_getmode(void) { return NFAPI_MODE_UNKNOWN; } uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1}; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 8685626284..1a07d9b5b0 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -54,7 +54,6 @@ #include "openair1/SIMULATION/RF/rf.h" #include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" #include "openair2/RRC/NR/MESSAGES/asn1_msg.h" -//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c" #include "openair2/LAYER2/NR_MAC_UE/mac_proto.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "common/utils/threadPool/thread-pool.h" @@ -102,46 +101,6 @@ int nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration -int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, - const int CC_id, - const uint8_t gNB_index, - const frame_t frame, - const sub_frame_t sub_frame, - const rnti_t rnti, - const channel_t channel, - const uint8_t* pduP, - const sdu_size_t pdu_len) -{ - return 0; -} - -int generate_dlsch_header(unsigned char *mac_header, - unsigned char num_sdus, - unsigned short *sdu_lengths, - unsigned char *sdu_lcids, - unsigned char drx_cmd, - unsigned short timing_advance_cmd, - unsigned char *ue_cont_res_id, - unsigned char short_padding, - unsigned short post_padding){return 0;} - -void -rrc_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const rb_id_t Srb_id, - const sdu_size_t sdu_sizeP, - const uint8_t *const buffer_pP -) -{ -} - - -// Dummy function to avoid linking error at compilation of nr-ulsim -int is_x2ap_enabled(void) -{ - return 0; -} - void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index) { return; @@ -170,18 +129,6 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, nr_bler_struct nr_bler_data[NR_NUM_MCS]; -//nFAPI P7 dummy functions - -int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } -int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req){ return(0); } -int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req){ return(0); } -int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req){ return(0); } -int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { return(0); } -int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { return(0); } -int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { return(0); } -int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { return(0); } -int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0); } - int nr_derive_key(int alg_type, uint8_t alg_id, const uint8_t key[32], uint8_t **out) { diff --git a/openair2/E1AP/e1ap.c b/openair2/E1AP/e1ap.c index 52043602e2..3b413beb18 100644 --- a/openair2/E1AP/e1ap.c +++ b/openair2/E1AP/e1ap.c @@ -32,6 +32,7 @@ #include "common/utils/LOG/log.h" #include "openair2/F1AP/f1ap_common.h" #include "e1ap_default_values.h" +#include "gtp_itf.h" #define E1AP_NUM_MSG_HANDLERS 14 typedef int (*e1ap_message_processing_t)(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *message_p); diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c index ed61ad794b..52ad64989b 100644 --- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c @@ -37,6 +37,7 @@ #include "f1ap_cu_rrc_message_transfer.h" #include "common/ran_context.h" #include "openair3/UTILS/conversions.h" +#include "pdcp.h" /* Initial UL RRC Message Transfer diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index cdd97e9367..7dc7ce4ed3 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -43,6 +43,7 @@ #include "rrc_eNB_GTPV1U.h" #include "openair2/RRC/NR/rrc_gNB_NGAP.h" #include +#include "pdcp.h" static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) { asn1cCalloc(toFill, tmp); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index c1fa1d49b9..dbfe9a8dc4 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -54,6 +54,7 @@ #include "radio/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" #include "nfapi_pnf.h" +#include "pdcp.h" //#include "L1_paramdef.h" #include "prs_nr_paramdef.h" diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index db4d51a92f..e9ed99160e 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -806,6 +806,7 @@ void rr_ul_unset(void **data) { free(*data); *data = NULL; } +#define MAX(a, b) (((a)>(b))?(a):(b)) int rr_ul_run(module_id_t Mod_id, int CC_id, int frame, diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 5b5587a7e7..89346dfeda 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -37,6 +37,7 @@ #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" #include "common/utils/nr/nr_common.h" #include "executables/softmodem-common.h" +#include "SCHED_NR/phy_frame_config_nr.h" void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 66397b20a3..fe458ba644 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -61,6 +61,7 @@ #include "NR_CellGroupConfig.h" #include "NR_ServingCellConfig.h" #include "NR_MeasConfig.h" +#include "NR_ServingCellConfigCommonSIB.h" // ========== diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index e9eb77b9c1..662548231b 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -38,6 +38,7 @@ #include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h" #include "executables/softmodem-common.h" #include "openair2/LAYER2/nr_pdcp/nr_pdcp.h" +#include "openair2/LAYER2/PDCP_v10.1.0/pdcp.h" #include static NR_UE_MAC_INST_t *nr_ue_mac_inst; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index a6acf1fa77..ae068fb333 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -35,6 +35,9 @@ /* exe */ #include +/* PHY */ +#include "openair1/PHY/impl_defs_top.h" + /* MAC */ #include "NR_MAC_COMMON/nr_mac.h" #include "NR_MAC_COMMON/nr_mac_common.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index ff74e34c4a..a07c38bbcb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -33,6 +33,8 @@ #include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "NR_TAG-Id.h" +#include "common/ngran_types.h" +#include "rrc_messages_types.h" void set_cset_offset(uint16_t); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c index 25ee7feb14..ace8b17f49 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c @@ -20,6 +20,7 @@ */ #include "nr_mac_gNB.h" +#include "intertask_interface.h" #include "mac_rrc_ul.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c index 65e7f10405..13547c5291 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_f1ap.c @@ -20,6 +20,7 @@ */ #include "nr_mac_gNB.h" +#include "intertask_interface.h" #include "mac_rrc_ul.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index e9d41986c5..c5b35982b1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -33,6 +33,7 @@ #include "NR_MAC_gNB/mac_proto.h" #include "NR_MAC_COMMON/nr_mac_extern.h" #include "assertions.h" +#include "pdcp.h" #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" #include "RRC/NR/nr_rrc_defs.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index b4fa43c40f..aff1d2c060 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -51,6 +51,7 @@ /* RRC */ #include "NR_BCCH-BCH-Message.h" #include "NR_CellGroupConfig.h" +#include "NR_BCCH-DL-SCH-Message.h" /* PHY */ #include "time_meas.h" @@ -63,6 +64,7 @@ /* MAC */ #include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" +#include "LAYER2/MAC/mac.h" #include "NR_TAG.h" #include diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index f1fefc6973..c5eadf0a34 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -57,6 +57,7 @@ #include "intertask_interface.h" #include "openair3/S1AP/s1ap_eNB.h" #include +#include "pdcp.h" # include "openair3/ocp-gtpu/gtp_itf.h" #include diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index 1fb08d6ba8..47e961da2b 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -33,6 +33,7 @@ #ifndef __NR_IF_MODULE__H__ #define __NR_IF_MODULE__H__ +#include #include #include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h" diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index ca051194db..c67e2c243c 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -63,6 +63,10 @@ #include "LTE_TDD-Config.h" #include "LTE_UECapabilityEnquiry.h" #include "LTE_UE-CapabilityRequest.h" + +#include "NR_RAT-Type.h" +#include "NR_UE-CapabilityRAT-Container.h" + #include "RRC/NAS/nas_config.h" #include "RRC/NAS/rb_config.h" #if ENABLE_RAL diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 4c82f0b8f3..5f123f649c 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -65,6 +65,12 @@ #include "LTE_SystemInformationBlockType1-MBMS-r14.h" #include "LTE_NonMBSFN-SubframeConfig-r14.h" +#include "NR_UE-CapabilityRAT-ContainerList.h" +#include "NR_UE-CapabilityRAT-Container.h" +#include "NR_CG-ConfigInfo.h" +#include "NR_CG-Config.h" +#include "NR_RadioBearerConfig.c" + #include "common/utils/LOG/vcd_signal_dumper.h" #include "x2ap_eNB.h" diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index 647be50252..7010c7c831 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -36,6 +36,7 @@ #include "oai_asn1.h" #include "intertask_interface.h" +#include "pdcp.h" # include "common/ran_context.h" diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.h b/openair2/RRC/LTE/rrc_eNB_GTPV1U.h index f991cbd5f6..aff86729be 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.h +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.h @@ -30,6 +30,7 @@ #ifndef RRC_ENB_GTPV1U_H_ #define RRC_ENB_GTPV1U_H_ +#include "rrc_defs.h" /*! \fn rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(const protocol_ctxt_t* const ctxt_pP, const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP) *\brief Process GTPV1U_ENB_CREATE_TUNNEL_RESP message received from GTPV1U, retrieve the enb teid created. diff --git a/openair2/RRC/LTE/rrc_eNB_M2AP.c b/openair2/RRC/LTE/rrc_eNB_M2AP.c index 3b4818d534..16c003d471 100644 --- a/openair2/RRC/LTE/rrc_eNB_M2AP.c +++ b/openair2/RRC/LTE/rrc_eNB_M2AP.c @@ -35,6 +35,7 @@ # include "oai_asn1.h" # include "intertask_interface.h" # include "common/ran_context.h" +#include "pdcp.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index df30753595..f1dfa1ebb8 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -43,6 +43,7 @@ #include #include "UTIL/OSA/osa_defs.h" #include +#include "pdcp.h" void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) { struct rrc_gNB_ue_context_s *ue_context_p = NULL; diff --git a/openair2/X2AP/x2ap_eNB_defs.h b/openair2/X2AP/x2ap_eNB_defs.h index bd6092e0cb..96e76f5603 100644 --- a/openair2/X2AP/x2ap_eNB_defs.h +++ b/openair2/X2AP/x2ap_eNB_defs.h @@ -32,6 +32,8 @@ #include "tree.h" #include "sctp_eNB_defs.h" +#include "s1ap_messages_types.h" +#include "x2ap_messages_types.h" #include "x2ap_ids.h" #include "x2ap_timers.h" From e90ef3bc684be9837937f1589b5aca957790d94b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Feb 2023 17:36:07 +0100 Subject: [PATCH 07/13] Split phy_init.h into two files (for LTE/NR) --- executables/nr-gnb.c | 2 +- executables/nr-ru.c | 2 +- executables/nr-softmodem.c | 2 +- executables/nr-ue.c | 2 +- executables/nr-uesoftmodem.c | 2 +- nfapi/oai_integration/nfapi_pnf.c | 1 + openair1/PHY/INIT/nr_init.c | 2 +- openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/INIT/nr_parms.c | 2 +- openair1/PHY/INIT/nr_phy_init.h | 59 +++++++++++++++++++ openair1/PHY/INIT/phy_init.h | 34 ----------- openair1/PHY/NR_TRANSPORT/srs_rx.c | 2 +- .../PHY/NR_UE_ESTIMATION/nr_ue_measurements.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- openair1/SIMULATION/NR_PHY/prachsim.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/GNB_APP/gnb_config.c | 2 +- 24 files changed, 81 insertions(+), 55 deletions(-) create mode 100644 openair1/PHY/INIT/nr_phy_init.h diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index d958e772a9..041c85bb76 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -42,7 +42,7 @@ #include "PHY/types.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/defs_gNB.h" #include "SCHED/sched_eNB.h" diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 48cf6ebe31..ebe6fbbb74 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -46,7 +46,7 @@ #include "PHY/defs_nr_common.h" #include "PHY/phy_extern.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "SCHED_NR/sched_nr.h" #include "common/utils/LOG/log.h" diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index cfaea4b9c0..b17009b286 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -63,7 +63,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "intertask_interface.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "system.h" #include diff --git a/executables/nr-ue.c b/executables/nr-ue.c index bcbc57e07a..256306b1ab 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -24,7 +24,7 @@ #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "NR_MAC_UE/mac_proto.h" #include "RRC/NR_UE/rrc_proto.h" #include "SCHED_NR_UE/phy_frame_config_nr.h" diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 887ce75958..642543a3d3 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -63,7 +63,7 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "intertask_interface.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "system.h" #include #include diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 559c90f3dc..4dfdb2291a 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -52,6 +52,7 @@ #include "common/utils/LOG/log.h" #include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/LTE_TRANSPORT/transport_proto.h" #include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" #include "openair1/SCHED_NR/fapi_nr_l1.h" diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index d30e7e8af8..ce45177004 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -24,7 +24,7 @@ #include "common/ran_context.h" #include "PHY/defs_gNB.h" #include "PHY/NR_REFSIG/nr_refsig.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index ac7d1ceed9..ef0674d150 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -19,7 +19,7 @@ * contact@openairinterface.org */ -#include "phy_init.h" +#include "nr_phy_init.h" #include "PHY/phy_extern_nr_ue.h" #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/impl_defs_nr.h" diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index b3613c9d62..678036ecc9 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -19,7 +19,7 @@ * contact@openairinterface.org */ -#include "phy_init.h" +#include "nr_phy_init.h" #include "common/utils/nr/nr_common.h" #include "common/utils/LOG/log.h" diff --git a/openair1/PHY/INIT/nr_phy_init.h b/openair1/PHY/INIT/nr_phy_init.h new file mode 100644 index 0000000000..4c035d13d8 --- /dev/null +++ b/openair1/PHY/INIT/nr_phy_init.h @@ -0,0 +1,59 @@ +/* + * 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 + */ + +#ifndef NR_PHY_INIT_H_ +#define NR_PHY_INIT_H_ + +#include "PHY/defs_gNB.h" +#include "PHY/defs_nr_UE.h" + +int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb); +int 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, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); +int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); +void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); +void init_nr_ue_transport(PHY_VARS_NR_UE *ue); +void init_N_TA_offset(PHY_VARS_NR_UE *ue); +void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); +int 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); +void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst); +void phy_free_nr_gNB(PHY_VARS_gNB *gNB); +int l1_north_init_gNB(void); +void init_nr_transport(PHY_VARS_gNB *gNB); +void reset_nr_transport(PHY_VARS_gNB *gNB); + +void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); +void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); + +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 phy_init_nr_top(PHY_VARS_NR_UE *ue); +void phy_term_nr_top(void); + +#endif diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 5ec47c1dae..2116ba9c02 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -56,9 +56,6 @@ int l1_north_init_eNB(void); */ int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms); -void phy_init_nr_top(PHY_VARS_NR_UE *ue); -void phy_term_nr_top(void); - /*! \brief Allocate and Initialize the PHY variables relevant to the LTE ue signal buffers. @@ -392,37 +389,6 @@ void phy_config_update_sib13_request(PHY_Config_t *phy_config); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); -int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb); -int 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, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); -int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); -void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); -void init_nr_ue_transport(PHY_VARS_NR_UE *ue); -void init_N_TA_offset(PHY_VARS_NR_UE *ue); -void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); -int 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); -void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst); -void phy_free_nr_gNB(PHY_VARS_gNB *gNB); -int l1_north_init_gNB(void); -void init_nr_transport(PHY_VARS_gNB *gNB); -void reset_nr_transport(PHY_VARS_gNB *gNB); - -void init_dfts(void); - void fill_subframe_mask(PHY_VARS_eNB *eNB); -void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); -void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); -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); - -/** @} */ #endif - diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index 7c0e241af8..94f1e29993 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -30,7 +30,7 @@ #include #include -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/impl_defs_nr.h" #include "PHY/defs_nr_common.h" #include "PHY/defs_gNB.h" diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c index eaa1f5be7b..78dc616d07 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c @@ -33,7 +33,7 @@ #include "executables/softmodem-common.h" #include "executables/nr-softmodem-common.h" #include "PHY/defs_nr_UE.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/phy_extern_nr_ue.h" #include "common/utils/LOG/log.h" #include "PHY/sse_intrin.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 1d9d30ec33..0c2149e997 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -34,7 +34,7 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/sse_intrin.h" #include "PHY/LTE_REFSIG/lte_refsig.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "openair1/SCHED_NR_UE/defs.h" #include #include diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index d372bd36b7..e192005162 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -31,7 +31,7 @@ #include "fapi_nr_l1.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" #include "T.h" diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 57b3dff776..213a043e7b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -39,7 +39,7 @@ #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/phy_extern_nr_ue.h" #include "PHY/MODULATION/modulation_UE.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #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" diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 94d712d185..42a5fc2dcc 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -35,7 +35,7 @@ #include "PHY/defs_nr_common.h" #include "PHY/defs_nr_UE.h" #include "PHY/types.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 259883ed45..e939a27d1b 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -38,7 +38,7 @@ #include "PHY/defs_nr_UE.h" #include "PHY/phy_vars_nr_ue.h" #include "PHY/types.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/nr_modulation.h" #include "PHY/MODULATION/modulation_UE.h" diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 1d149026b5..f127c74818 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -38,7 +38,7 @@ #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/MODULATION/nr_modulation.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index a5589041f5..59e8a988a2 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -41,7 +41,7 @@ #include "PHY/MODULATION/nr_modulation.h" #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_UE.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index ae2e46d3b1..57575f18ef 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -38,7 +38,7 @@ #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/NR_ESTIMATION/nr_ul_estimation.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/NR_UE_TRANSPORT/pucch_nr.h" diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 9caf881423..325611d68d 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -33,7 +33,7 @@ #include "PHY/defs_nr_common.h" #include "PHY/defs_nr_UE.h" #include "PHY/defs_gNB.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_UE.h" diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 1a07d9b5b0..99fa1f6b07 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -35,7 +35,7 @@ #include "PHY/defs_nr_UE.h" #include "PHY/phy_vars_nr_ue.h" #include "PHY/types.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_REFSIG/dmrs_nr.h" diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index dbfe9a8dc4..ef8743dd39 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -50,7 +50,7 @@ // #include "SystemInformationBlockType2.h" // #include "LAYER2/MAC/extern.h" // #include "LAYER2/MAC/proto.h" -#include "PHY/INIT/phy_init.h" +#include "PHY/INIT/nr_phy_init.h" #include "radio/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" #include "nfapi_pnf.h" From c67a612192d87f7cc2f65955019d1b89e3e8a2ac Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Mar 2023 09:00:56 +0100 Subject: [PATCH 08/13] SIMU_ETH: use target, compile netlink_init.c only once --- CMakeLists.txt | 36 +- .../ETH_TRANSPORT/bypass_session_layer.c | 580 ------------------ 2 files changed, 12 insertions(+), 604 deletions(-) delete mode 100644 openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c diff --git a/CMakeLists.txt b/CMakeLists.txt index cddfc7ddeb..47b6200079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2044,13 +2044,12 @@ if (ENABLE_NRQTSCOPE) target_link_libraries(nrqtscope PRIVATE asn1_nr_rrc asn1_lte_rrc) endif() -add_library(SIMU_ETH -${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c -${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c -${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c -${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c -#${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/emu_transport.c +add_library(SIMU_ETH STATIC + ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c + ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c + ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ) +target_link_libraries(SIMU_ETH PRIVATE asn1_nr_rrc asn1_lte_rrc) include_directories("${NFAPI_DIR}/nfapi/public_inc") include_directories("${NFAPI_DIR}/common/public_inc") @@ -2161,9 +2160,6 @@ add_executable(lte-softmodem ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${PHY_INTERFACE_DIR}/queue_t.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c @@ -2178,7 +2174,7 @@ target_link_libraries(lte-softmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI SIMU + ${NAS_UE_LIB} ITTI SIMU SIMU_ETH -Wl,--end-group z dl) target_link_libraries(lte-softmodem PRIVATE ${LIBXML2_LIBRARIES}) @@ -2225,9 +2221,6 @@ add_executable(lte-uesoftmodem ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c @@ -2243,7 +2236,7 @@ target_link_libraries(lte-uesoftmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap x2ap m2ap m3ap SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON - PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB + PHY_UE PHY_RU L2_UE L2_LTE SIMU SIMU_ETH NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${NAS_UE_LIB} ITTI ${ATLAS_LIBRARIES} -Wl,--end-group z dl) @@ -2272,7 +2265,6 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c @@ -2286,7 +2278,7 @@ target_link_libraries(nr-softmodem PRIVATE -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA ITTI ${NAS_UE_LIB} lte_rrc nr_rrc - ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU + ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU SIMU_ETH x2ap f1ap m2ap m3ap e1ap -Wl,--end-group z dl) @@ -2308,7 +2300,6 @@ target_link_libraries(nr-softmodem PRIVATE add_executable(nr-cuup executables/nr-cuup.c executables/softmodem-common.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${NR_RRC_DIR}/rrc_gNB_UE_context.c ${OPENAIR2_DIR}/E1AP/e1ap_setup.c @@ -2320,7 +2311,7 @@ add_executable(nr-cuup target_link_libraries(nr-cuup PRIVATE CONFIG_LIB ITTI SCTP_CLIENT - GTPV1U e1ap e1_pdcp_if f1ap + GTPV1U e1ap e1_pdcp_if f1ap SIMU_ETH SECU_OSA SECU_CN ${OPENSSL_LIBRARIES} crypt z sctp dl pthread) target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc asn1_nr_rrc) @@ -2339,7 +2330,6 @@ add_executable(nr-uesoftmodem ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c @@ -2352,7 +2342,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE nr_rrc SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_NR_LIB - ITTI ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} SIMU + ITTI ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} SIMU SIMU_ETH -Wl,--end-group z dl) target_link_libraries(nr-uesoftmodem PRIVATE ${LIBXML2_LIBRARIES}) @@ -2489,7 +2479,6 @@ add_executable(nr_dlsim ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c @@ -2498,7 +2487,7 @@ add_executable(nr_dlsim ${SHLIB_LOADER_SOURCES} ) target_link_libraries(nr_dlsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl ) target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc asn1_lte_rrc) @@ -2534,7 +2523,6 @@ add_executable(nr_ulsim ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c @@ -2548,7 +2536,7 @@ if (ENABLE_LDPC_T1) endif() target_link_libraries(nr_ulsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group + -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc asn1_lte_rrc) diff --git a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c deleted file mode 100644 index a64e02abf7..0000000000 --- a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c +++ /dev/null @@ -1,580 +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 bypass_session_layer.h - * \brief implementation of emultor tx and rx - * \author Navid Nikaein and Raymond Knopp - * \date 2011 - 2014 - * \version 1.0 - * \company Eurecom - * \email: navid.nikaein@eurecom.fr - */ - -#include "PHY/defs.h" -#include "defs.h" -#include "proto.h" -#include "extern.h" - -#include "assertions.h" -#include "UTIL/OCG/OCG.h" -#include "UTIL/OCG/OCG_extern.h" -#include "UTIL/LOG/log.h" - -#include "multicast_link.h" -#include "openair1/SIMULATION/ETH_TRANSPORT/extern.h" -char rx_bufferP[BYPASS_RX_BUFFER_SIZE]; -unsigned int num_bytesP = 0; -int N_P = 0, N_R = 0; -char bypass_tx_buffer[BYPASS_TX_BUFFER_SIZE]; -static unsigned int byte_tx_count; -unsigned int Master_list_rx; -static uint64_t seq_num_tx = 0; - -mapping transport_names[] = { - {"WAIT PM TRANSPORT INFO", EMU_TRANSPORT_INFO_WAIT_PM}, - {"WAIT SM TRANSPORT INFO", EMU_TRANSPORT_INFO_WAIT_SM}, - {"SYNC TRANSPORT INFO", EMU_TRANSPORT_INFO_SYNC}, - {"ENB_TRANSPORT INFO", EMU_TRANSPORT_INFO_ENB}, - {"UE TRANSPORT INFO", EMU_TRANSPORT_INFO_UE}, - {"RELEASE TRANSPORT INFO", EMU_TRANSPORT_INFO_RELEASE}, - {NULL, -1} -}; -static pthread_mutex_t emul_low_mutex; -static pthread_mutex_t emul_low_mutex; -static pthread_cond_t emul_low_cond; -static char emul_low_mutex_var; - -void init_bypass (void) -{ - LOG_I(EMU, "[PHYSIM] INIT BYPASS\n"); - -#if !defined(ENABLE_NEW_MULTICAST) - pthread_mutex_init (&Tx_mutex, NULL); - pthread_cond_init (&Tx_cond, NULL); - Tx_mutex_var = 1; - pthread_mutex_init (&emul_low_mutex, NULL); - pthread_cond_init (&emul_low_cond, NULL); - emul_low_mutex_var = 1; -#endif - bypass_init (emul_tx_handler, emul_rx_handler); -} - -/***************************************************************************/ -void bypass_init (tx_handler_t tx_handlerP, rx_handler_t rx_handlerP) -{ - /***************************************************************************/ - multicast_link_start (bypass_rx_handler, oai_emulation.info.multicast_group, - oai_emulation.info.multicast_ifname); - tx_handler = tx_handlerP; - rx_handler = rx_handlerP; - Master_list_rx=0; - emu_tx_status = WAIT_SYNC_TRANSPORT; - emu_rx_status = WAIT_SYNC_TRANSPORT; -} - -int emu_transport_handle_sync(bypass_msg_header_t *messg) -{ - int m_id; - - DevAssert(messg != NULL); - - // determite the total number of remote enb & ue - oai_emulation.info.nb_enb_remote += messg->nb_enb; - oai_emulation.info.nb_ue_remote += messg->nb_ue; - - // determine the index of local enb and ue wrt the remote ones - if (messg->master_id < oai_emulation.info.master_id) { - oai_emulation.info.first_enb_local +=messg->nb_enb; - oai_emulation.info.first_ue_local +=messg->nb_ue; - } - - // store param for enb per master - if ((oai_emulation.info.master[messg->master_id].nb_enb = messg->nb_enb) > 0) { - for (m_id=0; m_id < messg->master_id; m_id++ ) { - oai_emulation.info.master[messg->master_id].first_enb+=oai_emulation.info.master[m_id].nb_enb; - } - - LOG_I(EMU, - "[ENB] WAIT_SYNC_TRANSPORT state: for master %d (first enb %d, totan enb %d)\n", - messg->master_id, - oai_emulation.info.master[messg->master_id].first_enb, - oai_emulation.info.master[messg->master_id].nb_enb); - } - - // store param for ue per master - if ((oai_emulation.info.master[messg->master_id].nb_ue = messg->nb_ue) > 0) { - for (m_id=0; m_id < messg->master_id; m_id++ ) { - oai_emulation.info.master[messg->master_id].first_ue+=oai_emulation.info.master[m_id].nb_ue; - } - - LOG_I(EMU, - "[UE] WAIT_SYNC_TRANSPORT state: for master %d (first ue %d, total ue%d)\n", - messg->master_id, - oai_emulation.info.master[messg->master_id].first_ue, - oai_emulation.info.master[messg->master_id].nb_ue ); - } - - Master_list_rx=((Master_list_rx) |(1<< messg->master_id)); - - if (Master_list_rx == oai_emulation.info.master_list) { - emu_rx_status = SYNCED_TRANSPORT; - } - - LOG_I(EMU, - "WAIT_SYNC_TRANSPORT state: m_id %d total enb remote %d total ue remote %d \n", - messg->master_id,oai_emulation.info.nb_enb_remote, - oai_emulation.info.nb_ue_remote ); - return 0; -} - -int emu_transport_handle_wait_sm(bypass_msg_header_t *messg) -{ - DevAssert(messg != NULL); - Master_list_rx = ((Master_list_rx) | (1 << messg->master_id)); - - return 0; -} - -int emu_transport_handle_wait_pm(bypass_msg_header_t *messg) -{ - DevAssert(messg != NULL); - - if (messg->master_id == 0) { - Master_list_rx = ((Master_list_rx) | (1 << messg->master_id)); - } - - return 0; -} - -static -int emu_transport_handle_enb_info(bypass_msg_header_t *messg, - unsigned int next_slot, - int bytes_read) -{ - eNB_transport_info_t *eNB_info; - int total_header = 0, total_tbs = 0; - int n_dci, n_enb, enb_info_ix = 0,CC_id; - - DevAssert(bytes_read >= 0); - DevAssert(messg != NULL); - -#ifdef DEBUG_EMU - LOG_D(EMU," RX ENB_TRANSPORT INFO from master %d \n",messg->master_id); -#endif - clear_eNB_transport_info(oai_emulation.info.nb_enb_local+ - oai_emulation.info.nb_enb_remote); - - if (oai_emulation.info.master[messg->master_id].nb_enb > 0 ) { - total_header += sizeof(eNB_transport_info_t)-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE; - - eNB_info = (eNB_transport_info_t *) (&rx_bufferP[bytes_read]); - - for (n_enb = oai_emulation.info.master[messg->master_id].first_enb; - n_enb < oai_emulation.info.master[messg->master_id].first_enb+ - oai_emulation.info.master[messg->master_id].nb_enb; - n_enb ++) { - for (n_dci = 0; n_dci < (eNB_info[enb_info_ix].num_ue_spec_dci + eNB_info[enb_info_ix].num_common_dci); n_dci ++) { - total_tbs += eNB_info[enb_info_ix].tbs[n_dci]; - } - - enb_info_ix++; - - if ((total_tbs + total_header) > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ) { - LOG_W(EMU,"RX eNB Transport buffer total size %d (header%d,tbs %d) \n", - total_header+total_tbs, total_header,total_tbs); - } - - memcpy(&eNB_transport_info[n_enb], eNB_info, total_header + total_tbs); - - /* Go to the next eNB info */ - eNB_info = (eNB_transport_info_t *)((uintptr_t)eNB_info + total_header+ - total_tbs); - bytes_read += (total_header + total_tbs); - } - - for (n_enb = oai_emulation.info.master[messg->master_id].first_enb; - n_enb < oai_emulation.info.master[messg->master_id].first_enb + - oai_emulation.info.master[messg->master_id].nb_enb; n_enb ++) - for (CC_id=0; CC_idmaster_id); - } - - Master_list_rx=((Master_list_rx) |(1<< messg->master_id)); - - if (Master_list_rx == oai_emulation.info.master_list) { - emu_rx_status = SYNCED_TRANSPORT; - } - - return 0; -} - -static -int emu_transport_handle_ue_info(bypass_msg_header_t *messg, - unsigned int last_slot, - int bytes_read) -{ - UE_transport_info_t *UE_info; - int n_ue, n_enb,CC_id=0; - int total_tbs = 0, total_header = 0, ue_info_ix =0; - - DevAssert(bytes_read >= 0); - DevAssert(messg != NULL); - -#ifdef DEBUG_EMU - LOG_D(EMU," RX UE TRANSPORT INFO from master %d\n",messg->master_id); -#endif - clear_UE_transport_info(oai_emulation.info.nb_ue_local+ - oai_emulation.info.nb_ue_remote); - - if (oai_emulation.info.master[messg->master_id].nb_ue > 0 ) { - total_header += sizeof(UE_transport_info_t)-MAX_TRANSPORT_BLOCKS_BUFFER_SIZE; - - UE_info = (UE_transport_info_t *) (&rx_bufferP[bytes_read]); - - // get the total size of the transport blocks - for (n_ue = oai_emulation.info.master[messg->master_id].first_ue; - n_ue < oai_emulation.info.master[messg->master_id].first_ue + - oai_emulation.info.master[messg->master_id].nb_ue; n_ue ++) { - total_tbs = 0; - - for (n_enb = 0; n_enb < UE_info[ue_info_ix].num_eNB; n_enb ++) { - total_tbs += UE_info[ue_info_ix].tbs[n_enb]; - } - - ue_info_ix++; - - if (total_tbs + total_header > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ) { - LOG_W(EMU,"RX [UE %d] Total size of buffer is %d (header%d,tbs %d) \n", - n_ue, total_header+total_tbs,total_header,total_tbs); - } - -//#warning "CC id should be adjusted, set to zero for the moment" - memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs); - - /* Go to the next UE info */ - UE_info = (UE_transport_info_t *)((uintptr_t)UE_info + total_header+ - total_tbs); - bytes_read += (total_header + total_tbs); - } - - for (n_ue = oai_emulation.info.master[messg->master_id].first_ue; - n_ue < oai_emulation.info.master[messg->master_id].first_ue + - oai_emulation.info.master[messg->master_id].nb_ue; - n_ue ++) - for (CC_id=0; CC_idmaster_id); - } - - Master_list_rx=((Master_list_rx) |(1<< messg->master_id)); - - if (Master_list_rx == oai_emulation.info.master_list) { - emu_rx_status = SYNCED_TRANSPORT; - } - - return 0; -} - -int bypass_rx_data(unsigned int frame, unsigned int last_slot, - unsigned int next_slot, uint8_t is_master) -{ - bypass_msg_header_t *messg; - bypass_proto2multicast_header_t *bypass_read_header; - int bytes_read = 0; - - LOG_D(EMU, "Entering bypass_rx for frame %d next_slot %d is_master %u\n", - frame, next_slot, is_master); - -#if defined(ENABLE_NEW_MULTICAST) - - if (multicast_link_read_data_from_sock(is_master) == 1) { - /* We got a timeout */ - return -1; - } - -#else - pthread_mutex_lock(&emul_low_mutex); - - if(emul_low_mutex_var) { - pthread_cond_wait(&emul_low_cond, &emul_low_mutex); - } - - if(num_bytesP==0) { - pthread_mutex_unlock(&emul_low_mutex); - } else { -#endif - bypass_read_header = (bypass_proto2multicast_header_t *) ( - &rx_bufferP[bytes_read]); - bytes_read += sizeof (bypass_proto2multicast_header_t); - - if (num_bytesP != bytes_read + bypass_read_header->size) { - LOG_W(EMU, "WARNINIG BYTES2READ # DELIVERED BYTES!!! (%d != %d)\n", - num_bytesP, bytes_read + bypass_read_header->size); - exit(EXIT_FAILURE); - } else { - messg = (bypass_msg_header_t *) (&rx_bufferP[bytes_read]); - bytes_read += sizeof (bypass_msg_header_t); -#if defined(ENABLE_NEW_MULTICAST) - LOG_D(EMU, "Received %d bytes [%s] from master_id %d with seq %"PRIuMAX"\n", - num_bytesP, map_int_to_str(transport_names, messg->Message_type), - messg->master_id, - messg->seq_num); - DevCheck4((messg->frame == frame) && (messg->subframe == (next_slot>>1)), - messg->frame, frame, messg->subframe, next_slot>>1); - -#else - - if ((messg->frame != frame) || (messg->subframe != next_slot>>1)) - LOG_W(EMU, - "Received %s from master %d for (frame %d,subframe %d) " - "currently (frame %d,subframe %d)\n", - map_int_to_str(transport_names,messg->Message_type), - messg->master_id, - messg->frame, messg->subframe, - frame, next_slot>>1); - -#endif - - //chek if MASTER in my List - switch(messg->Message_type) { - case EMU_TRANSPORT_INFO_WAIT_PM: - emu_transport_handle_wait_pm(messg); - break; - - case EMU_TRANSPORT_INFO_WAIT_SM: - emu_transport_handle_wait_sm(messg); - break; - - case EMU_TRANSPORT_INFO_SYNC: - emu_transport_handle_sync(messg); - break; - - case EMU_TRANSPORT_INFO_ENB: - emu_transport_handle_enb_info(messg, next_slot, bytes_read); - break; - - case EMU_TRANSPORT_INFO_UE: - emu_transport_handle_ue_info(messg, last_slot, bytes_read); - break; - - case EMU_TRANSPORT_INFO_RELEASE : - Master_list_rx = oai_emulation.info.master_list; - LOG_E(EMU, "RX EMU_TRANSPORT_INFO_RELEASE\n"); - break; - - default: - LOG_E(EMU, "[MAC][BYPASS] ERROR RX UNKNOWN MESSAGE\n"); - //mac_xface->macphy_exit(""); - break; - } - } - - num_bytesP=0; - -#if !defined(ENABLE_NEW_MULTICAST) - emul_low_mutex_var=1; - - pthread_cond_signal(&emul_low_cond); - pthread_mutex_unlock(&emul_low_mutex); -#endif - bypass_signal_mac_phy(frame, last_slot, next_slot, is_master); -#if !defined(ENABLE_NEW_MULTICAST) -} - -#endif - -return bytes_read; -} - -/******************************************************************************************************/ -void bypass_rx_handler(unsigned int Num_bytes,char *Rx_buffer) -{ - /******************************************************************************************************/ - if(Num_bytes >0) { -#if !defined(ENABLE_NEW_MULTICAST) - pthread_mutex_lock(&emul_low_mutex); - - while(!emul_low_mutex_var) { - pthread_cond_wait(&emul_low_cond, &emul_low_mutex); - } - -#endif - num_bytesP=Num_bytes; - memcpy(rx_bufferP, Rx_buffer, Num_bytes); -#if !defined(ENABLE_NEW_MULTICAST) - emul_low_mutex_var=0; - - /* on ne peut que signaler depuis un context linux - * (rtf_handler); pas de wait, jamais!!!!!! - */ - pthread_cond_signal(&emul_low_cond); - pthread_mutex_unlock(&emul_low_mutex); -#endif - } -} - -/******************************************************************************************************/ -void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot, - unsigned int next_slot, uint8_t is_master) -{ - /******************************************************************************************************/ - if (Master_list_rx != oai_emulation.info.master_list) { - bypass_rx_data(frame, last_slot, next_slot, is_master); - } else { - Master_list_rx = 0; - } -} - -/***************************************************************************/ -void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int next_slot) -{ - /***************************************************************************/ - unsigned int num_flows; - bypass_msg_header_t *messg; - - LOG_D(EMU, "Entering bypass_tx [%s] for frame %d next_slot %d\n", - map_int_to_str(transport_names, Type), frame, next_slot); - - int n_enb,n_ue, CC_id,n_dci,total_tbs=0,total_size=0; - messg = (bypass_msg_header_t *) ( - &bypass_tx_buffer[sizeof (bypass_proto2multicast_header_t)]); - num_flows = 0; - messg->master_id = oai_emulation.info.master_id; //Master_id; - - messg->nb_enb = oai_emulation.info.nb_enb_local; //Master_id; - messg->nb_ue = oai_emulation.info.nb_ue_local; //Master_id; - messg->nb_flow = num_flows; - messg->frame = frame; - messg->subframe = next_slot>>1; - messg->seq_num = seq_num_tx; - messg->failing_master_id = 0; - - seq_num_tx++; - - byte_tx_count = sizeof (bypass_msg_header_t) + sizeof ( - bypass_proto2multicast_header_t); - - if (Type == WAIT_PM_TRANSPORT) { - messg->Message_type = EMU_TRANSPORT_INFO_WAIT_PM; - LOG_T(EMU,"[TX_DATA] WAIT SYNC PM TRANSPORT\n"); - } else if (Type == WAIT_SM_TRANSPORT) { - messg->Message_type = EMU_TRANSPORT_INFO_WAIT_SM; - LOG_T(EMU,"[TX_DATA] WAIT SYNC SM TRANSPORT\n"); - } else if (Type == SYNC_TRANSPORT) { - messg->Message_type = EMU_TRANSPORT_INFO_SYNC; - /* make sure that sync messages from the masters are received in - * increasing order of master id - */ - sleep(oai_emulation.info.master_id+1); - LOG_T(EMU,"[TX_DATA] SYNC TRANSPORT\n"); - } else if(Type==ENB_TRANSPORT) { - - messg->Message_type = EMU_TRANSPORT_INFO_ENB; - total_size=0; - total_tbs=0; - - for (n_enb=oai_emulation.info.first_enb_local; - n_enb<(oai_emulation.info.first_enb_local+oai_emulation.info.nb_enb_local); - n_enb++) - for (CC_id=0; CC_id>1, CC_id, - eNB_transport_info[n_enb][CC_id].num_pmch + - eNB_transport_info[n_enb][CC_id].num_ue_spec_dci + - eNB_transport_info[n_enb][CC_id].num_common_dci ); - - for (n_dci = 0; n_dci < (eNB_transport_info[n_enb][CC_id].num_pmch + - eNB_transport_info[n_enb][CC_id].num_ue_spec_dci + - eNB_transport_info[n_enb][CC_id].num_common_dci); - n_dci++) { - total_tbs +=eNB_transport_info[n_enb][CC_id].tbs[n_dci]; - } - - if (total_tbs <= MAX_TRANSPORT_BLOCKS_BUFFER_SIZE) { - total_size = sizeof(eNB_transport_info_t) + total_tbs - - MAX_TRANSPORT_BLOCKS_BUFFER_SIZE; - } else { - LOG_E(EMU, - "[eNB]running out of memory for the eNB emulation transport buffer of size %d\n", - MAX_TRANSPORT_BLOCKS_BUFFER_SIZE); - } - - memcpy(&bypass_tx_buffer[byte_tx_count], (char *)&eNB_transport_info[n_enb][CC_id], - total_size); - byte_tx_count += total_size; - } - } else if (Type == UE_TRANSPORT) { - LOG_D(EMU,"[TX_DATA] UE TRANSPORT\n"); - messg->Message_type = EMU_TRANSPORT_INFO_UE; - total_size=0; - total_tbs=0; // compute the actual size of transport_blocks - - for (n_ue = oai_emulation.info.first_ue_local; - n_ue < (oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local); - n_ue++) { - for (CC_id=0; CC_idMessage_type = EMU_TRANSPORT_INFO_RELEASE; - } else { - LOG_E(EMU,"[TX_DATA] UNKNOWN MSG \n"); - } - - ((bypass_proto2multicast_header_t *) bypass_tx_buffer)->size = byte_tx_count - - sizeof (bypass_proto2multicast_header_t); - - multicast_link_write_sock(oai_emulation.info.multicast_group, - bypass_tx_buffer, byte_tx_count); - - LOG_D(EMU, "Frame %d, subframe %d (%d): Sent %d bytes [%s] with master_id %d and seq %"PRIuMAX"\n", - frame, next_slot>>1, next_slot,byte_tx_count, map_int_to_str(transport_names, Type), - messg->master_id, messg->seq_num); -} - From 6cd72e4e7d5be4dc48500fc667813386419f2f5c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Mar 2023 15:04:24 +0100 Subject: [PATCH 09/13] Create INTERFACE libraries to link to RRC ASN.1 target with headers only --- openair2/RRC/LTE/MESSAGES/CMakeLists.txt | 17 ++++++++++++++++- openair2/RRC/NR/MESSAGES/CMakeLists.txt | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/LTE/MESSAGES/CMakeLists.txt b/openair2/RRC/LTE/MESSAGES/CMakeLists.txt index 1b85c3ce66..b7e7f3ead6 100644 --- a/openair2/RRC/LTE/MESSAGES/CMakeLists.txt +++ b/openair2/RRC/LTE/MESSAGES/CMakeLists.txt @@ -14,8 +14,23 @@ add_custom_command(OUTPUT ${lte_rrc_source} ${lte_rrc_headers} COMMENT "Generating LTE RRC source file from ${CMAKE_CURRENT_SOURCE_DIR}/${LTE_RRC_GRAMMAR}" ) +# Many other targets include LTE RRC ASN.1 headers, without actually needing +# the actual library (asn1_lte_rrc). Therefore, below we create the INTERFACE +# library asn1_lte_rrc_hdrs that only contains these headers. To actually wait +# that the headers are created in add_custom_command, we use an intermediary +# add_custom_target which create a target that waits for the headers, and make +# a dependency from asn1_lte_rrc_hdrs to gen_lte_rrc_hdrs, which is the +# recommended way, see https://gitlab.kitware.com/cmake/cmake/-/issues/17366. +# In newer cmake version (e.g., 3.20), it is also possible to have +# ${lte_rrc_headers} directly in the add_library(asn1_lte_rrc_hdrs) statement, +# without the need for asn1_lte_rrc_hdrs +add_custom_target(gen_lte_rrc_hdrs DEPENDS ${lte_rrc_headers}) +add_library(asn1_lte_rrc_hdrs INTERFACE) +add_dependencies(asn1_lte_rrc_hdrs gen_lte_rrc_hdrs) +target_include_directories(asn1_lte_rrc_hdrs INTERFACE "${CMAKE_CURRENT_BINARY_DIR}") + add_library(asn1_lte_rrc ${lte_rrc_source}) -target_include_directories(asn1_lte_rrc PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") +target_link_libraries(asn1_lte_rrc PUBLIC asn1_lte_rrc_hdrs) target_compile_options(asn1_lte_rrc PRIVATE -DASN_DISABLE_OER_SUPPORT -w PUBLIC -DLTE_RRC_VERSION=${LTE_RRC_RELEASE}) diff --git a/openair2/RRC/NR/MESSAGES/CMakeLists.txt b/openair2/RRC/NR/MESSAGES/CMakeLists.txt index c43b846c82..666f528c37 100644 --- a/openair2/RRC/NR/MESSAGES/CMakeLists.txt +++ b/openair2/RRC/NR/MESSAGES/CMakeLists.txt @@ -14,8 +14,23 @@ add_custom_command(OUTPUT ${nr_rrc_source} ${nr_rrc_headers} COMMENT "Generating NR RRC source file from ${CMAKE_CURRENT_SOURCE_DIR}/${NR_RRC_GRAMMAR}" ) +# Many other targets include NR RRC ASN.1 headers, without actually needing the +# actual library (asn1_nr_rrc). Therefore, below we create the INTERFACE +# library asn1_nr_rrc_hdrs that only contains these headers. To actually wait +# that the headers are created in add_custom_command, we use an intermediary +# add_custom_target which create a target that waits for the headers, and make +# a dependency from asn1_nr_rrc_hdrs to gen_nr_rrc_hdrs, which is the +# recommended way, see https://gitlab.kitware.com/cmake/cmake/-/issues/17366. +# In newer cmake version (e.g., 3.20), it is also possible to have +# ${nr_rrc_headers} directly in the add_library(asn1_nr_rrc_hdrs) statement, +# without the need for asn1_lte_rrc_hdrs +add_custom_target(gen_nr_rrc_hdrs DEPENDS ${nr_rrc_headers}) +add_library(asn1_nr_rrc_hdrs INTERFACE) +add_dependencies(asn1_nr_rrc_hdrs gen_nr_rrc_hdrs) +target_include_directories(asn1_nr_rrc_hdrs INTERFACE "${CMAKE_CURRENT_BINARY_DIR}") + add_library(asn1_nr_rrc ${nr_rrc_source}) -target_include_directories(asn1_nr_rrc PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") +target_link_libraries(asn1_nr_rrc PUBLIC asn1_nr_rrc_hdrs) target_compile_options(asn1_nr_rrc PRIVATE -DASN_DISABLE_OER_SUPPORT -w PUBLIC -DNR_RRC_VERSION=${NR_RRC_RELEASE}) From 3b7d6377a0bfdeafd2e860e20893e1bf959ab4d9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Mar 2023 09:22:42 +0100 Subject: [PATCH 10/13] Link targets that need RRC ASN.1 headers to header-only library Most targets don't need the symbols from the compiled RRC ASN.1 libraries, but only the headers. In particular when compiling individual libraries (e.g., for tests), linking the full library makes the RRC ASN.1 libraries compile and link, when they are not needed (only headers are needed). For libraries that can do without these headers, don't link them. --- CMakeLists.txt | 123 ++++++++++-------------- common/utils/telnetsrv/CMakeLists.txt | 6 +- common/utils/websrv/CMakeLists.txt | 1 - openair1/PHY/TOOLS/CMakeLists.txt | 8 +- openair1/SIMULATION/TOOLS/channel_sim.c | 4 +- openair2/E1AP/CMakeLists.txt | 2 +- 6 files changed, 62 insertions(+), 82 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47b6200079..fd64284007 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,7 +289,6 @@ add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"") add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") - # Debug related options ######################################### add_boolean_option(DEBUG_ASN1 False "ASN1 coder/decoder Debug" OFF) @@ -301,7 +300,7 @@ add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace" ON) set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti) add_library(ITTI ${OCP_ITTI}/intertask_interface.cpp) -target_link_libraries(ITTI PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(ITTI PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) # asn1c skeletons have hardcoded this flag to make customized debug logs # OAI uses this feature to re-use OAI LOG_I(ASN, ...) @@ -348,7 +347,7 @@ add_library(s1ap ${S1AP_DIR}/s1ap_eNB_ue_context.c ) target_link_libraries(s1ap PUBLIC asn1_s1ap) -target_link_libraries(s1ap PRIVATE nr_rrc asn1_nr_rrc lte_rrc) +target_link_libraries(s1ap PRIVATE nr_rrc asn1_nr_rrc_hdrs lte_rrc) # NGAP ############## @@ -368,8 +367,8 @@ add_library(ngap ${NGAP_DIR}/ngap_gNB_trace.c ${NGAP_DIR}/ngap_gNB_ue_context.c ) -target_link_libraries(ngap PUBLIC asn1_ngap lte_rrc) -target_link_libraries(ngap PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(ngap PUBLIC asn1_ngap) +target_link_libraries(ngap PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) #M2AP ############## @@ -417,7 +416,7 @@ add_library(m3ap ) target_link_libraries(m3ap PUBLIC asn1_m3ap) target_link_libraries(m3ap PRIVATE m2ap) -target_link_libraries(m3ap PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(m3ap PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) target_include_directories(m3ap PUBLIC "${M3AP_DIR}") #X2AP @@ -437,7 +436,7 @@ add_library(x2ap ${X2AP_DIR}/x2ap_timers.c ) target_link_libraries(x2ap PUBLIC asn1_x2ap) -target_link_libraries(x2ap PRIVATE nr_rrc lte_rrc) +target_link_libraries(x2ap PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) # F1AP @@ -566,7 +565,6 @@ set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden - SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") target_link_libraries(benetel_4g PRIVATE ${DPDK_LIBS}) target_link_libraries(benetel_4g PRIVATE pthread dl rt m numa) -target_link_libraries(benetel_4g PRIVATE asn1_nr_rrc asn1_lte_rrc) # Benetel 5G library ###################################################################### @@ -585,7 +583,6 @@ set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden - SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") target_link_libraries(benetel_5g PRIVATE ${DPDK_LIBS}) target_link_libraries(benetel_5g PRIVATE pthread dl rt m numa) -target_link_libraries(benetel_5g PRIVATE asn1_nr_rrc asn1_lte_rrc) ########################################################## @@ -778,7 +775,6 @@ add_library(UTIL ${OPENAIR_DIR}/common/utils/time_meas.c ${OPENAIR_DIR}/common/utils/time_stat.c ) -target_link_libraries(UTIL PRIVATE asn1_nr_rrc asn1_lte_rrc) set(SECU_OSA_SRC ${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c @@ -817,7 +813,7 @@ set(SCHED_SRC ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c ) add_library(SCHED_LIB ${SCHED_SRC}) -target_link_libraries(SCHED_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SCHED_LIB PRIVATE asn1_lte_rrc_hdrs) set(SCHED_NR_SRC ${OPENAIR1_DIR}/SCHED_NR/fapi_nr_l1.c @@ -826,7 +822,7 @@ set(SCHED_NR_SRC ${OPENAIR1_DIR}/SCHED_NR/phy_frame_config_nr.c ) add_library(SCHED_NR_LIB ${SCHED_NR_SRC}) -target_link_libraries(SCHED_NR_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SCHED_NR_LIB PRIVATE asn1_nr_rrc_hdrs) set(SCHED_SRC_RU ${OPENAIR1_DIR}/SCHED/ru_procedures.c @@ -834,7 +830,7 @@ set(SCHED_SRC_RU ${OPENAIR1_DIR}/SCHED/prach_procedures.c ) add_library(SCHED_RU_LIB ${SCHED_SRC_RU}) -target_link_libraries(SCHED_RU_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SCHED_RU_LIB PRIVATE asn1_lte_rrc_hdrs) set(SCHED_SRC_UE ${OPENAIR1_DIR}/SCHED_UE/phy_procedures_lte_ue.c @@ -844,7 +840,7 @@ set(SCHED_SRC_UE ${OPENAIR1_DIR}/SCHED_UE/srs_pc.c ) add_library(SCHED_UE_LIB ${SCHED_SRC_UE}) -target_link_libraries(SCHED_UE_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SCHED_UE_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) set(SCHED_SRC_NR_UE ${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -854,7 +850,7 @@ set(SCHED_SRC_NR_UE ${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c ) add_library(SCHED_NR_UE_LIB ${SCHED_SRC_NR_UE}) -target_link_libraries(SCHED_NR_UE_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SCHED_NR_UE_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) # nFAPI @@ -884,7 +880,7 @@ set(NFAPI_PNF_SRC ${NFAPI_DIR}/pnf/src/pnf_p7_interface.c ) add_library(NFAPI_PNF_LIB ${NFAPI_PNF_SRC}) -target_link_libraries(NFAPI_PNF_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(NFAPI_PNF_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) include_directories(${NFAPI_DIR}/pnf/public_inc) include_directories(${NFAPI_DIR}/pnf/inc) @@ -896,7 +892,7 @@ set(NFAPI_VNF_SRC ${NFAPI_DIR}/vnf/src/vnf_p7_interface.c ) add_library(NFAPI_VNF_LIB ${NFAPI_VNF_SRC}) -target_link_libraries(NFAPI_VNF_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(NFAPI_VNF_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) include_directories(${NFAPI_DIR}/vnf/public_inc) include_directories(${NFAPI_DIR}/vnf/inc) @@ -910,7 +906,7 @@ set(NFAPI_USER_SRC ${NFAPI_USER_DIR}/gnb_ind_vars.c ) add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC}) -target_link_libraries(NFAPI_USER_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(NFAPI_USER_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) include_directories(${NFAPI_USER_DIR}) # Layer 1 @@ -1012,7 +1008,6 @@ add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} ) target_link_libraries(ldpc PRIVATE ldpc_gen_HEADERS) add_library(coding MODULE ${PHY_TURBOSRC} ) -target_link_libraries(coding PRIVATE asn1_nr_rrc asn1_lte_rrc) add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ) @@ -1269,27 +1264,23 @@ set(PHY_SRC_UE ${PHY_SRC_UE} ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_comp set(PHY_NR_UE_SRC ${PHY_NR_UE_SRC} ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c) add_library(PHY_COMMON ${PHY_SRC_COMMON}) -target_link_libraries(PHY_COMMON PRIVATE lte_rrc) add_dependencies(PHY_COMMON dfts) -target_link_libraries(PHY_COMMON PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(PHY_COMMON PRIVATE asn1_lte_rrc_hdrs) add_library(PHY ${PHY_SRC}) -target_link_libraries(PHY PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(PHY PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_library(PHY_UE ${PHY_SRC_UE}) -target_link_libraries(PHY_UE PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(PHY_UE PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON}) -target_link_libraries(PHY_NR_COMMON PRIVATE asn1_nr_rrc asn1_lte_rrc) add_library(PHY_NR ${PHY_NR_SRC}) -target_link_libraries(PHY_NR PRIVATE asn1_nr_rrc asn1_lte_rrc) add_library(PHY_NR_UE ${PHY_NR_UE_SRC}) -target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc asn1_lte_rrc) add_library(PHY_RU ${PHY_SRC_RU}) -target_link_libraries(PHY_RU PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs) #Library for mex functions #########################3 @@ -1313,7 +1304,7 @@ set(PHY_MEX_UE ${OPENAIR_DIR}/common/utils/T/local_tracer.c ) add_library(PHY_MEX ${PHY_MEX_UE} ${CONFIG_LIB}) -target_link_libraries(PHY_MEX PRIVATE asn1_lte_rrc) +target_link_libraries(PHY_MEX PRIVATE asn1_lte_rrc_hdrs) #Layer 2 library ##################### @@ -1554,14 +1545,12 @@ set (MISC_NFAPI_LTE ) add_library(MISC_NFAPI_LTE_LIB ${MISC_NFAPI_LTE}) -target_link_libraries(MISC_NFAPI_LTE_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) set (MISC_NFAPI_NR ${OPENAIR1_DIR}/SCHED/nfapi_nr_dummy.c ) add_library(MISC_NFAPI_NR_LIB ${MISC_NFAPI_NR}) -target_link_libraries(MISC_NFAPI_NR_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc) add_library(L2 ${L2_SRC} @@ -1570,16 +1559,16 @@ add_library(L2 ${MCE_APP_SRC} ) target_link_libraries(L2 PRIVATE x2ap s1ap lte_rrc m2ap) -target_link_libraries(L2 PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(L2 PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_library(MAC_NR ${MAC_NR_SRC}) -target_link_libraries(MAC_NR PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(MAC_NR PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_library(MAC_UE_NR ${MAC_NR_SRC_UE}) -target_link_libraries(MAC_UE_NR PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(MAC_UE_NR PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_library(L2_LTE ${L2_LTE_SRC}) -target_link_libraries(L2_LTE PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(L2_LTE PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_library(L2_NR ${L2_NR_SRC} @@ -1592,13 +1581,13 @@ add_library(e1_if ${NR_RRC_DIR}/cucp_cuup_e1ap.c ) -target_link_libraries(e1_if PRIVATE asn1_nr_rrc asn1_lte_rrc asn1_f1ap e1ap GTPV1U) +target_link_libraries(e1_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap e1ap GTPV1U) add_library(e1_pdcp_if ${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_e1_api.c ) -target_link_libraries(e1_pdcp_if PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(e1_pdcp_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap) @@ -1615,29 +1604,29 @@ add_library(L2_UE ${L2_SRC_UE} ${MAC_SRC_UE} ) -target_link_libraries(L2_UE PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(L2_UE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_library(L2_UE_LTE_NR ${L2_RRC_SRC_UE} ${MAC_SRC_UE} ) -target_link_libraries(L2_UE_LTE_NR PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(L2_UE_LTE_NR PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) if (NOT ${NOS1}) target_compile_definitions(L2_UE PUBLIC -DPDCP_USE_NETLINK) endif() -target_link_libraries(L2_UE PRIVATE lte_rrc) +target_link_libraries(L2_UE PRIVATE asn1_lte_rrc_hdrs) add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} ) target_link_libraries(NR_L2_UE PRIVATE f1ap) -target_link_libraries(NR_L2_UE PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(NR_L2_UE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_library(MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c ) -target_link_libraries(MAC_NR_COMMON PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(MAC_NR_COMMON PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) include_directories("${OPENAIR2_DIR}/NR_UE_PHY_INTERFACE") include_directories("${OPENAIR2_DIR}/LAYER2") @@ -1655,7 +1644,7 @@ add_library (GTPV1U ${RRC_DIR}/rrc_eNB_GTPV1U.c ${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp ) -target_link_libraries(GTPV1U PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(GTPV1U PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) target_link_libraries(GTPV1U PRIVATE SIMU) include_directories(${OPENAIR3_DIR}/ocp-gtp) @@ -1665,7 +1654,7 @@ set (MME_APP_SRC ) add_library(MME_APP ${MME_APP_SRC}) target_link_libraries(MME_APP PRIVATE m2ap m3ap) -target_link_libraries(MME_APP PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(MME_APP PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) set(SCTP_SRC ${OPENAIR3_DIR}/SCTP/sctp_common.c @@ -1673,7 +1662,7 @@ set(SCTP_SRC ${OPENAIR3_DIR}/SCTP/sctp_eNB_itti_messaging.c ) add_library(SCTP_CLIENT ${SCTP_SRC}) -target_link_libraries(SCTP_CLIENT PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SCTP_CLIENT PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) set(NAS_SRC ${OPENAIR3_DIR}/NAS/) set(libnas_api_OBJS @@ -1955,7 +1944,7 @@ target_link_libraries(LIB_NAS_SIMUE PRIVATE lte_rrc) set(NAS_SIM_LIB LIB_NAS_SIMUE) -target_link_libraries(LIB_NAS_SIMUE PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(LIB_NAS_SIMUE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_library(LIB_NAS_UE ${NAS_SRC}UE/nas_itti_messaging.c @@ -1976,9 +1965,8 @@ add_library(LIB_NAS_UE $ ) target_include_directories(LIB_NAS_UE PRIVATE ${OPENAIR_DIR}/common/utils/ds/) -target_link_libraries(LIB_NAS_UE PRIVATE lte_rrc) set(NAS_UE_LIB LIB_NAS_UE) -target_link_libraries(LIB_NAS_UE PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(LIB_NAS_UE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) include_directories(${NAS_SRC}NR_UE) include_directories(${NAS_SRC}UE) @@ -2010,7 +1998,7 @@ add_library(LIB_5GNAS_GNB target_include_directories(LIB_5GNAS_GNB PRIVATE ${OPENAIR_DIR}/common/utils/ds/) target_link_libraries(LIB_5GNAS_GNB PRIVATE SECU_CN ${CRYPTO_LIBRARIES}) -target_link_libraries(LIB_5GNAS_GNB PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(LIB_5GNAS_GNB PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) # Simulation library ########################## @@ -2029,7 +2017,6 @@ set (SIMUSRC ) add_library(SIMU STATIC ${SIMUSRC} ) target_include_directories(SIMU PUBLIC ${OPENAIR1_DIR}/SIMULATION/TOOLS ${OPENAIR1_DIR}/SIMULATION/RF) -target_link_libraries(SIMU PRIVATE asn1_nr_rrc asn1_lte_rrc) # Qt-based scope add_boolean_option(ENABLE_NRQTSCOPE OFF "Build the Qt-Scope" OFF) @@ -2041,7 +2028,7 @@ if (ENABLE_NRQTSCOPE) qt5_wrap_cpp(QTSCOPE_SOURCE_NR ${OPENAIR1_DIR}/PHY/TOOLS/nr_phy_qt_scope.h) add_library(nrqtscope MODULE ${QTSCOPE_SOURCE_NR}) target_link_libraries(nrqtscope PRIVATE Qt5::Widgets Qt5::Charts) - target_link_libraries(nrqtscope PRIVATE asn1_nr_rrc asn1_lte_rrc) + target_link_libraries(nrqtscope PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) endif() add_library(SIMU_ETH STATIC @@ -2049,7 +2036,7 @@ add_library(SIMU_ETH STATIC ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ) -target_link_libraries(SIMU_ETH PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(SIMU_ETH PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) include_directories("${NFAPI_DIR}/nfapi/public_inc") include_directories("${NFAPI_DIR}/common/public_inc") @@ -2067,7 +2054,6 @@ add_library(rfsimulator MODULE ${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c ) target_link_libraries(rfsimulator PRIVATE SIMU ${ATLAS_LIBRARIES}) -target_link_libraries(rfsimulator PRIVATE asn1_nr_rrc asn1_lte_rrc) add_library(oai_iqplayer MODULE ${OPENAIR_DIR}/radio/iqplayer/iqplayer_lib.c @@ -2180,7 +2166,7 @@ target_link_libraries(lte-softmodem PRIVATE target_link_libraries(lte-softmodem PRIVATE ${LIBXML2_LIBRARIES}) target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp) target_link_libraries(lte-softmodem PRIVATE ${T_LIB}) -target_link_libraries(lte-softmodem PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(lte-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(oairu @@ -2202,7 +2188,7 @@ target_link_libraries(oairu PRIVATE -Wl,--end-group z dl) target_link_libraries(oairu PRIVATE pthread m CONFIG_LIB rt ${T_LIB}) -target_link_libraries(oairu PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(oairu PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) # force the generation of ASN.1 so that we don't need to wait during the build target_link_libraries(lte-softmodem PRIVATE @@ -2243,7 +2229,7 @@ target_link_libraries(lte-uesoftmodem PRIVATE target_link_libraries(lte-uesoftmodem PRIVATE ${LIBXML2_LIBRARIES}) target_link_libraries(lte-uesoftmodem PRIVATE pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${ATLAS_LIBRARIES}) target_link_libraries(lte-uesoftmodem PRIVATE ${T_LIB}) -target_link_libraries(lte-uesoftmodem PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(lte-uesoftmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) # force the generation of ASN.1 so that we don't need to wait during the build target_link_libraries(lte-uesoftmodem PRIVATE @@ -2285,7 +2271,7 @@ target_link_libraries(nr-softmodem PRIVATE target_link_libraries(nr-softmodem PRIVATE ${LIBXML2_LIBRARIES}) target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${ATLAS_LIBRARIES}) target_link_libraries(nr-softmodem PRIVATE ${T_LIB}) -target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc) @@ -2313,7 +2299,7 @@ target_link_libraries(nr-cuup PRIVATE CONFIG_LIB ITTI SCTP_CLIENT GTPV1U e1ap e1_pdcp_if f1ap SIMU_ETH SECU_OSA SECU_CN ${OPENSSL_LIBRARIES} crypt z sctp dl pthread) -target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc asn1_nr_rrc) +target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) # nr-uesoftmodem is UE implementation ####################################### @@ -2348,7 +2334,7 @@ target_link_libraries(nr-uesoftmodem PRIVATE target_link_libraries(nr-uesoftmodem PRIVATE ${LIBXML2_LIBRARIES}) target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries(nr-uesoftmodem PRIVATE ${T_LIB}) -target_link_libraries(nr-uesoftmodem PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr-uesoftmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ) if (ENABLE_LDPC_CUDA) @@ -2387,7 +2373,7 @@ add_executable(rftest ${SHLIB_LOADER_SOURCES} ) target_link_libraries(rftest PRIVATE minimal_lib CONFIG_LIB PHY_NR_COMMON UTIL pthread dl m ${T_LIB} ) -target_link_libraries(rftest PRIVATE asn1_lte_rrc asn1_nr_rrc) +target_link_libraries(rftest PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_executable(polartest ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c @@ -2399,7 +2385,6 @@ target_link_libraries(polartest PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE CONFIG_LIB -Wl,--end-group m pthread ${ATLAS_LIBRARIES} dl ) -target_link_libraries(polartest PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(smallblocktest ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c @@ -2412,7 +2397,6 @@ target_link_libraries(smallblocktest PRIVATE -Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group m pthread ${ATLAS_LIBRARIES} dl ) -target_link_libraries(smallblocktest PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(ldpctest @@ -2430,7 +2414,6 @@ target_link_libraries(ldpctest PRIVATE -Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group m pthread ${ATLAS_LIBRARIES} dl ) -target_link_libraries(ldpctest PRIVATE asn1_nr_rrc asn1_lte_rrc) add_executable(nr_dlschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c @@ -2443,7 +2426,7 @@ target_link_libraries(nr_dlschsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl ) -target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc_hdrs) add_executable(nr_pbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c @@ -2456,7 +2439,7 @@ target_link_libraries(nr_pbchsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl ) -target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) #PUCCH ---> Prashanth @@ -2471,7 +2454,7 @@ target_link_libraries(nr_pucchsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl ) -target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_pucchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_dlsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c @@ -2490,7 +2473,7 @@ target_link_libraries(nr_dlsim PRIVATE -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl ) -target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_dlsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c @@ -2501,7 +2484,7 @@ add_executable(nr_prachsim target_link_libraries(nr_prachsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl) -target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_ulschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c @@ -2515,7 +2498,7 @@ target_link_libraries(nr_ulschsim PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI dl ) -target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_ulschsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_ulsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c @@ -2539,7 +2522,7 @@ target_link_libraries(nr_ulsim PRIVATE -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECU_CN ngap -lz -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl ) -target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim) @@ -2556,7 +2539,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${T_LIB} dl ) - target_link_libraries(${myExe} PRIVATE asn1_nr_rrc asn1_lte_rrc) + target_link_libraries(${myExe} PRIVATE asn1_lte_rrc_hdrs) endforeach(myExe) diff --git a/common/utils/telnetsrv/CMakeLists.txt b/common/utils/telnetsrv/CMakeLists.txt index f87a65b509..7994a1d151 100644 --- a/common/utils/telnetsrv/CMakeLists.txt +++ b/common/utils/telnetsrv/CMakeLists.txt @@ -35,7 +35,7 @@ add_library(telnetsrv MODULE telnetsrv_measurements.c ) target_link_libraries(telnetsrv PRIVATE history) -target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) message(STATUS "Add enb specific telnet functions in libtelnetsrv_enb.so") add_library(telnetsrv_enb MODULE @@ -43,7 +43,7 @@ add_library(telnetsrv_enb MODULE telnetsrv_enb_phycmd.c ) add_dependencies(telnetsrv telnetsrv_enb) -target_link_libraries(telnetsrv_enb PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(telnetsrv_enb PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) message(STATUS "No specific telnet functions for gnb") @@ -52,7 +52,7 @@ message(STATUS "No specific telnet functions for 4Gue") message(STATUS "Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so") add_library(telnetsrv_5Gue MODULE telnetsrv_5Gue_measurements.c) add_dependencies(telnetsrv telnetsrv_5Gue) -target_link_libraries(telnetsrv_5Gue PRIVATE asn1_nr_rrc asn1_lte_rrc) +target_link_libraries(telnetsrv_5Gue PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) # all libraries should be written to root build dir set_target_properties(telnetsrv telnetsrv_enb telnetsrv_5Gue diff --git a/common/utils/websrv/CMakeLists.txt b/common/utils/websrv/CMakeLists.txt index dd5576ae79..fd1b216c88 100644 --- a/common/utils/websrv/CMakeLists.txt +++ b/common/utils/websrv/CMakeLists.txt @@ -62,7 +62,6 @@ add_library(websrv MODULE websrv_utils.c ../../../openair1/PHY/TOOLS/nr_phy_scope.c ) -target_link_libraries(websrv PRIVATE asn1_lte_rrc asn1_nr_rrc) target_link_libraries(websrv PRIVATE ulfius jansson) target_compile_definitions(websrv PUBLIC WEBSRVSCOPE) # put websrv into build root and not under build/common/utils/websrv/ diff --git a/openair1/PHY/TOOLS/CMakeLists.txt b/openair1/PHY/TOOLS/CMakeLists.txt index 0a6026fb25..0def967792 100644 --- a/openair1/PHY/TOOLS/CMakeLists.txt +++ b/openair1/PHY/TOOLS/CMakeLists.txt @@ -33,16 +33,16 @@ include_directories ("/usr/include/X11") add_library(xforms_common OBJECT lte_phy_scope.c ../../../executables/stats.c) -target_link_libraries(xforms_common PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) +target_link_libraries(xforms_common PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_library(enbscope MODULE lte_enb_scope.c $) -target_link_libraries(enbscope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) +target_link_libraries(enbscope PUBLIC forms PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_library(uescope MODULE lte_ue_scope.c $) -target_link_libraries(uescope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) +target_link_libraries(uescope PUBLIC forms PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_library(nrscope MODULE nr_phy_scope.c) -target_link_libraries(nrscope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc) +target_link_libraries(nrscope PUBLIC forms PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) # all libraries should be written to root build dir (default creates the same hierarchie under build as existing for sources) set_target_properties(enbscope uescope nrscope diff --git a/openair1/SIMULATION/TOOLS/channel_sim.c b/openair1/SIMULATION/TOOLS/channel_sim.c index 7a1a77d3e1..9cf08fa5a3 100644 --- a/openair1/SIMULATION/TOOLS/channel_sim.c +++ b/openair1/SIMULATION/TOOLS/channel_sim.c @@ -33,13 +33,11 @@ #include "PHY/phy_extern.h" #include "PHY/phy_extern_ue.h" -#include "LAYER2/MAC/mac.h" -#include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "RRC/LTE/rrc_extern.h" #include "PHY_INTERFACE/phy_interface_extern.h" #include "UTIL/OCG/OCG.h" #include "UTIL/OPT/opt.h" // to test OPT +#include "common/ran_context.h" #define RF diff --git a/openair2/E1AP/CMakeLists.txt b/openair2/E1AP/CMakeLists.txt index a8bacdd3fa..01a969de7e 100644 --- a/openair2/E1AP/CMakeLists.txt +++ b/openair2/E1AP/CMakeLists.txt @@ -3,5 +3,5 @@ add_subdirectory(MESSAGES) add_library(e1ap e1ap.c e1ap_common.c e1ap_api.c) target_link_libraries(e1ap PUBLIC asn1_e1ap f1ap - PRIVATE asn1_nr_rrc asn1_lte_rrc asn1_f1ap UTIL e1_pdcp_if e1_if) + PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap UTIL e1_pdcp_if e1_if) target_include_directories(e1ap PUBLIC ${CMAKE_CURRENT_DIR}) From 29b6011be4c74bd810ac297f1985e15b0378664c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 2 Mar 2023 09:12:11 +0100 Subject: [PATCH 11/13] Remove build_oai option for core simulators: they don't compile --- cmake_targets/build_oai | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 1886c46052..fbc66951aa 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -300,10 +300,6 @@ function main() { SIMUS_PHY=1 echo_info "Will compile dlsim, ulsim, ..." shift;; - -S | --core_simulators) - SIMUS_CORE=1 - echo_info "Will compile security unitary tests" - shift;; -s | --check) OAI_TEST=1 echo_info "Will run auto-tests" @@ -621,17 +617,6 @@ function main() { done compilations $BUILD_DIR coding fi - - ################### - # Core simulators # - ################### - if [ "$SIMUS_CORE" = "1" ] ; then - echo_info "Compiling security unitary tests simulators" - simlist="secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2" - for f in $simlist ; do - compilations $BUILD_DIR test_$f - done - fi ###################### # Optional libraries # From c39861d9a306683026f87d9da9bf6e987f262032 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 2 Mar 2023 09:34:12 +0100 Subject: [PATCH 12/13] Remove useless freediameter references --- cmake_targets/build_oai | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index fbc66951aa..6778d3d15a 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -462,17 +462,6 @@ function main() { cecho "OPENAIR_DIR = $OPENAIR_DIR" $green - # for conf files copy in this bash script - if [ -d /usr/lib/freeDiameter ]; then - export FREEDIAMETER_PREFIX=/usr - else - if [ -d /usr/local/lib/freeDiameter ]; then - export FREEDIAMETER_PREFIX=/usr/local - else - echo_warning "FreeDiameter prefix not found, install freeDiameter if EPC, HSS" - fi - fi - if [ "$CLEAN_ALL" = "1" ] ; then clean_all_files echo_info "Erased all previously producted files" From 9a90e85da84912675f2b5bddac070d1a9cee0353 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 2 Mar 2023 09:36:12 +0100 Subject: [PATCH 13/13] Compile most targets in one go --- cmake_targets/build_oai | 106 ++++++++----------------------- cmake_targets/tools/build_helper | 32 ++++++---- 2 files changed, 43 insertions(+), 95 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 6778d3d15a..9b83f39c74 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -502,25 +502,15 @@ function main() { fi execlist="" - if [ "$eNB" = "1" ] ; then - execlist="$execlist lte-softmodem" - fi - if [ "$gNB" = "1" ] ; then - execlist="$execlist nr-softmodem nr-cuup" - fi - if [ "$RU" = "1" ] ; then - execlist="$execlist oairu" - fi - if [ "$UE" = 1 ] ; then - execlist="$execlist lte-uesoftmodem" - fi - if [ "$nrUE" = 1 ] ; then - execlist="$execlist nr-uesoftmodem" - fi - - if [[ "$execlist" == "" && "$SIMUS_PHY" != "1" && "$HW" == "None" ]]; then - SKIP_SHARED_LIB_FLAG="True" - fi + [[ "$eNB" == "1" ]] && execlist="$execlist lte-softmodem" + [[ "$gNB" == "1" ]] && execlist="$execlist nr-softmodem nr-cuup" + [[ "$RU" == "1" ]] && execlist="$execlist oairu" + [[ "$UE" == 1 ]] && execlist="$execlist lte-uesoftmodem" + [[ "$nrUE" == 1 ]] && execlist="$execlist nr-uesoftmodem" + # TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim + [[ "$SIMUS_PHY" == "1" ]] && execlist="$execlist dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim" + [[ "$BUILD_OPTLIB" != "" ]] && execlist="$execlist $BUILD_OPTLIB" + [[ "$execlist" != "" ]] && execlist="$execlist params_libconfig coding rfsimulator" DIR=$OPENAIR_DIR/cmake_targets @@ -537,34 +527,19 @@ function main() { echo_info "running $CMAKE_CMD" eval $CMAKE_CMD - for f in $execlist ; do - echo_info "Compiling $f..." - compilations $BUILD_DIR $f - done - - - # mandatory shared libraries common to UE and (e/g)NB - - if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then - echo_info "Building shared libraries common to UE and gNB" - - # configuration module libraries, one currently available, using libconfig - config_libconfig_shlib=params_libconfig - - compilations $BUILD_DIR $config_libconfig_shlib - - compilations $BUILD_DIR coding - + if [[ "$execlist" != "" ]]; then + echo_info "Compiling $execlist..." + compilations $BUILD_DIR all.txt $execlist fi if [ "$UE" = 1 ] ; then echo_info "Compiling UE specific part" - if [ $UE_ip -eq 1 ] + if [[ $UE_ip -eq 1 ]] then echo_info "Building ue_ip module" - compilations $BUILD_DIR ue_ip + compilations $BUILD_DIR ue_ip.txt ue_ip else echo_info "Bypassing ue_ip build" fi #IS_CONTAINER @@ -579,9 +554,9 @@ function main() { cd $DIR/nas_sim_tools/build eval $CMAKE_CMD .. - compilations nas_sim_tools usim - compilations nas_sim_tools nvram - compilations nas_sim_tools conf2uedata + compilations nas_sim_tools usim.txt usim + compilations nas_sim_tools nvram.txt nvram + compilations nas_sim_tools conf2uedata.txt conf2uedata # generate USIM data if [ -f conf2uedata ]; then @@ -591,31 +566,6 @@ function main() { fi fi - cd $DIR/$BUILD_DIR/build - - ################## - # PHY simulators # - ################## - if [ "$SIMUS_PHY" = "1" ] ; then - echo_info "Compiling physical unitary tests simulators" - # TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim - simlist="dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim" - # simlist="ldpctest" - for f in $simlist ; do - compilations $BUILD_DIR $f - done - compilations $BUILD_DIR coding - fi - - ###################### - # Optional libraries # - ###################### - if [ ! -z "$BUILD_OPTLIB" ] ; then - for oklib in $BUILD_OPTLIB ; do - compilations $BUILD_DIR $oklib - done - fi - #################################################### # Build RF device and transport protocol libraries # #################################################### @@ -626,31 +576,31 @@ function main() { rm -f liboai_device.so if [ "$HW" == "OAI_USRP" ] ; then - compilations $BUILD_DIR oai_usrpdevif + compilations $BUILD_DIR oai_usrpdevif.txt oai_usrpdevif ln -sf liboai_usrpdevif.so liboai_device.so echo_info "liboai_device.so is linked to USRP device library" elif [ "$HW" == "OAI_BLADERF" ] ; then if [ -f "/usr/include/libbladeRF.h" ] ; then - compilations $BUILD_DIR oai_bladerfdevif + compilations $BUILD_DIR oai_bladerfdevif.txt oai_bladerfdevif fi ln -sf liboai_bladerfdevif.so liboai_device.so echo_info "liboai_device.so is linked to BLADERF device library" elif [ "$HW" == "OAI_LMSSDR" ] ; then # if [ -f "/usr/include/libbladeRF.h" ] ; then - compilations $BUILD_DIR oai_lmssdrdevif + compilations $BUILD_DIR oai_lmssdrdevif.txt oai_lmssdrdevif # fi ln -sf liboai_lmssdrdevif.so liboai_device.so echo_info "liboai_device.so is linked to LMSSDR device library" elif [ "$HW" == "OAI_IRIS" ] ; then - compilations $BUILD_DIR oai_irisdevif + compilations $BUILD_DIR oai_irisdevif.txt oai_irisdevif ln -s liboai_irisdevif.so liboai_device.so echo_info "liboai_device.so is linked to IRIS device library" elif [ "$HW" == "OAI_AW2SORI" ] ; then - compilations $BUILD_DIR aw2sori_transpro + compilations $BUILD_DIR aw2sori_transpro.txt aw2sori_transpro ln -sf libaw2sori_transpro.so libthirdparty_transpro.so echo_info "build libthirdparty_transpro.so for AW2SORI fronthaul" @@ -659,28 +609,22 @@ function main() { fi fi - #build simulators devices - if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then - echo_info "Compiling rfsimulator" - compilations $BUILD_DIR rfsimulator - fi - #build transport protocol libraries (currently only ETHERNET is available) if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Building transport protocol libraries" rm -f liboai_transpro.so if [ "$TP" == "Ethernet" ]; then - compilations $BUILD_DIR oai_eth_transpro + compilations $BUILD_DIR oai_eth_transpro.txt oai_eth_transpro ln -sf liboai_eth_transpro.so liboai_transpro.so echo_info "liboai_transpro.so is linked to ETHERNET transport" fi if [ "$TP" == "benetel4g" ]; then - compilations $BUILD_DIR benetel_4g + compilations $BUILD_DIR benetel_4g.txt benetel4g ln -sf libbenetel_4g.so liboai_transpro.so echo_info "liboai_transpro.so is linked to BENETEL4G transport" fi if [ "$TP" == "benetel5g" ]; then - compilations $BUILD_DIR benetel_5g + compilations $BUILD_DIR benetel_5g.txt benetel_5g ln -sf libbenetel_5g.so liboai_transpro.so echo_info "liboai_transpro.so is linked to BENETEL4G transport" fi diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index b8ff564ae8..a32f9afb26 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -207,8 +207,13 @@ check_errors() { } compilations() { - cd $OPENAIR_DIR/cmake_targets/$1/build - echo_info "Log file for compilation is being written to: $dlog/$2.txt" + local dir=$1 + shift 1 + local logfile=$1 + shift 1 + local targets=$@ + cd $OPENAIR_DIR/cmake_targets/$dir/build + echo_info "Log file for compilation is being written to: $dlog/$logfile" set +e { if [ "$BUILD_COVERITY_SCAN" == "1" ]; then @@ -217,28 +222,27 @@ compilations() { COV_SCAN_PREFIX="" fi if [ "$MAKE_CMD" != "" ]; then - $MAKE_CMD $2 + $MAKE_CMD $targets else if [ "$VERBOSE_COMPILE" == "1" ]; then - $COV_SCAN_PREFIX make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE + $COV_SCAN_PREFIX make -j`nproc` $targets VERBOSE=$VERBOSE_COMPILE else - $COV_SCAN_PREFIX make -j`nproc` $2 + $COV_SCAN_PREFIX make -j`nproc` $targets fi fi ret=$? - } > $dlog/$2.txt 2>&1 - set -e + } > $dlog/$logfile 2>&1 if [ "$VERBOSE_CI" == "1" ]; then - echo_info "====== Start of log for $2.txt ======" - cat $dlog/$2.txt - echo_info "====== End of log for $2.txt ======" + echo_info "====== Start of log for $logfile ======" + cat $dlog/$logfile + echo_info "====== End of log for $logfile ======" fi - check_warnings "$dlog/$2.txt" + check_warnings "$dlog/$logfile" if [[ $ret -eq 0 ]]; then - echo_success "$2 compiled" + echo_success "$targets compiled" else - check_errors "$dlog/$2.txt" - echo_error "$2 compilation failed" + check_errors "$dlog/$logfile" + echo_error "compilation of $targets failed" exit 1 fi }