ysyx-workbench/npc/csrc/Flow/CMakeLists.txt

53 lines
1.3 KiB
CMake
Raw Normal View History

include(ChiselBuild)
add_executable(V${TOPMODULE} config.cpp main.cpp)
2024-07-10 12:27:09 +00:00
target_link_libraries(V${TOPMODULE} PRIVATE devices gdbstub)
2024-07-09 12:42:01 +00:00
target_include_directories(V${TOPMODULE} PRIVATE ${CMAKE_SOURCE_DIR}/include)
2024-07-09 12:42:01 +00:00
verilate(
V${TOPMODULE}
TRACE
THREADS
TOP_MODULE
${TOPMODULE}
PREFIX
V${TOPMODULE}
SOURCES
${CHISEL_OUTPUT_TOPMODULE}
${CHISEL_OUTPUT_VERILATOR_CONF}
INCLUDE_DIRS
${CHISEL_OUTPUT_DIR}
VERILATOR_ARGS
2024-07-09 12:42:01 +00:00
"--vpi" # Enable VPI
"-Wno-UNOPTFLAT")
2024-04-05 03:30:52 +00:00
2024-07-09 12:42:01 +00:00
foreach(DIFFTEST_BINARY_FILE IN LISTS DIFFTEST_BINARY_FILES)
get_filename_component(FILENAME ${DIFFTEST_BINARY_FILE} NAME_WE)
add_test(NAME V${TOPMODULE}.${FILENAME}
COMMAND V${TOPMODULE} -m ${DIFFTEST_BINARY_FILE} --diff-lib
${DIFFTEST_LIB})
unset(FILENAME)
endforeach()
2024-07-18 11:16:15 +00:00
add_library(${TOPMODULE} SHARED config.cpp main.cpp)
target_link_libraries(${TOPMODULE} PRIVATE devices gdbstub)
target_include_directories(${TOPMODULE} PRIVATE ${CMAKE_SOURCE_DIR}/include)
set_property(TARGET PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_options(${TOPMODULE} PRIVATE -Wl,-E)
verilate(
${TOPMODULE}
TRACE
THREADS
TOP_MODULE
${TOPMODULE}
PREFIX
V${TOPMODULE}
SOURCES
${CHISEL_OUTPUT_TOPMODULE}
${CHISEL_OUTPUT_VERILATOR_CONF}
INCLUDE_DIRS
${CHISEL_OUTPUT_DIR}
VERILATOR_ARGS
"--vpi" # Enable VPI
"-Wno-UNOPTFLAT")