ysyx-workbench/npc/csrc/Flow/CMakeLists.txt
xinyangli 64aee9ae21
Some checks failed
Run CTests within npc / npc-test (flow) (push) Failing after 8s
Build abstract machine with nix / build-packages (abstract-machine) (push) Failing after 14s
Build abstract machine with nix / build-packages (nemu) (push) Successful in 41s
Build abstract machine with nix / build-packages (nemu-lib) (push) Successful in 9s
Build abstract machine with nix / build-packages (rv32Cross.abstract-machine) (push) Successful in 8s
Run CTests within npc / npc-test (flow-simlib) (push) Failing after 7s
npc,ci: add npc to nix packages
2024-08-14 17:01:37 +08:00

42 lines
1.4 KiB
CMake

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)
target_include_directories(V${TOPMODULE} PRIVATE ${CMAKE_SOURCE_DIR}/include)
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")
install(TARGETS V${TOPMODULE})
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()
add_library(${TOPMODULE} SHARED config.cpp gdbstub_wrapper.cpp)
target_link_libraries(${TOPMODULE} PRIVATE devices gdbstub spdlog::spdlog)
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")
install(TARGETS ${TOPMODULE})