RVSCC/fw/test/CMakeLists.txt
Mario Romero bd2f58d5f6
Some checks are pending
continuous-integration/drone/push Build is pending
Change name scheme and add tests
2023-02-26 20:26:11 -03:00

34 lines
751 B
CMake

cmake_minimum_required(VERSION 3.10)
project(test ASM)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/utils.cmake)
option(DISSASEMBLY "Enable dissasembly" OFF)
list(APPEND TEST_FILES
itype.s
rtype.s
imm.s
core.s
)
foreach(TEST_FILE IN LISTS TEST_FILES)
get_filename_component(TEST_FILENAME ${TEST_FILE} NAME_WE)
set(TEST_TARGET "test-${TEST_FILENAME}")
add_executable(${TEST_TARGET} ${TEST_FILENAME}.s)
target_compile_options(${TEST_TARGET} PRIVATE
-march=rv32id
)
target_link_options(${TEST_TARGET} PRIVATE
-T ${CMAKE_SOURCE_DIR}/linker-script.ld
)
if(DISSASEMBLY)
rvscc_dissasemble(TARGET ${TEST_TARGET})
endif()
rvscc_bin_to_verilog_mem_file(TARGET ${TEST_TARGET})
endforeach()