From 92ed21f83fc9e4f934c1e53b8b49af997d287a17 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Sat, 7 Oct 2023 21:22:45 -0700 Subject: [PATCH] [driver] Set different base address for device malloc Change the target area of malloc to something more akin to the heap area for a CPU userspace program, since that works better with Chipyard's default memory mapping scheme (0x80000000 and above). --- driver/common/vx_utils.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/driver/common/vx_utils.h b/driver/common/vx_utils.h index 0bac7394..e9d6cc1f 100644 --- a/driver/common/vx_utils.h +++ b/driver/common/vx_utils.h @@ -7,6 +7,12 @@ uint64_t aligned_size(uint64_t size, uint64_t alignment); bool is_aligned(uint64_t addr, uint64_t alignment); #define CACHE_BLOCK_SIZE 64 -#define ALLOC_BASE_ADDR 0x00000000 -#define LOCAL_MEM_SIZE 4294967296 // 4 GB +// NOTE(hansung): This is changed to something more akin to be in a heap area +// for a CPU userspace program, since that works better with Chipyard's default +// memory mapping scheme (0x80000000 and above). This gives us a pretty small +// space though. +#define ALLOC_BASE_ADDR 0xc0000000ul +#define LOCAL_MEM_SIZE 0x40000000ul // 1 GB +// #define ALLOC_BASE_ADDR 0x00000000 +// #define LOCAL_MEM_SIZE 4294967296 // 4 GB #define DEVICE_MAX_ADDR 0xfffffffful