From 544a932c73636162fadcb94c2d4fe4a6a0fc673c Mon Sep 17 00:00:00 2001 From: Zhihao Wang <101526713+xiuhu17@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:46:26 -0600 Subject: [PATCH] Fix a bug in gemmini malloc (#718) --- apps/gemmini/src/platform/gemm_acc_malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/gemmini/src/platform/gemm_acc_malloc.c b/apps/gemmini/src/platform/gemm_acc_malloc.c index f52293a80..f23d1ee01 100644 --- a/apps/gemmini/src/platform/gemm_acc_malloc.c +++ b/apps/gemmini/src/platform/gemm_acc_malloc.c @@ -46,8 +46,9 @@ uint32_t gemm_acc_malloc(long unsigned int size) { if (i > 0) { loc = ACC_BLOCKS[i - 1].loc + ACC_BLOCKS[i - 1].size; } + ACC_BLOCKS[i].size = size; - ACC_BLOCKS[i].loc = 0; + ACC_BLOCKS[i].loc = loc; ACC_BLOCKS[i].is_used = 1; gemm_acc_free_block = i + 1;