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

43 lines
1.4 KiB
CMake
Raw Normal View History

2024-08-14 09:01:37 +00:00
if(BUILD_CHISEL_EMIT_TARGET)
include(ChiselBuild)
endif()
add_executable(V${TOPMODULE} config.cpp gdbstub_wrapper.cpp main.cpp)
target_link_libraries(V${TOPMODULE} PRIVATE devices gdbstub spdlog::spdlog)
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 "--vpi" "-Wno-UNOPTFLAT")
2024-04-05 03:30:52 +00:00
2024-08-14 09:01:37 +00:00
install(TARGETS V${TOPMODULE})
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 gdbstub_wrapper.cpp)
target_link_libraries(${TOPMODULE} PRIVATE devices gdbstub spdlog::spdlog)
2024-07-18 11:16:15 +00:00
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" "-Wno-UNOPTFLAT")
2024-08-14 09:01:37 +00:00
install(TARGETS ${TOPMODULE})