-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snitch Cluster Offloading #13
Conversation
- Split into generic and target specific tests - Split subtests into where they are executed (host, snitchCluster)
- Refactor cmake build flow - Add cluster driver - Fix potential problem with cluster interrupt handler
- Make clear what is host code and what is cluster code
5fb4ab3
to
73c67c4
Compare
3e9dffe
to
0ac8969
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/generic/snitchCluster/simpleOffload/src_cluster/test_cluster.c
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. Functionally the changes look reasonable to me - I think we can improve implementation on the C side a bit, but that doesn't seem so urgent. CMake structure seems suboptimal to me, I think we should invest a bit of design effort into clearly disambiguating different ISAs and not push setting compile flags to the user.
dd5eda1
to
5dc3247
Compare
@Scheremo I implemented the feedback provided here and from our discussion. Changed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you almost perfectly nailed it this time around - remainder of my comments are on minor cmake structuring and code org. Those changes are (more or less) optional, the big picture looks very good to me!
a991b97
to
8b2418c
Compare
@Scheremo I implemented the suggested changes and added a For example
Additionally, I add the libraries in the If you are ok with the changes, please resolve the conversation and re-approve the PR. Thanks for all the super valuable feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of the procedural macro, but I'll leave final judgement up to you. Otherwise looks good to me.
- This way I can ensure that the macro does not unintentionally modify the parent scope.
Changelog
This PR introduces significant improvements and additions to the project, focusing on enhanced test infrastructure, driver functionality, and target support. Key updates include better separation of host and cluster code, support for mixed ISA compilation, and the addition of a new cluster target for the CONVOLVE tapeout. The changes also address critical fixes related to interrupt handling and early-execution functions, ensuring robust and reliable system behavior.
Mixed ISA Compilation
The current approach compiles all code for both the host and cluster cores into a single library. This requires precise handling to ensure compatibility between the different instruction set architectures (ISAs) and application binary interfaces (ABIs).
This requires careful handling to avoid invalid instructions caused by mismatched ISAs between the host and cluster cores. Hence, we define four CMake variables,
ABI
,ISA_HOST
, andISA_CLUSTER_SNITCH
, to specify the appropriate ISA for each core type. The ABI has to be identical to ensure correct function calls.Furthermore, the tests are split into
src_host
andsrc_cluster
directories to clearly separate code executed on the host and cluster cores.cMake Build Flow
All runtime functions executed by the host core are compiled into a dedicated
runtime_host
static library and the cluster code intoruntime_cluster_<type>
(e.g.runtime_cluster_snitch
). Additionally, the HAL layer is compiled into thehal_host
static libary.The final binary is seperated into two object libaries, one for the host and one for the cluster core. The host object library is linked with the
runtime_host
andhal_host
libraries, while the cluster object library is linked with theruntime_cluster_<type>
library. The final binary is then linked from the two object libraries.Devices
Additionally, this PR adds a new
devices
folder where we in the future pull in the device SDKs (such as PULP or Snitch runtime) as external libraries. The folder structure looks like this:(Some folders are omitted for simplicity)
Warning
Special attention is required for functions that execute before the cluster core is fully initialized, such as the trampoline function and interrupt handlers. At this stage, critical resources like the stack, global pointer, and thread pointer are not yet configured. Consequently, the compiler must not generate code that allocates stack frames. To address this, such functions are implemented as naked functions, which prevent the compiler from adding prologues or epilogues that rely on stack operations.
Added
runtime_host
that currently includes support for the snitch cluster.devices
folder to add device specific code and add external runtimes.CONVOLVE
.Changed
host
,snitchCluster
).runtime_host
andruntime_cluster_<type>
library and keep ISA flags private.Fixed
warning: trap_vector changed binding to STB_WEAK