Skip to content

Commit 459de40

Browse files
committed
Make VLEN and RVD configurable via preprocessor defines
1 parent 3c8caf5 commit 459de40

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

hw/ip/spatz/src/generated/spatz_pkg.sv

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,24 @@ package spatz_pkg;
2323
// Single-precision floating point support
2424
localparam bit RVF = 1;
2525
// Double-precision floating-point support
26-
localparam bit RVD = 0;
26+
`ifdef SPATZ_RVD
27+
localparam bit RVD = `SPATZ_RVD;
28+
`else
29+
localparam bit RVD = 0; // Default
30+
`endif
2731
// Vector support
2832
localparam bit RVV = 1;
2933

3034
// Maximum size of a single vector element in bits
31-
localparam int unsigned ELEN = RVD ? 64 : 32;
35+
localparam int unsigned ELEN = RVD ? 64 : 32; // = 64 with RVD=1
3236
// Maximum size of a single vector element in bytes
3337
localparam int unsigned ELENB = ELEN / 8;
3438
// Number of bits in a vector register
35-
localparam int unsigned VLEN = 256;
39+
`ifdef SPATZ_VLEN
40+
localparam int unsigned VLEN = `SPATZ_VLEN;
41+
`else
42+
localparam int unsigned VLEN = 256; // Default: 256 bits
43+
`endif
3644
// Number of bytes in a vector register
3745
localparam int unsigned VLENB = VLEN / 8;
3846
// Maximum vector length in elements

0 commit comments

Comments
 (0)