2024-08-14 09:01:37 +00:00
|
|
|
if(BUILD_CHISEL_EMIT_TARGET)
|
|
|
|
include(ChiselBuild)
|
|
|
|
endif()
|
2024-08-01 10:53:17 +00:00
|
|
|
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-04-04 18:12:30 +00:00
|
|
|
|
2024-07-09 12:42:01 +00:00
|
|
|
verilate(
|
|
|
|
V${TOPMODULE}
|
2024-08-02 04:08:03 +00:00
|
|
|
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
|
|
|
|
2024-08-01 10:53:17 +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}
|
2024-08-02 04:08:03 +00:00
|
|
|
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})
|