Skip to content

Commit

Permalink
sw: Fix cluster software cmake cache variables (#49)
Browse files Browse the repository at this point in the history
Mark the variables declared by the `snitch_cluster` system software CMakeLists.txt as `CACHE`, to then be picked-up appropriately by the `SnitchUtilities.cmake` file later on. Otherwise the wrong simulator and runtime would be used.
  • Loading branch information
fabianschuiki authored Feb 23, 2021
1 parent fbde2ee commit c716488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hw/system/snitch_cluster/sw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ cmake_minimum_required(VERSION 3.13)
set(SNITCH_SOFTWARE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../sw)
list(APPEND CMAKE_MODULE_PATH ${SNITCH_SOFTWARE_DIR}/cmake)
set(CMAKE_TOOLCHAIN_FILE toolchain-gcc)
set(SNITCH_RUNTIME snRuntime-cluster)
set(SNITCH_SIMULATOR ${CMAKE_CURRENT_SOURCE_DIR}/../bin/snitch_cluster.vlt)
set(SNITCH_RUNTIME snRuntime-cluster CACHE PATH "")
set(SNITCH_SIMULATOR ${CMAKE_CURRENT_SOURCE_DIR}/../bin/snitch_cluster.vlt CACHE PATH "")

project(snitch_cluster LANGUAGES C ASM)
include(SnitchUtilities)
Expand Down
3 changes: 2 additions & 1 deletion sw/cmake/SnitchUtilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ set(SNITCH_SIMULATOR "" CACHE PATH "Command to run a binary in an RTL simulation
set(SNITCH_TEST_PREFIX "")
message(STATUS "Check for Banshee")
execute_process(COMMAND ${SNITCH_BANSHEE} --version OUTPUT_VARIABLE SNITCH_BANSHEE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using simulator: ${SNITCH_BANSHEE} - version ${SNITCH_BANSHEE_VERSION}")
message(STATUS "Using Banshee simulator: ${SNITCH_BANSHEE} - version ${SNITCH_BANSHEE_VERSION}")
if (SNITCH_SIMULATOR)
message(STATUS "Using RTL simulator: ${SNITCH_SIMULATOR}")
endif()
message(STATUS "Using runtime: ${SNITCH_RUNTIME}")

macro(add_snitch_library name)
add_library(${ARGV})
Expand Down

0 comments on commit c716488

Please sign in to comment.