From 1853f5d6594bc371e4d8e631c24acd011a620915 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 9 Aug 2025 17:20:05 +0300 Subject: refactor mesh3d to match 2d,1d --- tests/simple_mesh1d/test.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/simple_mesh1d/test.c') diff --git a/tests/simple_mesh1d/test.c b/tests/simple_mesh1d/test.c index b3de347..293a91c 100644 --- a/tests/simple_mesh1d/test.c +++ b/tests/simple_mesh1d/test.c @@ -1,7 +1,8 @@ #include __attribute__((always_inline)) -static inline uint64_t extreme_numa_addr(uint16_t cluster, uint16_t elem, uint32_t off) +static inline uint64_t mesh1d_addr(uint16_t cluster, uint16_t elem, + uint32_t off) { return ((uint64_t)cluster << 48) | ((uint64_t)elem << 32) | off; } @@ -40,18 +41,18 @@ static inline uint64_t next_idx(unsigned x, unsigned y, unsigned X, unsigned Y) unsigned yi = wrap(y, Y); unsigned xi = yi < y ? wrap(x, X) : x; - return extreme_numa_addr(xi, yi, 0); + return mesh1d_addr(xi, yi, 0); } void _start(unsigned x, unsigned y, unsigned X, unsigned Y) { - volatile char *uart = (char *)extreme_numa_addr(0, 0, 0); - volatile uint64_t *control = (uint64_t *)extreme_numa_addr(0, 1, 0); + volatile char *uart = (char *)mesh1d_addr(0, 0, 0); + volatile uint64_t *control = (uint64_t *)mesh1d_addr(0, 1, 0); if (x == 1 && y == 0) { goto do_work; } else { - while (*control != extreme_numa_addr(x, y, 0)) {} + while (*control != mesh1d_addr(x, y, 0)) {} } do_work: @@ -59,7 +60,7 @@ do_work: *control = next_idx(x, y, X, Y); if (x == X - 1 && y == Y - 1) - asm("ebreak"); + asm ("ebreak"); /* otherwise just loop */ while (1) {} -- cgit v1.3