From a1ab7321110a9c5338d17032286fed89164d6584 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 2 Apr 2026 19:01:07 +0200 Subject: [PATCH] adding separated NR_PHY_RU library split from LTE one --- CMakeLists.txt | 32 ++++++++++++------- common/utils/actor/actor.h | 2 +- doc/Doxyfile | 2 +- executables/lte-enb.c | 2 +- executables/lte-ru.c | 2 +- executables/nr-ru.c | 2 +- executables/ru_control.c | 2 +- openair1/PHY/INIT/nr_init_ru.c | 1 - openair1/PHY/LTE_TRANSPORT/prach.c | 4 +-- openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c | 2 +- openair1/PHY/MODULATION/beamforming.c | 23 ------------- openair1/PHY/MODULATION/nr_beamforming.c | 26 +++++++++++++++ .../PHY/NR_ESTIMATION/nr_freq_equalization.c | 1 - openair1/PHY/defs_nr_UE.h | 4 +-- openair1/PHY/{LTE_TRANSPORT => }/if4_tools.c | 1 - openair1/PHY/{LTE_TRANSPORT => }/if4_tools.h | 2 +- openair1/SCHED/ru_procedures.c | 2 +- radio/ETHERNET/if_defs.h | 2 +- 18 files changed, 60 insertions(+), 52 deletions(-) create mode 100644 openair1/PHY/MODULATION/nr_beamforming.c rename openair1/PHY/{LTE_TRANSPORT => }/if4_tools.c (99%) rename openair1/PHY/{LTE_TRANSPORT => }/if4_tools.h (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e8758cea3..40aef3aa4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -877,6 +877,10 @@ set(PHY_SRC ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pilots_mbsfn.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c + ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c + ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c + ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c + ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c @@ -893,22 +897,22 @@ set(PHY_SRC ) set(PHY_SRC_RU - ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c + ${OPENAIR1_DIR}/PHY/if4_tools.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/drs_modulation.c - ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c - ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c - ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c - ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_ul.c - ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_nr.c ${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz.c ${OPENAIR1_DIR}/PHY/MODULATION/gen_75KHz.cpp ${OPENAIR1_DIR}/PHY/MODULATION/beamforming.c ${OPENAIR1_DIR}/PHY/MODULATION/compute_bf_weights.c ${OPENAIR1_DIR}/PHY/INIT/lte_init_ru.c - ${OPENAIR1_DIR}/PHY/INIT/nr_init_ru.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c + ) +set(NR_PHY_SRC_RU + ${OPENAIR1_DIR}/PHY/MODULATION/nr_beamforming.c + ${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_nr.c + ${OPENAIR1_DIR}/PHY/INIT/nr_init_ru.c + ${OPENAIR1_DIR}/PHY/if4_tools.c ) set(PHY_SRC_UE @@ -1080,6 +1084,8 @@ target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common add_library(PHY_RU ${PHY_SRC_RU}) target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs UTIL) +add_library(NR_PHY_RU ${NR_PHY_SRC_RU}) + #Layer 2 library ##################### set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC) @@ -1757,6 +1763,10 @@ add_executable(oairu ${OPENAIR_DIR}/executables/lte-ru.c ${OPENAIR_DIR}/executables/ru_control.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c + ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c + ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c + ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c + ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c ${OPENAIR_DIR}/executables/main_ru.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ) @@ -1812,7 +1822,7 @@ add_executable(nr-oru ${OPENAIR_DIR}/executables/main_nr_ru.c ) target_link_libraries(nr-oru PRIVATE - UTIL SCHED_RU_LIB PHY_COMMON PHY_RU PHY_NR shlib_loader z dl + UTIL SCHED_RU_LIB PHY_COMMON NR_PHY_RU PHY_NR shlib_loader z dl radio_common softmodem_common) target_link_libraries(nr-oru PRIVATE pthread m CONFIG_LIB rt ${T_LIB} utils barrier actor) @@ -1836,7 +1846,7 @@ add_executable(nr-softmodem target_link_libraries(nr-softmodem PRIVATE -Wl,--start-group - UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECURITY + UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON NR_PHY_RU GTPV1U SECURITY ITTI ${NAS_UE_LIB} lte_rrc nr_rrc ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU x2ap f1ap m2ap m3ap e1ap radio_common @@ -2027,7 +2037,7 @@ 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) 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 -Wl,--end-group + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR NR_PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -Wl,--end-group m pthread ${T_LIB} ITTI dl physim_common) target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) @@ -2128,7 +2138,7 @@ if (${T_TRACER}) SECURITY SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU + PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU NR_PHY_RU L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE MAC_NR_COMMON MAC_UE_NR ngap GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE SIMU dfts config_internals nr_common crc_byte) diff --git a/common/utils/actor/actor.h b/common/utils/actor/actor.h index 3d7760356c..d49bd88c65 100644 --- a/common/utils/actor/actor.h +++ b/common/utils/actor/actor.h @@ -4,7 +4,7 @@ #ifndef ACTOR_H #define ACTOR_H -#include "notified_fifo.h" +#include "common/utils/threadPool/notified_fifo.h" #define INIT_ACTOR(ptr, name, core_affinity) init_actor((Actor_t *)ptr, name, core_affinity); diff --git a/doc/Doxyfile b/doc/Doxyfile index fad5807544..7c09e6272e 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1967,7 +1967,7 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/dci_NB_IoT.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/group_hopping.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/if4_tools.h \ +@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/if4_tools.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/uci_tools.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/prach.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/LTE_TRANSPORT/edci.c \ diff --git a/executables/lte-enb.c b/executables/lte-enb.c index b62815b70a..c735934c1a 100644 --- a/executables/lte-enb.c +++ b/executables/lte-enb.c @@ -20,7 +20,7 @@ #include "nfapi/oai_integration/vendor_ext.h" #include "radio/COMMON/common_lib.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/phy_extern.h" diff --git a/executables/lte-ru.c b/executables/lte-ru.c index 91470d8f63..a0a82deabd 100644 --- a/executables/lte-ru.c +++ b/executables/lte-ru.c @@ -28,7 +28,7 @@ #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" +#include "PHY/if4_tools.h" #include "PHY/LTE_TRANSPORT/transport_proto.h" #include "SCHED/sched_common.h" #include "common/utils/LOG/log.h" diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 7554c8a9a6..ad2425f358 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -20,7 +20,7 @@ #include "radio/COMMON/common_lib.h" #include "radio/ETHERNET/ethernet_lib.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #include "PHY/defs_nr_common.h" #include "PHY/phy_extern.h" diff --git a/executables/ru_control.c b/executables/ru_control.c index 11a3ef0f14..1852a67afb 100644 --- a/executables/ru_control.c +++ b/executables/ru_control.c @@ -27,7 +27,7 @@ #include "radio/COMMON/common_lib.h" #include "radio/ETHERNET/ethernet_lib.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #include "PHY/LTE_TRANSPORT/transport_proto.h" #include "SCHED/sched_eNB.h" diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 0cbb679f82..71ad18ab62 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -3,7 +3,6 @@ */ #include "PHY/phy_extern.h" -#include "SCHED/sched_common.h" #include "assertions.h" #include #include "openair1/PHY/defs_RU.h" diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index b821aa758e..6751f68da0 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -7,9 +7,7 @@ */ #include "PHY/sse_intrin.h" #include "PHY/defs_eNB.h" -//#include "PHY/phy_extern.h" -//#include "prach.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #include "SCHED/sched_eNB.h" #include "common/utils/LOG/vcd_signal_dumper.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 62268ef930..b5abfdea92 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -10,7 +10,7 @@ #include "executables/lte-softmodem.h" #include "PHY/phy_extern_ue.h" //#include "prach.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #include "SCHED_UE/sched_UE.h" #include "SCHED/sched_common_extern.h" diff --git a/openair1/PHY/MODULATION/beamforming.c b/openair1/PHY/MODULATION/beamforming.c index 56def37b41..f65a1bac48 100644 --- a/openair1/PHY/MODULATION/beamforming.c +++ b/openair1/PHY/MODULATION/beamforming.c @@ -9,7 +9,6 @@ #include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h" #include "modulation_eNB.h" -#include "nr_modulation.h" #include "common/utils/LOG/vcd_signal_dumper.h" int beam_precoding(int32_t **txdataF, @@ -80,25 +79,3 @@ int beam_precoding_one_eNB(int32_t **txdataF, } return 0; } - - -void nr_beam_precoding(c16_t **txdataF, - c16_t **txdataF_BF, - NR_DL_FRAME_PARMS *frame_parms, - int32_t ***beam_weights, - int symbol, - int aa, - int nb_antenna_ports, - int offset) -{ - // clear txdata_BF[aa][re] for each call of ue_spec_beamforming - memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size], 0, sizeof(c16_t) *(frame_parms->ofdm_symbol_size)); - - for (int p = 0; p < nb_antenna_ports; p++) { - multadd_cpx_vector((c16_t *)&txdataF[p][(symbol * frame_parms->ofdm_symbol_size) + offset], - (c16_t *)beam_weights[p][aa], - (c16_t *)&txdataF_BF[aa][symbol * frame_parms->ofdm_symbol_size], - frame_parms->ofdm_symbol_size, - 15); - } -} diff --git a/openair1/PHY/MODULATION/nr_beamforming.c b/openair1/PHY/MODULATION/nr_beamforming.c new file mode 100644 index 0000000000..65084e401c --- /dev/null +++ b/openair1/PHY/MODULATION/nr_beamforming.c @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: LicenseRef-CSSL-1.0 + */ + +#include "nr_modulation.h" + +void nr_beam_precoding(c16_t **txdataF, + c16_t **txdataF_BF, + NR_DL_FRAME_PARMS *frame_parms, + int32_t ***beam_weights, + int symbol, + int aa, + int nb_antenna_ports, + int offset) +{ + // clear txdata_BF[aa][re] for each call of ue_spec_beamforming + memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size], 0, sizeof(c16_t) *(frame_parms->ofdm_symbol_size)); + + for (int p = 0; p < nb_antenna_ports; p++) { + multadd_cpx_vector((c16_t *)&txdataF[p][(symbol * frame_parms->ofdm_symbol_size) + offset], + (c16_t *)beam_weights[p][aa], + (c16_t *)&txdataF_BF[aa][symbol * frame_parms->ofdm_symbol_size], + frame_parms->ofdm_symbol_size, + 15); + } +} diff --git a/openair1/PHY/NR_ESTIMATION/nr_freq_equalization.c b/openair1/PHY/NR_ESTIMATION/nr_freq_equalization.c index fd7530b0d9..75589c75f8 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_freq_equalization.c +++ b/openair1/PHY/NR_ESTIMATION/nr_freq_equalization.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: LicenseRef-CSSL-1.0 */ -#include "PHY/defs_eNB.h" #include "PHY/sse_intrin.h" #include "PHY/NR_ESTIMATION/nr_ul_estimation.h" diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 63771f7125..c0326693a2 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -28,8 +28,8 @@ #include "common_lib.h" #include "fapi_nr_ue_interface.h" #include "assertions.h" -#include "barrier.h" -#include "actor.h" +#include "common/utils/barrier/barrier.h" +#include "common/utils/actor/actor.h" //#include "openair1/SCHED_NR_UE/defs.h" #define msg(aRGS...) LOG_D(PHY, ##aRGS) diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/if4_tools.c similarity index 99% rename from openair1/PHY/LTE_TRANSPORT/if4_tools.c rename to openair1/PHY/if4_tools.c index 66097fc87f..5c5428db90 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/if4_tools.c @@ -3,7 +3,6 @@ */ #include -//#include "PHY/defs_eNB.h" #include "PHY/defs_RU.h" #include "PHY/TOOLS/alaw_lut.h" //#include "PHY/phy_extern.h" diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.h b/openair1/PHY/if4_tools.h similarity index 96% rename from openair1/PHY/LTE_TRANSPORT/if4_tools.h rename to openair1/PHY/if4_tools.h index 3cc30f7710..367ccfa859 100644 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.h +++ b/openair1/PHY/if4_tools.h @@ -4,7 +4,7 @@ #ifndef __IF4_TOOLS_H__ #define __IF4_TOOLS_H__ -#include "PHY/defs_eNB.h" +#include "openair1/PHY/defs_RU.h" /// Macro for IF4 packet type #define IF4p5_PACKET_TYPE 0x080A diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 065c66d14c..8162d11699 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -10,7 +10,7 @@ #include "PHY/defs_eNB.h" #include "SCHED/sched_eNB.h" #include "PHY/MODULATION/modulation_eNB.h" -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" diff --git a/radio/ETHERNET/if_defs.h b/radio/ETHERNET/if_defs.h index e357858137..9e5ec6818e 100644 --- a/radio/ETHERNET/if_defs.h +++ b/radio/ETHERNET/if_defs.h @@ -9,7 +9,7 @@ #include #ifndef LITE_COMPILATION -#include "PHY/LTE_TRANSPORT/if4_tools.h" +#include "PHY/if4_tools.h" #endif // ETH transport preference modes