Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ivan-Velickovic/71a232a39d686b6a9cf33e83d9342086 to your computer and use it in GitHub Desktop.
Save Ivan-Velickovic/71a232a39d686b6a9cf33e83d9342086 to your computer and use it in GitHub Desktop.
diff --git a/common.py b/common.py
index e6ce8be..f2206eb 100644
--- a/common.py
+++ b/common.py
@@ -14,6 +14,7 @@ import logging
PLAT_CONFIG = {
'pc99': ['-DTUT_BOARD=pc', '-DTUT_ARCH=x86_64'],
'zynq7000': ['-DAARCH32=TRUE', '-DTUT_BOARD=zynq7000'],
+ 'spike': ['-DTUT_BOARD=spike'],
}
CAMKES_VM_CONFIG = {
@@ -74,6 +75,8 @@ def _init_tute_directory(config, tut, solution, task, directory, output=None):
arch = "x86_64"
elif config == "zynq7000":
arch = "aarch32"
+ elif config == "spike":
+ arch = "riscv64"
with open(os.path.join(directory, ".tute_config"), 'w') as file:
file.write("set(TUTE_COMMAND \"%s\")" %
';'.join(["PYTHONPATH=${PYTHON_CAPDL_PATH}", "python3", os.path.join(get_tutorial_dir(), "template.py"),
diff --git a/settings.cmake b/settings.cmake
index da07102..61e1999 100644
--- a/settings.cmake
+++ b/settings.cmake
@@ -17,6 +17,7 @@ list(
${project_modules}
)
set(POLLY_DIR ${project_dir}/tools/polly CACHE INTERNAL "")
+set(OPENSBI_PATH ${project_dir}/tools/opensbi CACHE INTERNAL "")
include(application_settings)
@@ -57,6 +58,11 @@ elseif(${TUT_BOARD} STREQUAL "zynq7000")
set(KernelSel4Arch "aarch32" CACHE STRING "" FORCE)
set(KernelPlatform "zynq7000" CACHE STRING "" FORCE)
ApplyData61ElfLoaderSettings(${KernelPlatform} ${KernelSel4Arch})
+elseif(${TUT_BOARD} STREQUAL "spike")
+ set(KernelArch "riscv" CACHE STRING "" FORCE)
+ set(KernelSel4Arch "riscv64" CACHE STRING "" FORCE)
+ set(KernelPlatform "spike" CACHE STRING "" FORCE)
+ ApplyData61ElfLoaderSettings(${KernelPlatform} ${KernelSel4Arch})
else()
message(FATAL_ERROR "Unsupported board ${TUT_BOARD}.")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment