From 6f6ee5616f056feaa8f07c10cfdc23174e4bcab3 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Wed, 2 Oct 2024 10:57:45 -0700 Subject: [PATCH] Add convergent attribute to vx_barrier Note this attribute is only supported by Clang, so this will only be applied to the kernel binary but not runtime. --- kernel/include/gemmini_mmio.h | 2 ++ kernel/include/vx_intrinsics.h | 1 + 2 files changed, 3 insertions(+) diff --git a/kernel/include/gemmini_mmio.h b/kernel/include/gemmini_mmio.h index ebd3a5ba..ed55236c 100644 --- a/kernel/include/gemmini_mmio.h +++ b/kernel/include/gemmini_mmio.h @@ -9,6 +9,8 @@ // #define SMEM_SIZE 0x4000 // 64KB // #define SMEM_SIZE 0x10000 +// 128KB +// #define SMEM_SIZE 0x20000 // 256KB #define SMEM_SIZE 0x40000 diff --git a/kernel/include/vx_intrinsics.h b/kernel/include/vx_intrinsics.h index f6cfbf58..f51601f7 100644 --- a/kernel/include/vx_intrinsics.h +++ b/kernel/include/vx_intrinsics.h @@ -149,6 +149,7 @@ inline void vx_join(unsigned stack_ptr) { } // Warp Barrier +__attribute__((convergent)) inline void vx_barrier(unsigned barried_id, unsigned num_warps) { asm volatile (".insn r %0, 4, 0, x0, %1, %2" :: "i"(RISCV_CUSTOM0), "r"(barried_id), "r"(num_warps)); }