Skip to content

Commit

Permalink
change snitch patch
Browse files Browse the repository at this point in the history
  • Loading branch information
tahaelbayad committed Dec 13, 2024
1 parent 3acf934 commit bc2c6f8
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions toolchain/snitch_cluster.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,42 @@ index d0979b7..171921d 100644
+ KEEP(*(.cbss .cbss.*))
__cbss_end = .;
} >L3


diff --git a/sw/snRuntime/src/alloc.h b/sw/snRuntime/src/alloc.h
index ba1dee9..f79769f 100644
--- a/sw/snRuntime/src/alloc.h
+++ b/sw/snRuntime/src/alloc.h
@@ -69,6 +69,8 @@ inline void *snrt_l3alloc(size_t size) {

// TODO: L3 alloc size check

+ size = ALIGN_UP(size, MIN_CHUNK_SIZE);
+
void *ret = (void *)alloc->next;
alloc->next += size;
return ret;
diff --git a/sw/snRuntime/src/team.c b/sw/snRuntime/src/team.c
index a9eb840..5290e1d 100644
--- a/sw/snRuntime/src/team.c
+++ b/sw/snRuntime/src/team.c
@@ -10,6 +10,10 @@ extern uint32_t snrt_global_core_idx();

extern uint32_t snrt_global_core_num();

+extern uint32_t snrt_global_compute_core_num();
+
+extern uint32_t snrt_global_compute_core_idx();
+
extern uint32_t snrt_cluster_idx();

extern uint32_t snrt_cluster_num();
diff --git a/target/snitch_cluster/sw/runtime/rtl/src/putchar.c b/target/snitch_cluster/sw/runtime/rtl/src/putchar.c
index 0ad9500..215c8b1 100644
--- a/target/snitch_cluster/sw/runtime/rtl/src/putchar.c
+++ b/target/snitch_cluster/sw/runtime/rtl/src/putchar.c
@@ -5,16 +5,19 @@
extern uintptr_t volatile tohost, fromhost;

// Rudimentary string buffer for putc calls.
-extern uint32_t _edram;
#define PUTC_BUFFER_LEN (1024 - sizeof(size_t))
Expand All @@ -58,6 +71,6 @@ index 0ad9500..215c8b1 100644
+} putc_buffer_t;
+
+static volatile putc_buffer_t putc_buffer[SNRT_CLUSTER_NUM*SNRT_CLUSTER_CORE_NUM] __attribute__((section(".dram")));

// Provide an implementation for putchar.
void _putchar(char character) {

0 comments on commit bc2c6f8

Please sign in to comment.