Properly Support Cluster-Local and Cluster-Private Storage#38
Merged
viv-eth merged 4 commits intopulp-platform:develfrom Mar 10, 2026
Merged
Properly Support Cluster-Local and Cluster-Private Storage#38viv-eth merged 4 commits intopulp-platform:develfrom
viv-eth merged 4 commits intopulp-platform:develfrom
Conversation
5b9a178 to
20fa3a5
Compare
20fa3a5 to
2a0ce12
Compare
2a0ce12 to
267be12
Compare
viv-eth
requested changes
Feb 17, 2026
Contributor
viv-eth
left a comment
There was a problem hiding this comment.
Thanks for the contribution! I made a few comments on stability and portability that should be easy to address.
…thmetic Linker-script symbols are address tokens only — they carry no storage. Declaring them as `extern volatile uint32_t` implicitly dereferences the symbol address, which is wrong and can silently truncate addresses on wider address models. Declare all such symbols as `extern char[]` and compute sizes via `(uintptr_t)__end - (uintptr_t)__start`.
Member
Author
f08e60d to
8ca2d32
Compare
8ca2d32 to
5f00dca
Compare
viv-eth
approved these changes
Mar 10, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
This PR introduces fixes to ensure the correct handling of cluster-local and cluster-private storage in a multi-cluster setup.
Usage Examples
How It Works
The cluster-local storage (CLS) mechanism uses a combination of linker script sections and runtime initialization to enable efficient per-cluster data storage:
1. L1 Alias Memory Region
The implementation requires a TCDM alias memory region that provides a unified address space mapping to each cluster's local L1 memory. When code running on a specific cluster accesses an address in the L1 alias region, it is automatically routed to that cluster's local L1 memory.
2. Linker Script Setup
The linker script defines special sections with split VMA (Virtual Memory Address) and LMA (Load Memory Address):
.cdatasection (SNRT_CLUSTER_L1_COPY): Initialized cluster-local datal1_alias(accessed via L1 alias region)memisl(stored in main memory/flash).cbsssection (SNRT_CLUSTER_L1_ZERO): Zero-initialized cluster-local datal1_alias(accessed via L1 alias region)memisl(metadata stored in main memory).l1_cXsections (SNRT_CLUSTER_L1): Cluster-private data for specific clustersmemisl(stored in main memory/flash)For each cluster, the linker reserves space (
.l1_cX_cls) equal to the size of.cdata+.cbsssections.3. Runtime Initialization
During
snrt_init(), the DM (Data Mover) core of each cluster:Copies cluster-local initialized data: DMA transfers
.cdatacontents from main memory (LMA) to the cluster's actual L1 memory. The destination address is calculated by translating the L1 alias address to the physical cluster L1 address:Zeros cluster-local BSS data: DMA fills the
.cbsssection in the cluster's L1 memory with zeros using a similar address translation.Copies cluster-private data: For cluster-specific sections (
.l1_cX), DMA copies data from main memory directly to the designated cluster's L1.4. Access Pattern
After initialization, all cores access cluster-local variables using the same variable names and addresses (via the L1 alias region). The hardware automatically routes each access to the appropriate cluster's local copy, ensuring:
This design enables efficient multi-cluster programming with isolated per-cluster state while maintaining code simplicity.
Added
SNRT_CLUSTER_L1()SNRT_CLUSTER_L1_COPY()SNRT_CLUSTER_L1_ZERO()Changed
init.cto properly handle multi-cluster storagesnrt.hwith new cluster storage utilitiesutil.hwith cluster storage handling functionsFixed
Checklist
develcommit and pointing todevel.