diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c3fb4db43..410aa6497e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -532,7 +532,7 @@ add_library(f1ap ${F1AP_DIR}/f1ap_itti_messaging.c) target_include_directories(f1ap PUBLIC F1AP_DIR) target_link_libraries(f1ap PUBLIC asn1_f1ap GTPV1U) -target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE f1ap_lib) +target_link_libraries(f1ap PRIVATE ngap nr_rrc ds f1ap_lib) target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib) if(E2_AGENT) target_compile_definitions(f1ap PRIVATE E2_AGENT) @@ -570,8 +570,6 @@ target_link_libraries(params_libconfig PRIVATE config_internals ${libconfig_LIBR add_library(shlib_loader OBJECT common/utils/load_module_shlib.c) target_link_libraries(shlib_loader PRIVATE CONFIG_LIB) -include_directories ("${OPENAIR_DIR}/radio/COMMON") - ############################################################## # ???!!! TO BE DOCUMENTED OPTIONS !!!??? ############################################################## @@ -672,12 +670,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils/T # set the T_LIB name to T if the target exists, otherwise leave empty set(T_LIB $) -add_library(HASHTABLE - ${OPENAIR_DIR}/common/utils/hashtable/hashtable.c - ${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c -) -include_directories(${OPENAIR_DIR}/common/utils/hashtable) - add_library(UTIL ${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c ${OPENAIR2_DIR}/UTIL/OPT/probe.c @@ -835,24 +827,6 @@ include_directories(${NFAPI_USER_DIR}) # Layer 1 ############################# -set(PHY_POLARSRC - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_init.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_crc_byte.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoder.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_encoder.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_interleaving_pattern.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_kronecker_power_matrices.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_procedures.c - ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_sequence_pattern.c -) -set(PHY_SMALLBLOCKSRC - ${OPENAIR1_DIR}/PHY/CODING/nrSmallBlock/encodeSmallBlock.c - ${OPENAIR1_DIR}/PHY/CODING/nrSmallBlock/decodeSmallBlock.c -) set(PHY_TURBOIF ${OPENAIR1_DIR}/PHY/CODING/coding_load.c ) @@ -863,8 +837,6 @@ set(PHY_NRLDPC_CODINGIF add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c) -add_library(crc_byte OBJECT ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c) - set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c @@ -1033,8 +1005,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c - ${PHY_POLARSRC} - ${PHY_SMALLBLOCKSRC} ${PHY_NRLDPC_CODINGIF} ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/srs_rx.c @@ -1084,8 +1054,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c ${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c - ${PHY_POLARSRC} - ${PHY_SMALLBLOCKSRC} ${PHY_NRLDPC_CODINGIF} ) @@ -1119,14 +1087,14 @@ add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON}) target_link_libraries(PHY_NR_COMMON PUBLIC UTIL) add_library(PHY_NR ${PHY_NR_SRC}) -target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5) +target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5 polar smallblock) add_library(PHY_NR_NO_AVX_256 ${PHY_NR_SRC}) target_link_libraries(PHY_NR_NO_AVX_256 nr_phy_common nr_common) target_compile_definitions(PHY_NR_NO_AVX_256 PUBLIC USE_128BIT) add_library(PHY_NR_UE ${PHY_NR_UE_SRC}) -target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common UTIL) +target_link_libraries(PHY_NR_UE PRIVATE asn1_nr_rrc_hdrs nr_phy_common nr_common UTIL polar smallblock) add_library(PHY_RU ${PHY_SRC_RU}) target_link_libraries(PHY_RU PRIVATE asn1_lte_rrc_hdrs UTIL) @@ -1784,12 +1752,9 @@ add_executable(lte-softmodem ${OPENAIR_DIR}/executables/lte-ru.c ${OPENAIR_DIR}/executables/ru_control.c ${OPENAIR_DIR}/executables/lte-softmodem.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR_DIR}/executables/create_tasks.c ${OPENAIR_DIR}/executables/create_tasks_mbms.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${PHY_INTERFACE_DIR}/queue_t.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c @@ -1800,9 +1765,9 @@ add_dependencies(lte-softmodem oai_iqplayer) target_link_libraries(lte-softmodem PRIVATE -Wl,--start-group - lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB + lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U SECURITY UTIL SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI SIMU shlib_loader + ${NAS_UE_LIB} ITTI SIMU radio_common softmodem_common -Wl,--end-group z dl) target_link_libraries(lte-softmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1818,16 +1783,13 @@ endif() add_executable(oairu ${OPENAIR_DIR}/executables/lte-ru.c ${OPENAIR_DIR}/executables/ru_control.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c ${OPENAIR_DIR}/executables/main_ru.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ) target_link_libraries(oairu PRIVATE -Wl,--start-group - SCHED_RU_LIB PHY_COMMON PHY_RU UTIL shlib_loader + SCHED_RU_LIB PHY_COMMON PHY_RU UTIL radio_common softmodem_common -Wl,--end-group z dl) target_link_libraries(oairu PRIVATE pthread m CONFIG_LIB rt ${T_LIB}) @@ -1844,10 +1806,7 @@ target_link_libraries(lte-softmodem PRIVATE add_executable(lte-uesoftmodem ${OPENAIR_DIR}/executables/lte-ue.c ${OPENAIR_DIR}/executables/lte-uesoftmodem.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/executables/create_tasks_ue.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.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 @@ -1857,9 +1816,9 @@ add_executable(lte-uesoftmodem target_link_libraries(lte-uesoftmodem PRIVATE -Wl,--start-group lte_rrc nr_rrc s1ap x2ap m2ap m3ap - SECURITY UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON + SECURITY UTIL SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU L2_UE L2_LTE SIMU NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${NAS_UE_LIB} ITTI shlib_loader + ${NAS_UE_LIB} ITTI radio_common softmodem_common -Wl,--end-group z dl) target_link_libraries(lte-uesoftmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1878,13 +1837,11 @@ add_executable(nr-oru ${OPENAIR_DIR}/openair1/SCHED_NR/phy_frame_config_nr.c ${OPENAIR_DIR}/openair1/SCHED_NR/nr_prach_procedures.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${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 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) target_link_libraries(nr-oru PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs nr_phy_common time_management) @@ -1899,9 +1856,6 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/executables/nr-gnb.c ${OPENAIR_DIR}/executables/nr-ru.c ${OPENAIR_DIR}/executables/nr-softmodem.c - ${OPENAIR_DIR}/executables/softmodem-common.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -1910,11 +1864,11 @@ add_executable(nr-softmodem 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 SECURITY + UTIL SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON 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 shlib_loader - time_management + x2ap f1ap m2ap m3ap e1ap radio_common + time_management softmodem_common -Wl,--end-group z dl) target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt) @@ -1944,7 +1898,6 @@ target_link_libraries(nr-softmodem PRIVATE add_executable(nr-cuup executables/nr-cuup.c - executables/softmodem-common.c ${NR_RRC_DIR}/rrc_gNB_UE_context.c ${OPENAIR2_DIR}/E1AP/e1ap_setup.c ${NR_PDCP_SRC} @@ -1954,9 +1907,9 @@ add_executable(nr-cuup target_link_libraries(nr-cuup PRIVATE CONFIG_LIB ITTI SCTP_CLIENT GTPV1U e1ap f1ap - time_management + time_management softmodem_common alg - z dl pthread shlib_loader ${T_LIB}) + z dl pthread ${T_LIB}) target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) if(E2_AGENT) target_link_libraries(nr-cuup PRIVATE e2_agent e2_agent_arg e2_ran_func_cuup) @@ -1973,11 +1926,6 @@ add_executable(nr-uesoftmodem ${OPENAIR_DIR}/executables/position_interface.c ${OPENAIR_DIR}/executables/nr-ue.c ${OPENAIR_DIR}/executables/nr-ue-ru.c - ${OPENAIR_DIR}/executables/softmodem-common.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/radio/COMMON/record_player.c - ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c - ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common_tdd.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ${NFAPI_USER_DIR}/nfapi.c ${PHY_INTERFACE_DIR}/queue_t.c @@ -1985,10 +1933,10 @@ add_executable(nr-uesoftmodem target_link_libraries(nr-uesoftmodem PRIVATE -Wl,--start-group - nr_rrc SECURITY UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB + nr_rrc SECURITY UTIL SCHED_RU_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE MAC_NR_COMMON NFAPI_LIB - ITTI SIMU shlib_loader - time_management + ITTI SIMU radio_common + time_management softmodem_common -Wl,--end-group z dl) target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt nr_ue_phy_meas) @@ -2021,10 +1969,10 @@ target_link_libraries(nr-uesoftmodem PRIVATE add_executable(rftest ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c - ${OPENAIR_DIR}/radio/COMMON/common_lib.c - ${OPENAIR_DIR}/executables/softmodem-common.c ) -target_link_libraries(rftest PRIVATE minimal_lib PHY_NR_COMMON UTIL forms pthread dl m ${T_LIB} shlib_loader) +target_link_libraries(rftest PRIVATE + minimal_lib PHY_NR_COMMON UTIL forms pthread dl m ${T_LIB} + radio_common softmodem_common) target_link_libraries(rftest PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) add_executable(polartest @@ -2041,7 +1989,7 @@ add_executable(smallblocktest target_link_libraries(smallblocktest PRIVATE -Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group - m pthread dl shlib_loader ${T_LIB} + m pthread dl ${T_LIB} ) @@ -2051,7 +1999,7 @@ add_executable(ldpctest ) target_link_libraries(ldpctest PRIVATE -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON -Wl,--end-group - m pthread dl shlib_loader ${T_LIB} + m pthread dl ${T_LIB} # link 'check_crc' to make it resolved in the LDPC coding libraries # 'check_crc' is not used in ldpctest so it is not linked in the executable by default # --whole-archive links 'check_crc' in the executable even though it is note used, see 'man ld' @@ -2064,54 +2012,53 @@ target_link_libraries(physim_common PRIVATE UTIL) add_executable(nr_dlschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c) 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 ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) target_link_libraries(nr_dlschsim PRIVATE asn1_nr_rrc_hdrs) add_executable(nr_pbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c) 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 ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) target_link_libraries(nr_pbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_psbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/psbchsim.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_psbchsim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -lz -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON CONFIG_LIB L2_NR -Wl,--end-group + m pthread ${T_LIB} ITTI dl physim_common softmodem_common ) target_link_libraries(nr_psbchsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_pucchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c) 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 ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) 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 - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ) 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_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group + m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common + softmodem_common ) 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 -lz -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader physim_common) + -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 + m pthread ${T_LIB} ITTI dl physim_common) target_link_libraries(nr_prachsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_ulschsim @@ -2120,35 +2067,33 @@ add_executable(nr_ulschsim ) 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 ${T_LIB} ITTI dl shlib_loader physim_common + m pthread ${T_LIB} ITTI dl physim_common ) 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 - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ) 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_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group - m pthread ${T_LIB} ITTI dl shlib_loader nr_ue_phy_meas physim_common + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR x2ap SECURITY ngap -Wl,--end-group + m pthread ${T_LIB} ITTI dl nr_ue_phy_meas physim_common softmodem_common ) target_link_libraries(nr_ulsim PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs) add_executable(nr_srssim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/srssim.c - ${OPENAIR_DIR}/executables/softmodem-common.c ${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/gnb_ind_vars.c ${PHY_INTERFACE_DIR}/queue_t.c ) target_link_libraries(nr_srssim PRIVATE - -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc L2_NR -lz -Wl,--end-group - m pthread ITTI dl nr_ue_phy_meas physim_common + -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc L2_NR -Wl,--end-group + m pthread ITTI dl nr_ue_phy_meas physim_common softmodem_common ) if(CUDA_ENABLE) @@ -2173,7 +2118,7 @@ foreach(myExe dlsim ulsim) ) target_link_libraries (${myExe} PRIVATE -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 ${T_LIB} dl shlib_loader + pthread m rt CONFIG_LIB ${T_LIB} dl ) target_link_libraries(${myExe} PRIVATE asn1_lte_rrc_hdrs) add_dependencies(${myExe} coding) @@ -2212,7 +2157,7 @@ if (${T_TRACER}) #all "add_library" definitions ITTI lte_rrc nr_rrc s1ap x2ap m2ap m3ap f1ap params_libconfig - oai_eth_transpro HASHTABLE UTIL + oai_eth_transpro UTIL 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 @@ -2265,6 +2210,7 @@ if(ENABLE_TESTS) endif() add_subdirectory(common) +add_subdirectory(executables) add_subdirectory(doc) add_subdirectory(nfapi) add_subdirectory(openair1) diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt index 395139132d..f4611914d4 100644 --- a/common/utils/CMakeLists.txt +++ b/common/utils/CMakeLists.txt @@ -14,12 +14,9 @@ add_subdirectory(nr) add_subdirectory(LOG) add_subdirectory(threadPool) add_subdirectory(time_manager) -add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c) +add_library(utils utils.c system.c time_meas.c time_stat.c tuntap_if.c reverse_bits.c) target_include_directories(utils PUBLIC .) target_link_libraries(utils PRIVATE ${T_LIB}) -if (ENABLE_TESTS) - add_subdirectory(hashtable/tests) -endif() add_subdirectory(barrier) add_subdirectory(actor) add_subdirectory(shm_iq_channel) diff --git a/common/utils/ds/CMakeLists.txt b/common/utils/ds/CMakeLists.txt index b5f5efb47a..22dc7a3c63 100644 --- a/common/utils/ds/CMakeLists.txt +++ b/common/utils/ds/CMakeLists.txt @@ -2,6 +2,8 @@ add_library(ds OBJECT byte_array.c byte_array_producer.c seq_arr.c + hashtable.c + obj_hashtable.c ) target_include_directories(ds PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/common/utils/hashtable/hashtable.c b/common/utils/ds/hashtable.c similarity index 100% rename from common/utils/hashtable/hashtable.c rename to common/utils/ds/hashtable.c diff --git a/common/utils/hashtable/hashtable.h b/common/utils/ds/hashtable.h similarity index 100% rename from common/utils/hashtable/hashtable.h rename to common/utils/ds/hashtable.h diff --git a/common/utils/hashtable/obj_hashtable.c b/common/utils/ds/obj_hashtable.c similarity index 100% rename from common/utils/hashtable/obj_hashtable.c rename to common/utils/ds/obj_hashtable.c diff --git a/common/utils/hashtable/obj_hashtable.h b/common/utils/ds/obj_hashtable.h similarity index 100% rename from common/utils/hashtable/obj_hashtable.h rename to common/utils/ds/obj_hashtable.h diff --git a/common/utils/ds/tests/CMakeLists.txt b/common/utils/ds/tests/CMakeLists.txt index a3ef512f09..a38fba2dab 100644 --- a/common/utils/ds/tests/CMakeLists.txt +++ b/common/utils/ds/tests/CMakeLists.txt @@ -2,3 +2,9 @@ add_executable(test_seq_arr test_seq_array.c) target_link_libraries(test_seq_arr ds alg) add_dependencies(tests test_seq_arr) add_test(NAME test_seq_arr COMMAND test_seq_arr) # no options required + +add_executable(test_hashtable test_hashtable.cpp) +add_dependencies(tests test_hashtable) +target_link_libraries(test_hashtable PRIVATE ds GTest::gtest) +add_test(NAME test_hashtable + COMMAND ./test_hashtable) diff --git a/common/utils/hashtable/tests/test_hashtable.cpp b/common/utils/ds/tests/test_hashtable.cpp similarity index 100% rename from common/utils/hashtable/tests/test_hashtable.cpp rename to common/utils/ds/tests/test_hashtable.cpp diff --git a/common/utils/hashtable/tests/CMakeLists.txt b/common/utils/hashtable/tests/CMakeLists.txt deleted file mode 100644 index baf2461262..0000000000 --- a/common/utils/hashtable/tests/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(test_hashtable test_hashtable.cpp) -add_dependencies(tests test_hashtable) -target_link_libraries(test_hashtable PRIVATE HASHTABLE GTest::gtest) -add_test(NAME test_hashtable - COMMAND ./test_hashtable) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index cfbb09e939..75715ef369 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -37,7 +37,6 @@ #include "nr_common.h" #include #include -#include #define C_SRS_NUMBER (64) #define B_SRS_NUMBER (4) @@ -112,46 +111,6 @@ static const unsigned short srs_bandwidth_config[C_SRS_NUMBER][B_SRS_NUMBER][2] /* 63 */ {{272, 1}, {16, 17}, {8, 2}, {4, 2}}, }; -static const uint8_t bit_reverse_table_256[] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, - 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, - 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, - 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, - 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, - 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, - 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF}; - -void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out) -{ - DevAssert(in != NULL); - DevAssert(out != NULL); - -// Bit reversal implementation based on https://wunkolo.github.io/post/2020/11/gf2p8affineqb-bit-reversal/ -#if defined(__GFNI__) && defined(__AVX512F__) - int simde_sz = 64; - int i = 0; - int simde_bound = sz - simde_sz; - for (; i <= simde_bound; i += simde_sz) { - __m512i input = _mm512_loadu_epi8(&in[i]); - __m512i reversed = _mm512_gf2p8affine_epi64_epi8(input, _mm512_set1_epi64(0x8040201008040201), 0); - _mm512_storeu_epi8(&out[i], reversed); - } - - for (; i < sz; ++i) { - out[i] = bit_reverse_table_256[in[i]]; - } -#else - for(size_t i = 0; i < sz; ++i) - out[i] = bit_reverse_table_256[in[i]]; -#endif -} - /** @brief 3GPP TS 38.133 Table 10.1.6.1-1 mapping from dBm to RSRP index */ uint8_t get_rsrp_index(int rsrp_dBm) { @@ -163,31 +122,6 @@ uint8_t get_rsrp_index(int rsrp_dBm) return (uint8_t)index; } -// Reverse bits implementation based on http://graphics.stanford.edu/~seander/bithacks.html -uint64_t reverse_bits(uint64_t in, int n_bits) -{ - // Reverse n_bits in uint64_t variable, example: - // n_bits: 10 - // in: 10 0000 1111 - // return: 11 1100 0001 - - AssertFatal(n_bits <= 64, "Maximum bits to reverse is 64, impossible to reverse %d bits!\n", n_bits); - uint64_t rev_bits = 0; - uint8_t *p = (uint8_t *)∈ - uint8_t *q = (uint8_t *)&rev_bits; - int n_bytes = n_bits >> 3; - for (int n = 0; n < n_bytes; n++) { - q[n_bytes - 1 - n] = bit_reverse_table_256[p[n]]; - } - - // Reverse remaining bits (not aligned with 8-bit) - rev_bits = rev_bits << (n_bits % 8); - for (int i = n_bytes * 8; i < n_bits; i++) { - rev_bits |= ((in >> i) & 0x1) << (n_bits - i - 1); - } - return rev_bits; -} - #define NUM_BW_ENTRIES 15 static const int tables_5_3_2[5][NUM_BW_ENTRIES] = { diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 42ea232140..ada9813373 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -286,9 +286,6 @@ static inline void warn_higher_threequarter_fs(const int n_rb, const int mu) mu); } -uint64_t reverse_bits(uint64_t in, int n_bits); -void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out); - uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn); uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw); diff --git a/common/utils/reverse_bits.c b/common/utils/reverse_bits.c new file mode 100644 index 0000000000..525929c557 --- /dev/null +++ b/common/utils/reverse_bits.c @@ -0,0 +1,92 @@ +/* + * 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 "reverse_bits.h" +// we avoid assertions.h as it necessitates othe dependencies (e.g., exit_function) +#include +#include + +static const uint8_t bit_reverse_table_256[] = { + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, + 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, + 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, + 0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, 0x06, 0x86, 0x46, 0xC6, + 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, + 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, + 0x31, 0xB1, 0x71, 0xF1, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD, + 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, + 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, + 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF}; + +void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out) +{ + assert(in != NULL); + assert(out != NULL); + +// Bit reversal implementation based on https://wunkolo.github.io/post/2020/11/gf2p8affineqb-bit-reversal/ +#if defined(__GFNI__) && defined(__AVX512F__) + int simde_sz = 64; + int i = 0; + int simde_bound = sz - simde_sz; + for (; i <= simde_bound; i += simde_sz) { + __m512i input = _mm512_loadu_epi8(&in[i]); + __m512i reversed = _mm512_gf2p8affine_epi64_epi8(input, _mm512_set1_epi64(0x8040201008040201), 0); + _mm512_storeu_epi8(&out[i], reversed); + } + + for (; i < sz; ++i) { + out[i] = bit_reverse_table_256[in[i]]; + } +#else + for(size_t i = 0; i < sz; ++i) + out[i] = bit_reverse_table_256[in[i]]; +#endif +} + + +// Reverse bits implementation based on http://graphics.stanford.edu/~seander/bithacks.html +uint64_t reverse_bits(uint64_t in, int n_bits) +{ + // Reverse n_bits in uint64_t variable, example: + // n_bits: 10 + // in: 10 0000 1111 + // return: 11 1100 0001 + + assert(n_bits <= 64); // Maximum bits to reverse is 64 + uint64_t rev_bits = 0; + uint8_t *p = (uint8_t *)∈ + uint8_t *q = (uint8_t *)&rev_bits; + int n_bytes = n_bits >> 3; + for (int n = 0; n < n_bytes; n++) { + q[n_bytes - 1 - n] = bit_reverse_table_256[p[n]]; + } + + // Reverse remaining bits (not aligned with 8-bit) + rev_bits = rev_bits << (n_bits % 8); + for (int i = n_bytes * 8; i < n_bits; i++) { + rev_bits |= ((in >> i) & 0x1) << (n_bits - i - 1); + } + return rev_bits; +} + diff --git a/common/utils/reverse_bits.h b/common/utils/reverse_bits.h new file mode 100644 index 0000000000..5627ba4b6d --- /dev/null +++ b/common/utils/reverse_bits.h @@ -0,0 +1,31 @@ +/* + * 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 REVERSE_BITS_H_ +#define REVERSE_BITS_H_ + +#include +#include + +uint64_t reverse_bits(uint64_t in, int n_bits); +void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out); + +#endif /* REVERSE_BITS_H_ */ diff --git a/executables/CMakeLists.txt b/executables/CMakeLists.txt new file mode 100644 index 0000000000..d3b925bb02 --- /dev/null +++ b/executables/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(softmodem_common STATIC softmodem-common.c) +target_link_libraries(softmodem_common PUBLIC shlib_loader) diff --git a/openair1/PHY/CODING/CMakeLists.txt b/openair1/PHY/CODING/CMakeLists.txt index f696c71213..cdfbbf6f6f 100644 --- a/openair1/PHY/CODING/CMakeLists.txt +++ b/openair1/PHY/CODING/CMakeLists.txt @@ -66,5 +66,9 @@ if (ENABLE_LDPC_CUDA) add_dependencies(nr_dlschsim ldpc_cuda) endif() +add_library(crc_byte OBJECT crc_byte.c) + add_subdirectory(nrLDPC_coding) add_subdirectory(nrLDPC_decoder) +add_subdirectory(nrPolar_tools) +add_subdirectory(nrSmallBlock) diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c index 31ca0b387b..89f16bb706 100644 --- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c +++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_aal/nrLDPC_coding_aal.c @@ -5,6 +5,7 @@ #include "../nrLDPC_coding_interface.h" #include "nrLDPC_coding_aal.h" #include "PHY/sse_intrin.h" +#include "reverse_bits.h" #include #define NR_LDPC_ENABLE_PARITY_CHECK diff --git a/openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt b/openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt new file mode 100644 index 0000000000..14e3e816e1 --- /dev/null +++ b/openair1/PHY/CODING/nrPolar_tools/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(polar STATIC + nr_polar_init.c + nr_bitwise_operations.c + nr_crc_byte.c + nr_polar_decoder.c + nr_polar_decoding_tools.c + nr_polar_encoder.c + nr_polar_interleaving_pattern.c + nr_polar_kernal_operation.c + nr_polar_kronecker_power_matrices.c + nr_polar_matrix_and_array.c + nr_polar_procedures.c + nr_polar_sequence_pattern.c +) +target_link_libraries(polar PRIVATE utils) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c index cf1df52ac0..506d185e89 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c @@ -30,8 +30,8 @@ * \warning */ -#include "common/utils/nr/nr_common.h" #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" +#include "reverse_bits.h" #include #include #include diff --git a/openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt b/openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt new file mode 100644 index 0000000000..63f0361c74 --- /dev/null +++ b/openair1/PHY/CODING/nrSmallBlock/CMakeLists.txt @@ -0,0 +1 @@ +add_library(smallblock STATIC encodeSmallBlock.c decodeSmallBlock.c) diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index c5edd4cfde..2aa2a113ad 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -35,6 +35,7 @@ #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/sse_intrin.h" #include "executables/softmodem-common.h" +#include "reverse_bits.h" #include "openair1/PHY/NR_REFSIG/nr_refsig_common.h" #include "openair1/PHY/NR_REFSIG/nr_mod_table.h" #include "openair1/PHY/TOOLS/tools_defs.h" diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index e814fe1c86..61bdce06b2 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -49,6 +49,7 @@ #include "nfapi/oai_integration/vendor_ext.h" #include "nfapi/oai_integration/vendor_ext.h" #include "SCHED_NR/sched_nr.h" +#include "reverse_bits.h" #include "T.h" #include "nr_phy_common.h" diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 8d3ac6db21..613e70be0d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -38,6 +38,7 @@ #include #include "openair1/PHY/NR_REFSIG/nr_refsig_common.h" #include "PHY/nr_phy_common/inc/nr_phy_common.h" +#include "reverse_bits.h" #include "instrumentation.h" //#define DEBUG_PBCH //#define DEBUG_PBCH_ENCODING diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index bbb5c81873..51285edd0b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -39,6 +39,7 @@ #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include #include "common/utils/LOG/log.h" +#include "reverse_bits.h" #include "openair1/PHY/NR_REFSIG/nr_refsig.h" #include "T.h" diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 6b69959168..d11e6573c7 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -414,22 +414,6 @@ typedef struct NbIoTRrcConfigurationReq_s { long ue_TimersAndConstants_n311_NB; } NbIoTRrcConfigurationReq; -// gNB: GNB_APP -> RRC messages -typedef struct NRRrcConfigurationReq_s { - uint32_t tac; - plmn_id_t plmn[PLMN_LIST_MAX_SIZE]; - uint8_t num_plmn; - - bool um_on_default_drb; - bool enable_sdap; -} gNB_RrcConfigurationReq; - -typedef struct NRDuDlReq_s { - rnti_t rnti; - uint8_t *buf; - uint64_t srb_id; -} NRDuDlReq_t; - // eNB: realtime -> RRC messages typedef struct rrc_subframe_process_s { protocol_ctxt_t ctxt; diff --git a/openair2/F1AP/CMakeLists.txt b/openair2/F1AP/CMakeLists.txt index 53ab2823ed..052964b3e1 100644 --- a/openair2/F1AP/CMakeLists.txt +++ b/openair2/F1AP/CMakeLists.txt @@ -3,7 +3,7 @@ add_subdirectory(MESSAGES) if(ENABLE_TESTS) add_executable(f1ap_ids_test f1ap_ids_test.c f1ap_ids.c) - target_link_libraries(f1ap_ids_test HASHTABLE minimal_lib) + target_link_libraries(f1ap_ids_test ds minimal_lib) add_dependencies(tests f1ap_ids_test) add_test(NAME F1AP_ID_test COMMAND f1ap_ids_test) diff --git a/openair2/F1AP/f1ap_ids.c b/openair2/F1AP/f1ap_ids.c index 5569d60c48..d222d9e35a 100644 --- a/openair2/F1AP/f1ap_ids.c +++ b/openair2/F1AP/f1ap_ids.c @@ -25,7 +25,7 @@ #include "f1ap_ids.h" #include -#include "common/utils/hashtable/hashtable.h" +#include "ds/hashtable.h" #include "common/utils/assertions.h" diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 3a8f580471..7e624c04a8 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2092,7 +2092,7 @@ gNB_RRC_INST *RCconfig_NRRRC() // search if in active list - gNB_RrcConfigurationReq nrrrc_config = {0}; + nr_rrc_config_t nrrrc_config = {0}; for (k=0; k #include #include -#include "LAYER2/MAC/mac_extern.h" -#include "LTE_DRB-ToAddModList.h" -#include "LTE_DRB-ToReleaseList.h" -#include "LTE_PMCH-InfoList-r9.h" -#include "LTE_SRB-ToAddModList.h" #include "NR_DRB-ToAddMod.h" #include "NR_QFI.h" #include "NR_SDAP-Config.h" @@ -53,7 +48,7 @@ #include "f1ap_messages_types.h" #include "gnb_config.h" #include "gtpv1_u_messages_types.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "intertask_interface.h" #include "common/utils/LOG/log.h" #include "nfapi/oai_integration/vendor_ext.h" diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 42030133af..73845551af 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -35,6 +35,7 @@ #include "NR_MAC_UE/mac_proto.h" #include "assertions.h" #include "SCHED_NR_UE/fapi_nr_ue_l1.h" +#include "reverse_bits.h" #include "openair2/RRC/NR_UE/L2_interface_ue.h" #define MAX_IF_MODULES 100 diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index c8ea0fa878..6b327d92bc 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -35,7 +35,7 @@ #include #include "assertions.h" -#include "hashtable.h" +#include "ds/hashtable.h" #include "oai_asn1.h" #include "rrc_defs.h" #include "rrc_extern.h" diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 2c3cf2717a..57fb3daf12 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -325,7 +325,6 @@ int do_RRCSetup(uint8_t *const buffer, const uint8_t transaction_id, const uint8_t *masterCellGroup, int masterCellGroup_len, - const gNB_RrcConfigurationReq *configuration, NR_SRB_ToAddModList_t *SRBs) //------------------------------------------------------------------------------ { diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 2e955f8cff..d6783211a6 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -32,6 +32,7 @@ #define __RRC_NR_MESSAGES_ASN1_MSG__H__ #include +#include "common/platform_constants.h" #include #include #include "NR_ARFCN-ValueNR.h" @@ -52,10 +53,10 @@ #include "NR_SecurityConfig.h" #include "NR_MeasurementReport.h" #include "NR_MeasurementTimingConfiguration.h" +#include "NR_UE-NR-Capability.h" #include "NR_UE-CapabilityRAT-ContainerList.h" #include "ds/seq_arr.h" #include "ds/byte_array.h" -#include "rrc_messages_types.h" #include "openair2/LAYER2/nr_pdcp/nr_pdcp_configuration.h" #include "common/utils/nr/nr_common.h" struct asn_TYPE_descriptor_s; @@ -95,7 +96,6 @@ int do_RRCSetup(uint8_t *const buffer, const uint8_t transaction_id, const uint8_t *masterCellGroup, int masterCellGroup_len, - const gNB_RrcConfigurationReq *configuration, NR_SRB_ToAddModList_t *SRBs); int do_NR_SecurityModeCommand(uint8_t *const buffer, diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 0379aaddcd..b992af3e07 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -148,6 +148,16 @@ typedef enum { RRC_UECAPABILITY_ENQUIRY, } rrc_action_t; +typedef struct nr_rrc_config { + uint32_t tac; + plmn_id_t plmn[PLMN_LIST_MAX_SIZE]; + uint8_t num_plmn; + + bool um_on_default_drb; + bool enable_sdap; + int drbs; +} nr_rrc_config_t; + /* Small state for delaying NG-triggered actions (setup/release) */ typedef struct { int max_delays; @@ -440,7 +450,7 @@ typedef struct gNB_RRC_INST_s { RB_HEAD(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti // RRC configuration - gNB_RrcConfigurationReq configuration; + nr_rrc_config_t configuration; seq_arr_t *SIBs; // gNB N3 GTPU instance diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index a01c9aade6..2e6b0cac51 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -118,7 +118,7 @@ byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t * nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t srb_reest_bitmap, bool drb_reestablish); f1ap_qos_flow_param_t get_qos_char_from_qos_flow_param(const pdusession_level_qos_parameter_t *qos_param); -void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration); +void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, nr_rrc_config_t *configuration); NR_SRB_ToAddModList_t *createSRBlist(gNB_RRC_UE_t *ue, uint8_t reestablish); NR_DRB_ToAddModList_t *createDRBlist(gNB_RRC_UE_t *ue, bool reestablish, bool do_integrity, bool do_ciphering); void activate_srb(gNB_RRC_UE_t *UE, int srb_id); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 1f9779478d..a68ac6691e 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -360,7 +360,7 @@ static void rrc_gNB_CU_DU_init(gNB_RRC_INST *rrc) cu_init_f1_ue_data(); } -void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) +void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, nr_rrc_config_t *configuration) { AssertFatal(rrc != NULL, "RC.nrrrc not initialized!"); AssertFatal(MAX_MOBILES_PER_GNB < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow"); @@ -587,7 +587,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance, ue_p->xids[xid] = RRC_SETUP; NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, false); - int size = do_RRCSetup(buf, sizeof(buf), xid, masterCellGroup, masterCellGroup_len, &rrc->configuration, SRBs); + int size = do_RRCSetup(buf, sizeof(buf), xid, masterCellGroup, masterCellGroup_len, SRBs); AssertFatal(size > 0, "do_RRCSetup failed\n"); AssertFatal(size <= 1024, "memory corruption\n"); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index f724c0a0ff..8ebd0b0a37 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1641,7 +1641,7 @@ int rrc_gNB_process_PAGING_IND(MessageDef *msg_p, instance_t instance) p->mnc_digit_length, p->mnc, msg->tac[tai_size]); - gNB_RrcConfigurationReq *req = &RC.nrrrc[instance]->configuration; + nr_rrc_config_t *req = &RC.nrrrc[instance]->configuration; for (uint8_t j = 0; j < req->num_plmn; j++) { plmn_id_t *req_plmn = &req->plmn[j]; if (req_plmn->mcc == p->mcc && req_plmn->mnc == p->mnc && req->tac == msg->tac[tai_size]) { diff --git a/openair2/RRC/NR/rrc_gNB_du.c b/openair2/RRC/NR/rrc_gNB_du.c index 10d2e4131c..3381d60ce5 100644 --- a/openair2/RRC/NR/rrc_gNB_du.c +++ b/openair2/RRC/NR/rrc_gNB_du.c @@ -95,7 +95,7 @@ int get_ssb_arfcn(const struct nr_rrc_cell_container_t *cell) static bool rrc_gNB_plmn_matches(const gNB_RRC_INST *rrc, const f1ap_served_cell_info_t *info) { - const gNB_RrcConfigurationReq *conf = &rrc->configuration; + const nr_rrc_config_t *conf = &rrc->configuration; return conf->num_plmn == 1 // F1 supports only one && conf->plmn[0].mcc == info->plmn.mcc && conf->plmn[0].mnc == info->plmn.mnc; } diff --git a/radio/CMakeLists.txt b/radio/CMakeLists.txt index 1159416afa..c5da06ffde 100644 --- a/radio/CMakeLists.txt +++ b/radio/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(COMMON) + add_boolean_option(OAI_AW2SORI OFF "Activate OAI's AW2S driver" OFF) if(OAI_AW2SORI) add_subdirectory(AW2SORI) diff --git a/radio/COMMON/CMakeLists.txt b/radio/COMMON/CMakeLists.txt new file mode 100644 index 0000000000..af70ac4047 --- /dev/null +++ b/radio/COMMON/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(radio_common STATIC common_lib.c record_player.c) +target_include_directories(radio_common PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(radio_common PUBLIC dl log_headers shlib_loader) diff --git a/radio/COMMON/common_lib.c b/radio/COMMON/common_lib.c index 7b70dc20fa..4720347f20 100644 --- a/radio/COMMON/common_lib.c +++ b/radio/COMMON/common_lib.c @@ -40,7 +40,6 @@ #include "assertions.h" #include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" -//#include "targets/RT/USER/lte-softmodem.h" #include "executables/softmodem-common.h" #define MAX_GAP 100ULL