Files
openairinterface5g/radio/vrtsim/CMakeLists.txt
T
Merkebu Girmay ccf5021072 radio/vrtsim: Add CIRDB support for precomputed channel taps
Integrate Channel Impulse Response Database (CIRDB) to enable playback
of precomputed realistic channel taps in vrtsim, with runtime selection
via YAML metadata.

Features:
- Read precomputed channel taps from binary database with YAML sidecar
- Runtime enable via --vrtsim.cirdb with optional paths (cirdb_yaml, cirdb_file, cirdb_path)
- Channel parameter configuration: model_id (TDL-A..E), delay spread (ds_ns), UE speed (speed_mps)
- Fallback to existing channel model options when disabled
- Time-driven snapshot progression based on elapsed simulation time

Fixes:
- RNG initialization: Add randominit() call before gaussZiggurat()
- FlatBuffers linking: Handle both 'FlatBuffers' and 'flatbuffers' package names when working with external channel emmulator
- Address review comments: use pthread directly, update calloc_or_fail, simplify CMake
2026-02-09 23:22:40 -08:00

64 lines
1.8 KiB
CMake

# Noise device static lib
add_library(noise_device STATIC noise_device.c)
target_link_libraries(noise_device PRIVATE log_headers)
# vrtsim module
add_library(vrtsim MODULE
vrtsim.c
cirdb_provider.c
cirdb_yaml.cpp
)
set_target_properties(vrtsim PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
find_package(yaml-cpp REQUIRED)
# Link libraries - always link yaml-cpp
target_link_libraries(vrtsim
PRIVATE
SIMU
shm_td_iq_channel
actor
noise_device
log_headers
pthread
yaml-cpp
)
# Optional taps client
add_boolean_option(OAI_VRTSIM_TAPS_CLIENT OFF "Enable taps client" ON)
if (OAI_VRTSIM_TAPS_CLIENT)
target_compile_definitions(vrtsim PRIVATE ENABLE_TAPS_CLIENT=1)
target_link_libraries(vrtsim PRIVATE taps_client)
file(DOWNLOAD
"https://gitlab.eurecom.fr/oai/raytracing-channel-emulator/-/raw/59589ad2a534881810b2aa7dd81e63066245bb8d/server/api/taps.fbs?inline=false"
${CMAKE_SOURCE_DIR}/taps.fbs
)
set(TAPS_IF_PATH ${CMAKE_SOURCE_DIR}/taps.fbs)
set(TAPS_API_HEADER taps_generated.h)
add_custom_command(OUTPUT ${TAPS_API_HEADER}
COMMAND flatc -c ${TAPS_IF_PATH}
DEPENDS ${TAPS_IF_PATH}
COMMENT "Generating flatbuffers API from ${TAPS_IF_PATH}"
)
add_library(taps_api INTERFACE)
target_include_directories(taps_api INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_library(taps_client taps_client.cpp ${TAPS_API_HEADER})
target_include_directories(taps_client PUBLIC .)
find_package(FlatBuffers QUIET)
if(NOT FlatBuffers_FOUND)
# Fall back to lowercase (Ubuntu 22.04)
find_package(Flatbuffers REQUIRED)
set(FLATBUFFERS_TARGET flatbuffers)
else()
set(FLATBUFFERS_TARGET flatbuffers::flatbuffers)
endif()
target_link_libraries(taps_client PUBLIC ${FLATBUFFERS_TARGET})
target_link_libraries(taps_client PUBLIC flatbuffers taps_api SIMU nanomsg)
endif()