add CMake flag to enable 5G-NR components

master
Andre Puschmann 5 years ago
parent 8bec22ff11
commit 7885b5b9ee

@ -65,6 +65,7 @@ configure_file(
option(ENABLE_SRSUE "Build srsUE application" ON) option(ENABLE_SRSUE "Build srsUE application" ON)
option(ENABLE_SRSENB "Build srsENB application" ON) option(ENABLE_SRSENB "Build srsENB application" ON)
option(ENABLE_SRSEPC "Build srsEPC application" ON) option(ENABLE_SRSEPC "Build srsEPC application" ON)
option(ENABLE_5GNR "Build with 5G-NR components" OFF)
option(DISABLE_SIMD "disable simd instructions" OFF) option(DISABLE_SIMD "disable simd instructions" OFF)
option(ENABLE_GUI "Enable GUI (using srsGUI)" ON) option(ENABLE_GUI "Enable GUI (using srsGUI)" ON)
@ -92,6 +93,10 @@ else(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
set(GCC_ARCH native CACHE STRING "GCC compile for specific architecture.") set(GCC_ARCH native CACHE STRING "GCC compile for specific architecture.")
endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
if (ENABLE_5GNR)
add_definitions(-DHAVE_5GNR)
endif (ENABLE_5GNR)
######################################################################## ########################################################################
# Find dependencies # Find dependencies
######################################################################## ########################################################################

@ -18,13 +18,38 @@
# and at http://www.gnu.org/licenses/. # and at http://www.gnu.org/licenses/.
# #
file(GLOB CXX_SOURCES "*.cc")
file(GLOB C_SOURCES "*.c") set(SOURCES arch_select.cc
backtrace.c
buffer_pool.cc
crash_handler.c
gen_mch_tables.c
liblte_security.cc
log_filter.cc
logger_file.cc
mac_pcap.cc
nas_pcap.cc
network_utils.cc
pdu.cc
pdu_queue.cc
rlc_pcap.cc
s1ap_pcap.cc
security.cc
snow_3g.cc
thread_pool.cc
threads.c
tti_sync_cv.cc
version.c
zuc.cc)
if (ENABLE_5GNR)
set(SOURCES ${SOURCES} mac_nr_pcap.cc mac_nr_pdu.cc)
endif(ENABLE_5GNR)
# Avoid warnings caused by libmbedtls about deprecated functions # Avoid warnings caused by libmbedtls about deprecated functions
set_source_files_properties(security.cc PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) set_source_files_properties(security.cc PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
add_library(srslte_common STATIC ${C_SOURCES} ${CXX_SOURCES}) add_library(srslte_common STATIC ${SOURCES})
add_custom_target(gen_build_info COMMAND cmake -P ${CMAKE_BINARY_DIR}/SRSLTEbuildinfo.cmake) add_custom_target(gen_build_info COMMAND cmake -P ${CMAKE_BINARY_DIR}/SRSLTEbuildinfo.cmake)
add_dependencies(srslte_common gen_build_info) add_dependencies(srslte_common gen_build_info)

@ -22,15 +22,17 @@ set(SOURCES gtpu.cc
pdcp.cc pdcp.cc
pdcp_entity_base.cc pdcp_entity_base.cc
pdcp_entity_lte.cc pdcp_entity_lte.cc
pdcp_entity_nr.cc
rlc.cc rlc.cc
rlc_tm.cc rlc_tm.cc
rlc_um_base.cc rlc_um_base.cc
rlc_um_lte.cc rlc_um_lte.cc
rlc_um_nr.cc
rlc_am_base.cc rlc_am_base.cc
rlc_am_lte.cc rlc_am_lte.cc)
rlc_am_nr.cc)
if (ENABLE_5GNR)
set(SOURCES ${SOURCES} pdcp_entity_nr.cc rlc_um_nr.cc rlc_am_nr.cc)
endif(ENABLE_5GNR)
add_library(srslte_upper STATIC ${SOURCES}) add_library(srslte_upper STATIC ${SOURCES})
target_link_libraries(srslte_upper srslte_common srslte_asn1) target_link_libraries(srslte_upper srslte_common srslte_asn1)
install(TARGETS srslte_upper DESTINATION ${LIBRARY_DIR}) install(TARGETS srslte_upper DESTINATION ${LIBRARY_DIR})

@ -410,6 +410,7 @@ void rlc::add_bearer(uint32_t lcid, rlc_config_t cnfg)
rlc_log->error("Cannot add RLC entity - invalid mode\n"); rlc_log->error("Cannot add RLC entity - invalid mode\n");
goto unlock_and_exit; goto unlock_and_exit;
} }
#ifdef HAVE_5GNR
} else if (cnfg.rat == srslte_rat_t::nr) { } else if (cnfg.rat == srslte_rat_t::nr) {
switch (cnfg.rlc_mode) { switch (cnfg.rlc_mode) {
case rlc_mode_t::tm: case rlc_mode_t::tm:
@ -422,6 +423,10 @@ void rlc::add_bearer(uint32_t lcid, rlc_config_t cnfg)
rlc_log->error("Cannot add RLC entity - invalid mode\n"); rlc_log->error("Cannot add RLC entity - invalid mode\n");
goto unlock_and_exit; goto unlock_and_exit;
} }
#endif
} else {
rlc_log->error("RAT not supported\n");
goto unlock_and_exit;
} }
if (not rlc_array.insert(rlc_map_pair_t(lcid, rlc_entity)).second) { if (not rlc_array.insert(rlc_map_pair_t(lcid, rlc_entity)).second) {

@ -67,9 +67,11 @@ add_executable(pdu_test pdu_test.cc)
target_link_libraries(pdu_test srslte_phy srslte_common ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(pdu_test srslte_phy srslte_common ${CMAKE_THREAD_LIBS_INIT})
add_test(pdu_test pdu_test) add_test(pdu_test pdu_test)
add_executable(mac_nr_pdu_test mac_nr_pdu_test.cc) if (ENABLE_5GNR)
target_link_libraries(mac_nr_pdu_test srslte_phy srslte_common ${CMAKE_THREAD_LIBS_INIT}) add_executable(mac_nr_pdu_test mac_nr_pdu_test.cc)
add_test(mac_nr_pdu_test mac_nr_pdu_test) target_link_libraries(mac_nr_pdu_test srslte_phy srslte_common ${CMAKE_THREAD_LIBS_INIT})
add_test(mac_nr_pdu_test mac_nr_pdu_test)
endif(ENABLE_5GNR)
add_executable(stack_procedure_test stack_procedure_test.cc) add_executable(stack_procedure_test stack_procedure_test.cc)
add_test(stack_procedure_test stack_procedure_test) add_test(stack_procedure_test stack_procedure_test)

@ -30,16 +30,20 @@ add_executable(rlc_am_test rlc_am_test.cc)
target_link_libraries(rlc_am_test srslte_upper srslte_phy srslte_common) target_link_libraries(rlc_am_test srslte_upper srslte_phy srslte_common)
add_test(rlc_am_test rlc_am_test) add_test(rlc_am_test rlc_am_test)
add_executable(rlc_am_nr_pdu_test rlc_am_nr_pdu_test.cc) if (ENABLE_5GNR)
target_link_libraries(rlc_am_nr_pdu_test srslte_upper srslte_phy) add_executable(rlc_am_nr_pdu_test rlc_am_nr_pdu_test.cc)
add_test(rlc_am_nr_pdu_test rlc_am_nr_pdu_test) target_link_libraries(rlc_am_nr_pdu_test srslte_upper srslte_phy)
add_test(rlc_am_nr_pdu_test rlc_am_nr_pdu_test)
endif(ENABLE_5GNR)
add_executable(rlc_stress_test rlc_stress_test.cc) add_executable(rlc_stress_test rlc_stress_test.cc)
target_link_libraries(rlc_stress_test srslte_upper srslte_phy srslte_common ${Boost_LIBRARIES}) target_link_libraries(rlc_stress_test srslte_upper srslte_phy srslte_common ${Boost_LIBRARIES})
add_test(rlc_am_stress_test rlc_stress_test --mode=AM --loglevel 1 --sdu_gen_delay 250) add_test(rlc_am_stress_test rlc_stress_test --mode=AM --loglevel 1 --sdu_gen_delay 250)
add_test(rlc_um_stress_test rlc_stress_test --mode=UM --loglevel 1) add_test(rlc_um_stress_test rlc_stress_test --mode=UM --loglevel 1)
add_test(rlc_tm_stress_test rlc_stress_test --mode=TM --loglevel 1 --random_opp=false) add_test(rlc_tm_stress_test rlc_stress_test --mode=TM --loglevel 1 --random_opp=false)
add_test(rlc_um_nr_stress_test rlc_stress_test --rat NR --mode=UM --loglevel 1) if (ENABLE_5GNR)
add_test(rlc_um_nr_stress_test rlc_stress_test --rat NR --mode=UM --loglevel 1)
endif(ENABLE_5GNR)
set_tests_properties(rlc_am_stress_test PROPERTIES TIMEOUT 3000) set_tests_properties(rlc_am_stress_test PROPERTIES TIMEOUT 3000)
set_tests_properties(rlc_um_stress_test PROPERTIES TIMEOUT 3000) set_tests_properties(rlc_um_stress_test PROPERTIES TIMEOUT 3000)
set_tests_properties(rlc_tm_stress_test PROPERTIES TIMEOUT 3000) set_tests_properties(rlc_tm_stress_test PROPERTIES TIMEOUT 3000)
@ -56,25 +60,27 @@ add_executable(rlc_common_test rlc_common_test.cc)
target_link_libraries(rlc_common_test srslte_upper srslte_phy) target_link_libraries(rlc_common_test srslte_upper srslte_phy)
add_test(rlc_common_test rlc_common_test) add_test(rlc_common_test rlc_common_test)
add_executable(rlc_um_nr_pdu_test rlc_um_nr_pdu_test.cc) if (ENABLE_5GNR)
target_link_libraries(rlc_um_nr_pdu_test srslte_upper srslte_phy) add_executable(rlc_um_nr_pdu_test rlc_um_nr_pdu_test.cc)
add_test(rlc_um_nr_pdu_test rlc_um_nr_pdu_test) target_link_libraries(rlc_um_nr_pdu_test srslte_upper srslte_phy)
add_test(rlc_um_nr_pdu_test rlc_um_nr_pdu_test)
add_executable(rlc_um_nr_test rlc_um_nr_test.cc) add_executable(rlc_um_nr_test rlc_um_nr_test.cc)
target_link_libraries(rlc_um_nr_test srslte_upper srslte_phy) target_link_libraries(rlc_um_nr_test srslte_upper srslte_phy)
add_test(rlc_um_nr_test rlc_um_nr_test) add_test(rlc_um_nr_test rlc_um_nr_test)
add_executable(pdcp_nr_test_tx pdcp_nr_test_tx.cc) add_executable(pdcp_nr_test_tx pdcp_nr_test_tx.cc)
target_link_libraries(pdcp_nr_test_tx srslte_upper srslte_common) target_link_libraries(pdcp_nr_test_tx srslte_upper srslte_common)
add_test(pdcp_nr_test_tx pdcp_nr_test_tx) add_test(pdcp_nr_test_tx pdcp_nr_test_tx)
add_executable(pdcp_nr_test_rx pdcp_nr_test_rx.cc) add_executable(pdcp_nr_test_rx pdcp_nr_test_rx.cc)
target_link_libraries(pdcp_nr_test_rx srslte_upper srslte_common) target_link_libraries(pdcp_nr_test_rx srslte_upper srslte_common)
add_test(pdcp_nr_test_rx pdcp_nr_test_rx) add_test(pdcp_nr_test_rx pdcp_nr_test_rx)
add_executable(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu.cc) add_executable(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu.cc)
target_link_libraries(pdcp_nr_test_discard_sdu srslte_upper srslte_common) target_link_libraries(pdcp_nr_test_discard_sdu srslte_upper srslte_common)
add_test(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu) add_test(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu)
endif(ENABLE_5GNR)
######################################################################## ########################################################################
# Option to run command after build (useful for remote builds) # Option to run command after build (useful for remote builds)

@ -35,7 +35,7 @@
#define LOG_HEX_LIMIT (-1) #define LOG_HEX_LIMIT (-1)
#define PCAP 1 #define PCAP 0
#define PCAP_CRNTI (0x1001) #define PCAP_CRNTI (0x1001)
#define PCAP_TTI (666) #define PCAP_TTI (666)

Loading…
Cancel
Save