Skip to content

Commit

Permalink
Support setting V-env LFSR bits with a compiler flag (riscv#43)
Browse files Browse the repository at this point in the history
This makes it easier to support tests with large memory footprints,
as the default 63 pages may be insufficient
  • Loading branch information
jerryz123 authored Aug 23, 2023
1 parent 4fabfb4 commit 1c577dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions v/riscv_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1c577dc

Please sign in to comment.