-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
153 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,35 +4,24 @@ | |
# | ||
# Philip Wiese <[email protected]> | ||
|
||
file(GLOB_RECURSE C_SOURCES_SNTICH | ||
"trampoline_snitchCluster.c" | ||
) | ||
|
||
################################################################################ | ||
# Host Runtime Library # | ||
################################################################################ | ||
file(GLOB_RECURSE C_SOURCES | ||
"*.c" | ||
"offload_snitchCluster.c" | ||
) | ||
|
||
# WIESEP: Remove the C_SOURCES_SNTICH from the list of sources | ||
list(REMOVE_ITEM C_SOURCES ${C_SOURCES_SNTICH}) | ||
|
||
# WIESEP: Create an object library for the snitch cluster trampoline to compile it with the correct ISA and ABI | ||
add_library(cluster_snitch OBJECT ${C_SOURCES_SNTICH}) | ||
target_sources(runtime_host PRIVATE ${C_SOURCES}) | ||
|
||
target_compile_options(cluster_snitch | ||
PRIVATE | ||
-O2 | ||
-march=${ISA_CLUSTER_SNITCH} | ||
-mabi=${ABI_CLUSTER_SNITCH} | ||
) | ||
|
||
# Add include directories from runtime to cluster_snitch | ||
target_include_directories(cluster_snitch | ||
PRIVATE | ||
$<TARGET_PROPERTY:runtime,INTERFACE_INCLUDE_DIRECTORIES> | ||
################################################################################ | ||
# Snitch Cluster Runtime Library # | ||
################################################################################ | ||
file(GLOB_RECURSE C_SOURCES_SNTICH | ||
"trampoline_snitchCluster.c" | ||
) | ||
|
||
target_sources(runtime INTERFACE $<TARGET_OBJECTS:cluster_snitch>) | ||
target_sources(runtime PRIVATE ${C_SOURCES}) | ||
target_sources(runtime_cluster_snitch PRIVATE ${C_SOURCES_SNTICH}) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,16 @@ | |
// | ||
// Philip Wiese <[email protected]> | ||
|
||
#include "soc.h" | ||
|
||
#include <stdint.h> | ||
|
||
// Persistent trampoline function pointer for each core | ||
extern void (*_trampoline_function[NUM_CLUSTER_CORES])(void *); | ||
extern void (*_trampoline_function)(void *); | ||
|
||
// Peristent argument storage for the trampoline function | ||
extern void *_trampoline_args[NUM_CLUSTER_CORES]; | ||
extern void *_trampoline_args; | ||
|
||
// Persistant stack pointer storage for each core | ||
extern void *_trampoline_stack[NUM_CLUSTER_CORES]; | ||
extern void *_trampoline_stack; | ||
|
||
/** | ||
* @brief Trampoline function for the cluster core. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# | ||
# Moritz Scherer <[email protected]> | ||
# Viviane Potocnik <[email protected]> | ||
# Philip Wiese <[email protected]> | ||
|
||
file(GLOB_RECURSE ASM_SOURCES | ||
"src/crt0.S" | ||
|
@@ -14,28 +15,28 @@ file(GLOB_RECURSE C_SOURCES | |
) | ||
|
||
set_property(SOURCE ${ASM_SOURCES} PROPERTY LANGUAGE ASM) | ||
add_library(runtime OBJECT ${ASM_SOURCES} ${C_SOURCES}) | ||
|
||
target_include_directories(runtime | ||
PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/include | ||
target_sources(runtime_host | ||
PRIVATE | ||
${ASM_SOURCES} | ||
${C_SOURCES} | ||
) | ||
|
||
set(ISA rv32imc) | ||
set(ABI ilp32) | ||
# WIESEP: Export the target specific linkerscript | ||
target_link_options(runtime_host | ||
PUBLIC | ||
-L${CMAKE_CURRENT_LIST_DIR} | ||
-Tlink.ld | ||
) | ||
|
||
target_compile_options(runtime | ||
# WIESEP: Export the target specific include directory | ||
target_include_directories(runtime_host | ||
PUBLIC | ||
-march=${ISA} | ||
-mabi=${ABI} | ||
${CMAKE_CURRENT_LIST_DIR}/include | ||
) | ||
|
||
target_link_options(runtime | ||
# WIESEP: Export the headers also to the cluster runtime | ||
target_include_directories(runtime_cluster_snitch | ||
PUBLIC | ||
-march=${ISA} | ||
-mabi=${ABI} | ||
-nostartfiles | ||
-nostdlib | ||
-L${CMAKE_CURRENT_LIST_DIR} | ||
-Tlink.ld | ||
${CMAKE_CURRENT_LIST_DIR}/include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# | ||
# Moritz Scherer <[email protected]> | ||
# Viviane Potocnik <[email protected]> | ||
# Philip Wiese <[email protected]> | ||
|
||
file(GLOB_RECURSE ASM_SOURCES | ||
"src/crt0.S" | ||
|
@@ -15,23 +16,27 @@ file(GLOB_RECURSE C_SOURCES | |
|
||
set_property(SOURCE ${ASM_SOURCES} PROPERTY LANGUAGE ASM) | ||
|
||
target_sources(runtime | ||
target_sources(runtime_host | ||
PRIVATE | ||
${ASM_SOURCES} | ||
${C_SOURCES} | ||
) | ||
|
||
# WIESEP: Export the target specific linkerscript | ||
target_link_options(runtime | ||
target_link_options(runtime_host | ||
PUBLIC | ||
-L${CMAKE_CURRENT_LIST_DIR} | ||
-Tlink.ld | ||
) | ||
|
||
# WIESEP: Export the target specific include directory | ||
target_include_directories(runtime | ||
target_include_directories(runtime_host | ||
PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/include | ||
) | ||
|
||
|
||
# WIESEP: Export the headers also to the cluster runtime | ||
target_include_directories(runtime_cluster_snitch | ||
PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,32 @@ | |
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Moritz Scherer <[email protected]> | ||
# Philip Wiese <[email protected]> | ||
|
||
add_subdirectory(generic) | ||
# Define mappings directly using lists for each target | ||
set(CHIMERA_CONVOLVE_FOLDERS chimera-convolve chimera-open chimera-host) | ||
set(CHIMERA_OPEN_FOLDERS chimera-open chimera-host) | ||
set(CHIMERA_HOST_FOLDERS chimera-host) | ||
|
||
# Check if folder has a CMakeLists.txt file | ||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${TARGET_PLATFORM}/CMakeLists.txt) | ||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${TARGET_PLATFORM}) | ||
# Determine which folders to include based on TARGET_PLATFORM | ||
if(TARGET_PLATFORM STREQUAL "chimera-convolve") | ||
set(INCLUDED_FOLDERS ${CHIMERA_CONVOLVE_FOLDERS}) | ||
elseif(TARGET_PLATFORM STREQUAL "chimera-open") | ||
set(INCLUDED_FOLDERS ${CHIMERA_OPEN_FOLDERS}) | ||
elseif(TARGET_PLATFORM STREQUAL "chimera-host") | ||
set(INCLUDED_FOLDERS ${CHIMERA_HOST_FOLDERS}) | ||
else() | ||
message(FATAL_ERROR "[CHIMERA-SDK] Unknown TARGET_PLATFORM: '${TARGET_PLATFORM}'. Valid options are chimera-convolve, chimera-open, or chimera-host.") | ||
endif() | ||
|
||
# WIESEP: Print the folders being included | ||
message(STATUS "[CHIMERA-SDK] Including test folders: ${INCLUDED_FOLDERS}") | ||
|
||
# Add subdirectories, checking for a valid CMakeLists.txt in each folder | ||
foreach(folder IN LISTS INCLUDED_FOLDERS) | ||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${folder}/CMakeLists.txt) | ||
add_subdirectory(${folder}) | ||
else() | ||
message(WARNING "[CHIMERA-SDK] Folder '${folder}' does not contain a valid CMakeLists.txt. Skipping.") | ||
endif() | ||
endforeach() |
Oops, something went wrong.