blob: edf1a818f8c948127030a80283dfcfcb3b7e9d0c [file] [log] [blame]
cmake_minimum_required (VERSION 3.10)
option(BUILD_SIMPLIFIED_CORE "Build the project with a simplified set of ISA support.")
option(BUILD_FOR_TBM "When building the vector tests, use only a single AVL, to make the traces shorter.")
set(CMAKE_C_ABI_COMPILED ON)
set(CMAKE_CXX_ABI_COMPILED ON)
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/riscv_baremetal.cmake")
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/cmake/
)
project(springbok_project)
if(${BUILD_SIMPLIFIED_CORE})
add_definitions(-DLIBSPRINGBOK_NO_VECTOR_SUPPORT)
add_definitions(-DLIBSPRINGBOK_NO_FLOAT_SUPPORT)
add_definitions(-DLIBSPRINGBOK_NO_EXCEPTION_SUPPORT)
endif()
if(${BUILD_FOR_TBM})
add_compile_definitions(FOR_TBM)
endif()
enable_language(ASM)
include($ENV{ROOTDIR}/sw/pigweed/pw_build/pigweed.cmake)
pw_set_backend(pw_log pw_log_basic)
pw_set_backend(pw_assert pw_assert_log)
pw_set_backend(pw_sys_io pw_sys_io_stdio)
add_subdirectory($ENV{ROOTDIR}/sw/pigweed pw)
set(LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/springbok/springbok_no_wmmu.ld" CACHE PATH "Linker script for springbok")
set(TEST_RUNNER "${CMAKE_CURRENT_SOURCE_DIR}/scripts/test_runner.py" CACHE PATH "Test runner script path")
include(vec_cc_binary)
include(vec_cc_test)
include(vec_cc_generated_test)
add_subdirectory(springbok)
add_subdirectory(hello_vec)
add_subdirectory(faults)
add_subdirectory(vector_tests)
add_subdirectory(vector_load_store_tests)
add_subdirectory(vector_vadd_vsub_tests)
add_subdirectory(vector_executive)
add_subdirectory(vector_vset_tests)
add_subdirectory(vector_matmul4_asm_test)
add_subdirectory(pw_unit_test_demo)
enable_testing()
add_subdirectory(test_v_helpers)
add_subdirectory(softrvv)
add_subdirectory(tests)
add_custom_target(AllTests
COMMAND
"${CMAKE_CTEST_COMMAND}"
--verbose
--build-and-test "${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
--build-generator "${CMAKE_GENERATOR}"
--test-command "${CMAKE_CTEST_COMMAND}"
)