From 1c577dc7c7d6aee27b8d5cb0e2e87c8473e3ad12 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Tue, 22 Aug 2023 21:42:55 -0700 Subject: Support setting V-env LFSR bits with a compiler flag (#43) This makes it easier to support tests with large memory footprints, as the default 63 pages may be insufficient --- v/riscv_test.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'v') diff --git a/v/riscv_test.h b/v/riscv_test.h index e39123c..f56c022 100644 --- a/v/riscv_test.h +++ b/v/riscv_test.h @@ -59,8 +59,12 @@ userstart: \ // Supervisor mode definitions and macros //----------------------------------------------------------------------- -#define MAX_TEST_PAGES 63 // this must be the period of the LFSR below -#define LFSR_NEXT(x) (((((x)^((x)>>1)) & 1) << 5) | ((x) >> 1)) +#ifndef LFSR_BITS +#define LFSR_BITS 6 +#endif + +#define MAX_TEST_PAGES ((1 << LFSR_BITS)-1) // this must be the period of the LFSR below +#define LFSR_NEXT(x) (((((x)^((x)>>1)) & 1) << (LFSR_BITS-1)) | ((x) >> 1)) #define PGSHIFT 12 #define PGSIZE (1UL << PGSHIFT) -- cgit v1.1