| # Copyright 2023 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| |
| 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}" |
| ) |