59 asm volatile(
"ecall \n");
75 const size_t alignment = 1) {
86 const size_t alignment =
alignof(T)) {
109 const size_t alignment = 1) {
133 uint32_t heap_end_addr = snrt_cls_base_addr();
134 heap_end_addr -= (1 << SNRT_LOG2_STACK_SIZE) * snrt_cluster_core_num();
135 heap_end_addr -= 128;
137 uintptr_t l1_start_addr = (uintptr_t)(snrt_cluster()->tcdm.mem);
169 asm volatile(
"ecall \n");
203 extern uint32_t _edram;
205 snrt_align_up((uint32_t)&_edram, MIN_CHUNK_SIZE);
229 size_t offset = (core_idx - snrt_cluster_core_idx()) * size;
230 return (
void *)((uintptr_t)ptr + offset);
246 uint32_t dst_cluster_idx) {
247 return (
void *)((uintptr_t)ptr +
248 (dst_cluster_idx - src_cluster_idx) * SNRT_CLUSTER_OFFSET);
void snrt_l3_init()
Initialize the L3 allocator.
Definition alloc_v2.h:202
void * snrt_l3_alloc_v2(size_t size, const size_t alignment=1)
Allocate space for a variable in L3 memory.
Definition alloc_v2.h:184
void * snrt_l1_next_aligned_hyperbank()
Get the next pointer of the L1 allocator, aligned to the hyperbank.
Definition alloc_v2.h:40
void snrt_l1_update_next_v2(void *next)
Override the L1 allocator next pointer.
Definition alloc_v2.h:49
static void snrt_l1_alloc_check_bounds()
Check if the allocation exceeds the allocator bounds and raise an exception if it does.
Definition alloc_v2.h:57
void snrt_l1_init()
Initialize the L1 allocator.
Definition alloc_v2.h:128
void * snrt_l1_next_v2()
Get the next pointer of the L1 allocator.
Definition alloc_v2.h:33
void * snrt_l1_alloc_compute_core_local(size_t size, const size_t alignment=1)
Allocate space for N variables in the cluster's L1 memory.
Definition alloc_v2.h:108
void * snrt_l3_next_v2()
Get the next pointer of the L3 allocator.
Definition alloc_v2.h:161
static void snrt_l3_alloc_check_bounds()
Check if the allocation exceeds the allocator bounds and raise an exception if it does.
Definition alloc_v2.h:167
snrt_allocator_t * snrt_l3_allocator_v2()
Get a pointer to the L3 allocator.
Definition alloc_v2.h:154
void * snrt_remote_l1_ptr(void *ptr, uint32_t src_cluster_idx, uint32_t dst_cluster_idx)
Get a pointer to the same offset in another cluster's L1 memory.
Definition alloc_v2.h:245
void * snrt_l1_alloc_cluster_local(size_t size, const size_t alignment=1)
Allocate space for a variable in the cluster's L1 memory.
Definition alloc_v2.h:74
void * snrt_compute_core_local_ptr(void *ptr, uint32_t core_idx, size_t size)
Get a pointer to the same variable allocated by another core.
Definition alloc_v2.h:227
snrt_allocator_t * snrt_l1_allocator_v2()
Get a pointer to the L1 allocator.
Definition alloc_v2.h:26
Definition alloc_decls.h:10