From 78f12dbc03a48f097a8a16f79f20b7837ec592d0 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 16:54:43 +0200 Subject: [PATCH 1/9] Change tracy version to latest release --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 898b387237..5d756434c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,7 +285,9 @@ add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace" ON) add_boolean_option(TRACY_ENABLE OFF "Enable tracy instrumentation" ON) if (TRACY_ENABLE) - CPMAddPackage("gh:wolfpld/tracy#v0.11.1") + # the tracy version here should match the tracy server version + # below is latest release as of this commit + CPMAddPackage("gh:wolfpld/tracy#0.12.2") endif() set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti) From c4f4f8d9198630872a3da9890538d9851b70f3ee Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 16:56:17 +0200 Subject: [PATCH 2/9] Remove threequarter_fs, log_level; make functions static 2 functions with same name as static to make it clearer they are separate. remove unused copy of log_level global var. remove threequarter sampling variable from the radio board general configuration. The decision of sampling rate is made above. A better behavior can be done later, like ask to the radio board what sampling rate it can do,then use it to decide the appropiate sampling rate from the gNB configuration. In UE case, it is another issue, as the sampling rate would change after we decode SIB1, but also it is not developped yet. --- executables/lte-uesoftmodem.c | 3 ++- executables/nr-uesoftmodem.c | 3 +-- openair1/SIMULATION/NR_PHY/ulsim.c | 6 ++++-- radio/COMMON/common_lib.h | 4 ---- radio/ETHERNET/ethernet_lib.c | 1 - radio/fhi_72/oran-config.c | 2 -- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c index ea48edd801..7de3014ee9 100644 --- a/executables/lte-uesoftmodem.c +++ b/executables/lte-uesoftmodem.c @@ -384,7 +384,8 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { } } -void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) { +static void init_openair0(LTE_DL_FRAME_PARMS *frame_parms, int rxgain) +{ int card; int i; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 6ed407a507..8b331e4976 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -249,7 +249,7 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){ } -void init_openair0() +static void init_openair0() { int card; int freq_off = 0; @@ -261,7 +261,6 @@ void init_openair0() for (card=0; cardthreequarter_fs; openair0_cfg[card].sample_rate = frame_parms->samples_per_subframe * 1e3; openair0_cfg[card].samples_per_frame = frame_parms->samples_per_frame; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index b2b2dc38bb..b5bd02aefd 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -237,6 +237,8 @@ int main(int argc, char *argv[]) int max_ldpc_iterations = 5; int num_antennas_per_thread = 1; uint32_t log_format = 0; + int threequarter_fs = 0; + if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == 0) { exit_fun("[NR_ULSIM] Error, configuration module init failed\n"); } @@ -351,7 +353,7 @@ int main(int argc, char *argv[]) case 'k': printf("Setting threequarter_fs_flag\n"); - openair0_cfg[0].threequarter_fs= 1; + threequarter_fs = 1; break; case 'm': @@ -584,7 +586,7 @@ int main(int argc, char *argv[]) uint32_t samples; get_samplerate_and_bw(mu, N_RB_DL, - openair0_cfg[0].threequarter_fs, + threequarter_fs, &sampling_frequency, &samples, &tx_bandwidth, diff --git a/radio/COMMON/common_lib.h b/radio/COMMON/common_lib.h index 86d09b00fb..f928d554a8 100644 --- a/radio/COMMON/common_lib.h +++ b/radio/COMMON/common_lib.h @@ -204,8 +204,6 @@ typedef struct split7_config { typedef struct openair0_config { //! Module ID for this configuration int Mod_id; - //! device log level - int log_level; //! duplexing mode duplex_mode_t duplex_mode; //! number of downlink resource blocks @@ -292,8 +290,6 @@ typedef struct openair0_config { double rx_sample_rate; //! the sample rate for transmit. double tx_sample_rate; - //! check for threequarter sampling rate - int8_t threequarter_fs; //! Flag to indicate this configuration is for NR int nr_flag; //! NR band number diff --git a/radio/ETHERNET/ethernet_lib.c b/radio/ETHERNET/ethernet_lib.c index eb23ef28cc..2a4d021afc 100644 --- a/radio/ETHERNET/ethernet_lib.c +++ b/radio/ETHERNET/ethernet_lib.c @@ -617,7 +617,6 @@ void dump_dev(openair0_device *device) eth_state_t *eth = (eth_state_t*)device->priv; printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id); - printf(" Log level is %i :\n" ,device->openair0_cfg->log_level); printf(" RB number: %i, sample rate: %lf \n" , device->openair0_cfg->num_rb_dl, device->openair0_cfg->sample_rate); printf(" RAU configured for %i tx/%i rx channels)\n", diff --git a/radio/fhi_72/oran-config.c b/radio/fhi_72/oran-config.c index 4eff24aacf..89c1838fa3 100644 --- a/radio/fhi_72/oran-config.c +++ b/radio/fhi_72/oran-config.c @@ -884,8 +884,6 @@ static bool set_fh_config(void *mplane_api, int ru_idx, int num_rus, enum xran_c for (int i = 1; i < oai0->rx_num_channels; ++i) DevAssert(oai0->rx_freq[0] == oai0->rx_freq[i]); DevAssert(oai0->nr_band > 0); - AssertFatal(oai0->threequarter_fs == 0, "cannot use three-quarter sampling with O-RAN 7.2 split\n"); - paramdef_t FHconfigs[] = ORAN_FH_DESC; paramlist_def_t FH_ConfigList = {CONFIG_STRING_ORAN_FH}; char aprefix[MAX_OPTNAME_SIZE] = {0}; From 7cc35cf7e07c44d79511b2239e1836d5988433ed Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 17:22:23 +0200 Subject: [PATCH 3/9] remove dead function --- openair1/PHY/INIT/nr_init.c | 1 - openair1/PHY/nr_phy_common/inc/nr_phy_common.h | 7 ------- openair1/PHY/nr_phy_common/src/nr_phy_common.c | 16 ---------------- 3 files changed, 24 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index dcdc4ee433..60bc63dac4 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -131,7 +131,6 @@ void phy_init_nr_gNB(PHY_VARS_gNB *gNB) crcTableInit(); init_byte2m128i(); - init_byte2bit16(); init_pucch2_luts(); nr_init_fde(); // Init array for frequency equalization of transform precoding of PUSCH diff --git a/openair1/PHY/nr_phy_common/inc/nr_phy_common.h b/openair1/PHY/nr_phy_common/inc/nr_phy_common.h index d52b6d9c43..134222d675 100644 --- a/openair1/PHY/nr_phy_common/inc/nr_phy_common.h +++ b/openair1/PHY/nr_phy_common/inc/nr_phy_common.h @@ -26,15 +26,8 @@ #include "PHY/NR_REFSIG/nr_refsig_common.h" #include "PHY/MODULATION/nr_modulation.h" -extern simde__m128i byte2bit16_lut[256]; -void init_byte2bit16(void); void init_byte2m128i(void); -static inline simde__m128i byte2bit16(uint8_t b) -{ - return byte2bit16_lut[b]; -} - typedef struct { int size; int ports; diff --git a/openair1/PHY/nr_phy_common/src/nr_phy_common.c b/openair1/PHY/nr_phy_common/src/nr_phy_common.c index e86652bd49..233645fb2d 100644 --- a/openair1/PHY/nr_phy_common/src/nr_phy_common.c +++ b/openair1/PHY/nr_phy_common/src/nr_phy_common.c @@ -26,22 +26,6 @@ #endif #define PEAK_DETECT_THRESHOLD 15 - -simde__m128i byte2bit16_lut[256]; -void init_byte2bit16(void) -{ - for (int s = 0; s < 256; s++) { - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], s & 1, 0); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 1) & 1, 1); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 2) & 1, 2); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 3) & 1, 3); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 4) & 1, 4); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 5) & 1, 5); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 6) & 1, 6); - byte2bit16_lut[s] = simde_mm_insert_epi16(byte2bit16_lut[s], (s >> 7) & 1, 7); - } -} - simde__m128i byte2m128i[256]; void init_byte2m128i(void) { From 2dae7b0db4787b4328d62bb2c36466a2823d0e85 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 17:36:33 +0200 Subject: [PATCH 4/9] Limit visibilty of roundKeys --- openair3/NAS/UE/API/USIM/aka_functions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair3/NAS/UE/API/USIM/aka_functions.c b/openair3/NAS/UE/API/USIM/aka_functions.c index d2e3fc36c5..1f461c3bbf 100644 --- a/openair3/NAS/UE/API/USIM/aka_functions.c +++ b/openair3/NAS/UE/API/USIM/aka_functions.c @@ -303,7 +303,7 @@ void ComputeOPc(const u8 op[16], u8 op_c_pP[16]) return; } /* end of function ComputeOPc */ /*-------------------- Rijndael round subkeys ---------------------*/ -u8 roundKeys[11][4][4]; +static u8 roundKeys[11][4][4]; /*--------------------- Rijndael S box table ----------------------*/ const u8 S[256] = { 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, From 4a3ebb30330f549c7b18e55d98651ee4324861ce Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 17:58:00 +0200 Subject: [PATCH 5/9] remove dead code and replace unmanaged asn1_xer_print global variable by the appropriate existing debug flag --- CMakeLists.txt | 1 - doc/Doxyfile | 1 - executables/nr-cuup.c | 1 - openair2/E1AP/e1ap_common.h | 2 -- openair2/GNB_APP/gnb_paramdef.h | 3 -- openair2/M2AP/m2ap_common.c | 4 +-- openair2/M2AP/m2ap_common.h | 2 -- openair2/M2AP/m2ap_decoder.c | 2 +- openair2/M2AP/m2ap_encoder.c | 2 +- openair2/X2AP/x2ap_common.c | 6 ++-- openair2/X2AP/x2ap_common.h | 2 -- openair2/X2AP/x2ap_eNB_decoder.c | 2 +- openair2/X2AP/x2ap_eNB_encoder.c | 2 +- openair3/M3AP/m3ap_common.c | 4 +-- openair3/M3AP/m3ap_common.h | 2 -- openair3/M3AP/m3ap_decoder.c | 2 +- openair3/M3AP/m3ap_encoder.c | 2 +- openair3/NGAP/ngap_common.c | 2 -- openair3/NGAP/ngap_common.h | 3 -- openair3/NGAP/ngap_gNB_encoder.c | 2 +- openair3/NGAP/ngap_gNB_nas_procedures.c | 4 +-- openair3/S1AP/s1ap_common.c | 41 ------------------------- openair3/S1AP/s1ap_common.h | 8 ----- openair3/S1AP/s1ap_eNB_encoder.c | 6 ++-- openair3/TEST/test_s1ap.c | 4 --- 25 files changed, 19 insertions(+), 91 deletions(-) delete mode 100644 openair3/S1AP/s1ap_common.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d756434c4..2544c86d7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,7 +339,6 @@ target_link_libraries(nr_rrc PUBLIC asn1_nr_rrc asn1_lte_rrc) set(S1AP_DIR ${OPENAIR3_DIR}/S1AP) include_directories ("${S1AP_DIR}") add_library(s1ap - ${S1AP_DIR}/s1ap_common.c ${S1AP_DIR}/s1ap_eNB.c ${S1AP_DIR}/s1ap_eNB_context_management_procedures.c ${S1AP_DIR}/s1ap_eNB_decoder.c diff --git a/doc/Doxyfile b/doc/Doxyfile index f128e3eb88..e67078a043 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1021,7 +1021,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_eNB_ue_context.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_eNB_management_procedures.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_eNB_context_management_procedures.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_common.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_eNB_decoder.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_eNB_management_procedures.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair3/S1AP/s1ap_eNB_handlers.h \ diff --git a/executables/nr-cuup.c b/executables/nr-cuup.c index 6467683cac..403f78ddb3 100644 --- a/executables/nr-cuup.c +++ b/executables/nr-cuup.c @@ -37,7 +37,6 @@ RAN_CONTEXT_t RC; THREAD_STRUCT thread_struct; uint64_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; -int asn1_xer_print; int oai_exit = 0; instance_t CUuniqInstance = 0; diff --git a/openair2/E1AP/e1ap_common.h b/openair2/E1AP/e1ap_common.h index 452762965c..6c556a6cc6 100644 --- a/openair2/E1AP/e1ap_common.h +++ b/openair2/E1AP/e1ap_common.h @@ -41,8 +41,6 @@ typedef struct e1ap_upcp_inst_s { e1ap_net_config_t net_config; } e1ap_upcp_inst_t; -extern int asn1_xer_print; - // forward declaration so we don't require E1AP ASN.1 when including this // header struct E1AP_E1AP_PDU; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index db04c5a8da..b751d78733 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -49,9 +49,6 @@ #define GNB_CONF_STRING_OTG_APP_TYPE "app_type" #define GNB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic" -extern int asn_debug; -extern int asn1_xer_print; - #ifdef LIBCONFIG_LONG #define libconfig_int long #else diff --git a/openair2/M2AP/m2ap_common.c b/openair2/M2AP/m2ap_common.c index aa090d124d..d9183df6fb 100644 --- a/openair2/M2AP/m2ap_common.c +++ b/openair2/M2AP/m2ap_common.c @@ -47,7 +47,7 @@ ssize_t m2ap_generate_initiating_message( pdu.choice.initiatingMessage.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.initiatingMessage.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M2AP_M2AP_PDU, (void *)&pdu); } @@ -80,7 +80,7 @@ ssize_t m2ap_generate_unsuccessfull_outcome( pdu.choice.successfulOutcome.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.successfulOutcome.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M2AP_M2AP_PDU, (void *)&pdu); } diff --git a/openair2/M2AP/m2ap_common.h b/openair2/M2AP/m2ap_common.h index 266b303518..a875d8d078 100644 --- a/openair2/M2AP/m2ap_common.h +++ b/openair2/M2AP/m2ap_common.h @@ -50,8 +50,6 @@ # define M2AP_PORT 36423 #endif -extern int asn1_xer_print; - #include "common/utils/LOG/log.h" #include "m2ap_default_values.h" #define M2AP_INFO(x, args...) LOG_I(M2AP, x, ##args) diff --git a/openair2/M2AP/m2ap_decoder.c b/openair2/M2AP/m2ap_decoder.c index 1237c4ec8e..4abd43f564 100644 --- a/openair2/M2AP/m2ap_decoder.c +++ b/openair2/M2AP/m2ap_decoder.c @@ -165,7 +165,7 @@ int m2ap_decode_pdu(M2AP_M2AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length, 0, 0); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M2AP_M2AP_PDU, pdu); } diff --git a/openair2/M2AP/m2ap_encoder.c b/openair2/M2AP/m2ap_encoder.c index 8f798ff55c..81a3bfce92 100644 --- a/openair2/M2AP/m2ap_encoder.c +++ b/openair2/M2AP/m2ap_encoder.c @@ -44,7 +44,7 @@ int m2ap_encode_pdu(M2AP_M2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) DevAssert(buffer != NULL); DevAssert(len != NULL); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M2AP_M2AP_PDU, (void *)pdu); } diff --git a/openair2/X2AP/x2ap_common.c b/openair2/X2AP/x2ap_common.c index a687b90666..0fc63b7de5 100644 --- a/openair2/X2AP/x2ap_common.c +++ b/openair2/X2AP/x2ap_common.c @@ -47,7 +47,7 @@ ssize_t x2ap_generate_initiating_message( pdu.choice.initiatingMessage.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.initiatingMessage.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)&pdu); } @@ -79,7 +79,7 @@ ssize_t x2ap_generate_successfull_outcome( pdu.choice.successfulOutcome.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.successfulOutcome.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)&pdu); } @@ -111,7 +111,7 @@ ssize_t x2ap_generate_unsuccessfull_outcome( pdu.choice.successfulOutcome.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.successfulOutcome.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)&pdu); } diff --git a/openair2/X2AP/x2ap_common.h b/openair2/X2AP/x2ap_common.h index 81880cb71c..36dfe24287 100644 --- a/openair2/X2AP/x2ap_common.h +++ b/openair2/X2AP/x2ap_common.h @@ -49,8 +49,6 @@ # define X2AP_PORT 36422 #endif -extern int asn1_xer_print; - #include "common/utils/LOG/log.h" #define X2AP_INFO(x, args...) LOG_I(X2AP, x, ##args) #define X2AP_ERROR(x, args...) LOG_E(X2AP, x, ##args) diff --git a/openair2/X2AP/x2ap_eNB_decoder.c b/openair2/X2AP/x2ap_eNB_decoder.c index 6d7897bf14..81cb77dfef 100644 --- a/openair2/X2AP/x2ap_eNB_decoder.c +++ b/openair2/X2AP/x2ap_eNB_decoder.c @@ -156,7 +156,7 @@ int x2ap_eNB_decode_pdu(X2AP_X2AP_PDU_t *pdu, const uint8_t *const buffer, uint3 length, 0, 0); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, pdu); } diff --git a/openair2/X2AP/x2ap_eNB_encoder.c b/openair2/X2AP/x2ap_eNB_encoder.c index 8b1c030d35..a82eb03f9a 100644 --- a/openair2/X2AP/x2ap_eNB_encoder.c +++ b/openair2/X2AP/x2ap_eNB_encoder.c @@ -44,7 +44,7 @@ int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) DevAssert(buffer != NULL); DevAssert(len != NULL); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)pdu); } diff --git a/openair3/M3AP/m3ap_common.c b/openair3/M3AP/m3ap_common.c index e43275d96c..669d7eaa5e 100644 --- a/openair3/M3AP/m3ap_common.c +++ b/openair3/M3AP/m3ap_common.c @@ -47,7 +47,7 @@ ssize_t m3ap_generate_initiating_message( pdu.choice.initiatingMessage.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.initiatingMessage.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M3AP_M3AP_PDU, (void *)&pdu); } @@ -80,7 +80,7 @@ ssize_t m3ap_generate_unsuccessfull_outcome( pdu.choice.successfulOutcome.criticality = criticality; ANY_fromType_aper((ANY_t *)&pdu.choice.successfulOutcome.value, td, sptr); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M3AP_M3AP_PDU, (void *)&pdu); } diff --git a/openair3/M3AP/m3ap_common.h b/openair3/M3AP/m3ap_common.h index 7c8ea18a5d..f5acb6bdf5 100644 --- a/openair3/M3AP/m3ap_common.h +++ b/openair3/M3AP/m3ap_common.h @@ -48,8 +48,6 @@ # define M3AP_PORT 36444 #endif -extern int asn1_xer_print; - #include "common/utils/LOG/log.h" #include "m3ap_default_values.h" #define M3AP_INFO(x, args...) LOG_I(M3AP, x, ##args) diff --git a/openair3/M3AP/m3ap_decoder.c b/openair3/M3AP/m3ap_decoder.c index cee0a5ff41..36c8f64fae 100644 --- a/openair3/M3AP/m3ap_decoder.c +++ b/openair3/M3AP/m3ap_decoder.c @@ -188,7 +188,7 @@ int m3ap_decode_pdu(M3AP_M3AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length, 0, 0); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M3AP_M3AP_PDU, pdu); } diff --git a/openair3/M3AP/m3ap_encoder.c b/openair3/M3AP/m3ap_encoder.c index 2e1cbf80af..86a710ca90 100644 --- a/openair3/M3AP/m3ap_encoder.c +++ b/openair3/M3AP/m3ap_encoder.c @@ -44,7 +44,7 @@ int m3ap_encode_pdu(M3AP_M3AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) DevAssert(buffer != NULL); DevAssert(len != NULL); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_M3AP_M3AP_PDU, (void *)pdu); } diff --git a/openair3/NGAP/ngap_common.c b/openair3/NGAP/ngap_common.c index 7b960fed0b..82c2ccaf2a 100644 --- a/openair3/NGAP/ngap_common.c +++ b/openair3/NGAP/ngap_common.c @@ -31,8 +31,6 @@ #include "conversions.h" #include "ngap_common.h" -int asn1_xer_print = 0; - void encode_ngap_cause(NGAP_Cause_t *out, const ngap_cause_t *in) { switch (in->type) { diff --git a/openair3/NGAP/ngap_common.h b/openair3/NGAP/ngap_common.h index 82a8fe9234..dd7fdebc54 100644 --- a/openair3/NGAP/ngap_common.h +++ b/openair3/NGAP/ngap_common.h @@ -48,9 +48,6 @@ #define NGAP_UE_ID_FMT "0x%06"PRIX32 -extern int asn_debug; -extern int asn1_xer_print; - # include "common/utils/LOG/log.h" # include "ngap_gNB_default_values.h" # define NGAP_ERROR(x, args...) LOG_E(NGAP, x, ##args) diff --git a/openair3/NGAP/ngap_gNB_encoder.c b/openair3/NGAP/ngap_gNB_encoder.c index ee3b37e07d..c3c095541d 100644 --- a/openair3/NGAP/ngap_gNB_encoder.c +++ b/openair3/NGAP/ngap_gNB_encoder.c @@ -115,7 +115,7 @@ int ngap_gNB_encode_pdu(NGAP_NGAP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) DevAssert(pdu != NULL); DevAssert(buffer != NULL); DevAssert(len != NULL); - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_NGAP_NGAP_PDU, (void *)pdu); } switch (pdu->present) { diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index 1aafeca8c9..b291f6b96c 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -690,7 +690,7 @@ int ngap_gNB_initial_ctxt_resp(instance_t instance, ngap_initial_context_setup_r // ie->value.choice.CriticalityDiagnostics =; } - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_NGAP_NGAP_PDU, &pdu); } @@ -772,7 +772,7 @@ int ngap_gNB_initial_ctxt_fail(instance_t instance, ngap_initial_context_setup_f ie->value.present = NGAP_InitialContextSetupFailureIEs__value_PR_Cause; encode_ngap_cause(&ie->value.choice.Cause, &initial_ctxt_fail->cause); } - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_NGAP_NGAP_PDU, &pdu); } if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { diff --git a/openair3/S1AP/s1ap_common.c b/openair3/S1AP/s1ap_common.c deleted file mode 100644 index d31c6e5839..0000000000 --- a/openair3/S1AP/s1ap_common.c +++ /dev/null @@ -1,41 +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 s1ap_common.c - * \brief s1ap procedures for both eNB and MME - * \author Sebastien ROUX and Navid Nikaein - * \email navid.nikaein@eurecom.fr - * \date 2012-2015 - * \version 0.1 - */ - -#include - -#include "s1ap_common.h" -#include "S1AP_S1AP-PDU.h" - - -int asn1_xer_print = 0; - - -void s1ap_handle_criticality(S1AP_Criticality_t criticality) -{ -} diff --git a/openair3/S1AP/s1ap_common.h b/openair3/S1AP/s1ap_common.h index 797bc7be8a..7ef7e589ca 100644 --- a/openair3/S1AP/s1ap_common.h +++ b/openair3/S1AP/s1ap_common.h @@ -52,8 +52,6 @@ #define S1AP_UE_ID_FMT "0x%06"PRIX32 -extern int asn1_xer_print; - #include "common/utils/LOG/log.h" #include "s1ap_eNB_default_values.h" #define S1AP_ERROR(x, args...) LOG_E(S1AP, x, ##args) @@ -89,10 +87,4 @@ extern int asn1_xer_print; **/ typedef int (*s1ap_message_decoded_callback)(sctp_assoc_t assoc_id, uint32_t stream, S1AP_S1AP_PDU_t *pdu); -/** \brief Handle criticality - \param criticality Criticality of the IE - @returns void - **/ -void s1ap_handle_criticality(S1AP_Criticality_t criticality); -/** @}*/ #endif /* S1AP_COMMON_H_ */ diff --git a/openair3/S1AP/s1ap_eNB_encoder.c b/openair3/S1AP/s1ap_eNB_encoder.c index 8317f02731..6ff837a7f1 100644 --- a/openair3/S1AP/s1ap_eNB_encoder.c +++ b/openair3/S1AP/s1ap_eNB_encoder.c @@ -129,7 +129,7 @@ int s1ap_eNB_encode_initiating(S1AP_S1AP_PDU_t *pdu, return -1; } - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_S1AP_S1AP_PDU, (void *)pdu); } @@ -183,7 +183,7 @@ int s1ap_eNB_encode_successfull_outcome(S1AP_S1AP_PDU_t *pdu, return -1; } - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_S1AP_S1AP_PDU, (void *)pdu); } @@ -214,7 +214,7 @@ int s1ap_eNB_encode_unsuccessfull_outcome(S1AP_S1AP_PDU_t *pdu, return -1; } - if (asn1_xer_print) { + if (LOG_DEBUGFLAG(DEBUG_ASN1)) { xer_fprint(stdout, &asn_DEF_S1AP_S1AP_PDU, (void *)pdu); } diff --git a/openair3/TEST/test_s1ap.c b/openair3/TEST/test_s1ap.c index 8e61c338ac..1ecb30d476 100644 --- a/openair3/TEST/test_s1ap.c +++ b/openair3/TEST/test_s1ap.c @@ -154,10 +154,6 @@ void doit (void) { int i; break_on_error = 1; - - // asn1_xer_print = 1; - // asn_debug = 1; - for (i = 0; i < sizeof(s1ap_test) / sizeof(s1ap_test_t); i++) { S1AP_S1AP_PDU_t pdu; uint8_t *buffer; From c2d9f17242bd845b5306d7593ff5d5724766e2e1 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 17:59:53 +0200 Subject: [PATCH 6/9] remove a dependancy of gNB to LTE that is not used and adds global vars to gNB --- executables/nr-softmodem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5cc5e3a4fc..261dc9a66b 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -24,7 +24,6 @@ #include "common/config/config_userapi.h" #include "common/utils/load_module_shlib.h" -#include "RRC/LTE/rrc_vars.h" #ifdef SMBV #include "PHY/TOOLS/smbv.h" unsigned short config_frames[4] = {2,9,11,13}; From 4b47d26ea291fdd71dd5d8384aa4fdab8fb89999 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 18:07:51 +0200 Subject: [PATCH 7/9] remove dirty and unused functions with global vars (not working anyway) --- executables/lte-softmodem.c | 49 ----------------------------------- executables/lte-uesoftmodem.c | 49 ----------------------------------- executables/nr-softmodem.c | 46 -------------------------------- 3 files changed, 144 deletions(-) diff --git a/executables/lte-softmodem.c b/executables/lte-softmodem.c index 6a7e607586..3034512b2c 100644 --- a/executables/lte-softmodem.c +++ b/executables/lte-softmodem.c @@ -204,55 +204,6 @@ void nr_slot_select() {}; void NR_UL_indication(NR_UL_IND_t *UL_INFO) {}; void gNB_dlsch_ulsch_scheduler() {}; -/*---------------------BMC: timespec helpers -----------------------------*/ - -struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; -struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; - -struct timespec clock_difftime(struct timespec start, struct timespec end) { - struct timespec temp; - - if ((end.tv_nsec-start.tv_nsec)<0) { - temp.tv_sec = end.tv_sec-start.tv_sec-1; - temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; - } else { - temp.tv_sec = end.tv_sec-start.tv_sec; - temp.tv_nsec = end.tv_nsec-start.tv_nsec; - } - - return temp; -} - -void print_difftimes(void) { -#ifdef DEBUG - printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); -#else - LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); -#endif -} - -void update_difftimes(struct timespec start, struct timespec end) { - struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 }; - int changed = 0; - diff_time = clock_difftime(start, end); - - if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) { - min_diff_time.tv_nsec = diff_time.tv_nsec; - changed = 1; - } - - if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) { - max_diff_time.tv_nsec = diff_time.tv_nsec; - changed = 1; - } - -#if 1 - - if (changed) print_difftimes(); - -#endif -} - /*------------------------------------------------------------------------*/ unsigned int build_rflocal(int txi, int txq, int rxi, int rxq) { diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c index 7de3014ee9..b212ceb3f1 100644 --- a/executables/lte-uesoftmodem.c +++ b/executables/lte-uesoftmodem.c @@ -174,55 +174,6 @@ instance_t CUuniqInstance=0; /* forward declarations */ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); -/*---------------------BMC: timespec helpers -----------------------------*/ - -struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; -struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; - -struct timespec clock_difftime(struct timespec start, struct timespec end) { - struct timespec temp; - - if ((end.tv_nsec-start.tv_nsec)<0) { - temp.tv_sec = end.tv_sec-start.tv_sec-1; - temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; - } else { - temp.tv_sec = end.tv_sec-start.tv_sec; - temp.tv_nsec = end.tv_nsec-start.tv_nsec; - } - - return temp; -} - -void print_difftimes(void) { -#ifdef DEBUG - printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); -#else - LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); -#endif -} - -void update_difftimes(struct timespec start, struct timespec end) { - struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 }; - int changed = 0; - diff_time = clock_difftime(start, end); - - if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) { - min_diff_time.tv_nsec = diff_time.tv_nsec; - changed = 1; - } - - if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) { - max_diff_time.tv_nsec = diff_time.tv_nsec; - changed = 1; - } - -#if 1 - - if (changed) print_difftimes(); - -#endif -} - /*------------------------------------------------------------------------*/ unsigned int build_rflocal(int txi, int txq, int rxi, int rxq) { diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 261dc9a66b..c3875bf267 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -129,52 +129,6 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP) abort(); } -/*---------------------BMC: timespec helpers -----------------------------*/ - -struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; -struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 }; - -struct timespec clock_difftime(struct timespec start, struct timespec end) { - struct timespec temp; - - if ((end.tv_nsec-start.tv_nsec)<0) { - temp.tv_sec = end.tv_sec-start.tv_sec-1; - temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec; - } else { - temp.tv_sec = end.tv_sec-start.tv_sec; - temp.tv_nsec = end.tv_nsec-start.tv_nsec; - } - - return temp; -} - -void print_difftimes(void) -{ - LOG_I(HW, "difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec); -} - -void update_difftimes(struct timespec start, struct timespec end) { - struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 }; - int changed = 0; - diff_time = clock_difftime(start, end); - - if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) { - min_diff_time.tv_nsec = diff_time.tv_nsec; - changed = 1; - } - - if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) { - max_diff_time.tv_nsec = diff_time.tv_nsec; - changed = 1; - } - -#if 1 - - if (changed) print_difftimes(); - -#endif -} - /*------------------------------------------------------------------------*/ unsigned int build_rflocal(int txi, int txq, int rxi, int rxq) { From 2bda52b054faf2f0e99148d5d0d2416d25267fb3 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 19:11:04 +0200 Subject: [PATCH 8/9] rename a global "ru" in root_unit and include correctly the .h file, that leads to mistakes fixes --- openair1/PHY/LTE_TRANSPORT/prach.c | 7 ++- openair1/PHY/LTE_TRANSPORT/prach_common.c | 13 ++--- openair1/PHY/LTE_TRANSPORT/prach_extern.h | 14 ++---- openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c | 47 +++++++------------ .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 3 +- openair1/PHY/defs_UE.h | 2 +- openair1/PHY/defs_eNB.h | 4 +- 7 files changed, 34 insertions(+), 56 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index e220549045..90c9d63925 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -69,8 +69,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, uint32_t preamble_shift2; uint16_t preamble_index0=0,n_shift_ra=0,n_shift_ra_bar; uint16_t d_start=0; - uint16_t numshift=0; - uint16_t *prach_root_sequence_map; + uint16_t numshift = 0; uint8_t not_found; int k=0; uint16_t u; @@ -221,7 +220,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, if (eNB) start_meas(&eNB->rx_prach); - prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; + const uint16_t *prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; // PDP is oversampled, e.g. 1024 sample instead of 839 // Adapt the NCS (zero-correlation zones) with oversampling factor e.g. 1024/839 NCS2 = (N_ZC==839) ? ((NCS<<10)/839) : ((NCS<<8)/139); @@ -495,7 +494,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, new_dft = 0; if (br_flag == 1) { - Xu=(c16_t *)eNB->X_u_br[ce_level][preamble_offset-first_nonzero_root_idx]; + Xu = eNB->X_u_br[ce_level][preamble_offset - first_nonzero_root_idx]; prach_ifft = prach_ifftp[prach_ifft_cnt++]; if (eNB->prach_vars_br.repetition_number[ce_level]==1) memset(prach_ifft,0,((N_ZC==839)?2048:256)*sizeof(int32_t)); diff --git a/openair1/PHY/LTE_TRANSPORT/prach_common.c b/openair1/PHY/LTE_TRANSPORT/prach_common.c index 2d9ef9d712..0939398c60 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach_common.c +++ b/openair1/PHY/LTE_TRANSPORT/prach_common.c @@ -35,12 +35,13 @@ #include "PHY/phy_extern_ue.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/lte/prach_utils.h" +#include "openair1/PHY/LTE_TRANSPORT/prach_extern.h" const uint16_t NCS_unrestricted[16] = {0, 13, 15, 18, 22, 26, 32, 38, 46, 59, 76, 93, 119, 167, 279, 419}; const uint16_t NCS_restricted[15] = {15, 18, 22, 26, 32, 38, 46, 55, 68, 82, 100, 128, 158, 202, 237}; // high-speed case const uint16_t NCS_4[7] = {2, 4, 6, 8, 10, 12, 15}; -int16_t ru[2*839]; // quantized roots of unity +c16_t root_unit[839]; // quantized roots of unity static uint32_t ZC_inv[839]; // multiplicative inverse for roots u uint16_t du[838]; @@ -367,13 +368,13 @@ int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t s return(prach_mask); } - void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t prach_ConfigIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, frame_type_t frame_type, - uint32_t X_u[64][839]) { + c16_t X_u[64][839]) +{ // Compute DFT of x_u => X_u[k] = x_u(inv(u)*k)^* X_u[k] = exp(j\pi u*inv(u)*k*(inv(u)*k+1)/N_ZC) unsigned int k,inv_u,i,NCS=0,num_preambles; int N_ZC; @@ -495,7 +496,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, for (k=0; kframe_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset, tdd_mapindex, Nf); - prach_root_sequence_map = (prach_fmt<4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; + const uint16_t *prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4; /* // this code is not part of get_prach_prb_offset if (frame_type == TDD) { // TDD @@ -215,20 +210,6 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 #endif // nsymb = (frame_parms->Ncp==0) ? 14:12; // subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb; - k = (12*n_ra_prb) - 6*ue->frame_parms.N_RB_UL; - - if (k<0) - k+=ue->frame_parms.ofdm_symbol_size; - - k*=12; - k+=13; - Xu = (int16_t *)ue->X_u[preamble_offset-first_nonzero_root_idx]; - /* - k+=(12*ue->frame_parms.first_carrier_offset); - if (k>(12*ue->frame_parms.ofdm_symbol_size)) - k-=(12*ue->frame_parms.ofdm_symbol_size); - */ - k*=2; switch (ue->frame_parms.N_RB_UL) { case 6: @@ -259,20 +240,26 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 break; } + { + int k = (12 * n_ra_prb) - 6 * ue->frame_parms.N_RB_UL; - for (offset=0,offset2=0; offset= N_ZC) - offset2 -= N_ZC; + if (k < 0) + k += ue->frame_parms.ofdm_symbol_size; - Xu_re = (((int32_t)Xu[offset<<1]*amp)>>15); - Xu_im = (((int32_t)Xu[1+(offset<<1)]*amp)>>15); - prachF[k++]= ((Xu_re*ru[offset2<<1]) - (Xu_im*ru[1+(offset2<<1)]))>>15; - prachF[k++]= ((Xu_im*ru[offset2<<1]) + (Xu_re*ru[1+(offset2<<1)]))>>15; + k *= 12; + k += 13; + c16_t *Xu_ue = ue->X_u[preamble_offset - first_nonzero_root_idx]; + c16_t *complex_prachF = (c16_t *)prachF; + for (int offset = 0, offset2 = 0; offset < N_ZC; offset++, offset2 += preamble_shift) { + if (offset2 >= N_ZC) + offset2 -= N_ZC; + c16_t Xu = c16mulRealShift(*Xu_ue++, amp, 15); + complex_prachF[k++] = c16mulShift(Xu, root_unit[offset2], 15); - if (k==(12*2*ue->frame_parms.ofdm_symbol_size)) - k=0; + if (k == 12 * ue->frame_parms.ofdm_symbol_size) + k = 0; + } } - switch (prach_fmt) { case 0: Ncp = 3168; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index 9aab56e52a..06bf87fc74 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1649,8 +1649,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, frame_type_t frame_type, - uint32_t X_u[64][839]); - + c16_t X_u[64][839]); void init_prach_tables(int N_ZC); diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 17ae02610e..20d5a9ab8d 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -640,7 +640,7 @@ typedef struct { /// mbsfn reference symbols uint32_t lte_gold_mbsfn_khz_1dot25_table[10][150]; - uint32_t X_u[64][839]; + c16_t X_u[64][839]; uint32_t high_speed_flag; uint32_t perfect_ce; diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 68ebf65462..98d1080ee3 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -600,8 +600,8 @@ typedef struct PHY_VARS_eNB_s { // PUCCH1a/b energy detection parameters for eMTC per CE-level int pucch1ab_DTX_threshold_emtc[4]; - uint32_t X_u[64][839]; - uint32_t X_u_br[4][64][839]; + c16_t X_u[64][839]; + c16_t X_u_br[4][64][839]; uint8_t pbch_configured; uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE char eNB_generate_rar; From 13f5c258ca5b188dcd1b3df7e1f3745143b310d6 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 29 Jul 2025 19:24:24 +0200 Subject: [PATCH 9/9] remove unused global --- nfapi/oai_integration/nfapi_pnf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 48e31b7264..3de11d8003 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -88,7 +88,6 @@ extern int nfapi_sync_var; extern int sync_var; nfapi_tx_request_pdu_t *tx_request_pdu[1023][10][10]; // [frame][subframe][max_num_pdus] -nfapi_nr_pdu_t *tx_data_request[1023][20][10]; //[frame][slot][max_num_pdus] uint8_t tx_pdus[32][8][4096]; nfapi_ue_release_request_body_t release_rntis;