mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
Merge pull request #2329 from antmicro/arrays-fix-multirange-size
Rewrite multirange arrays sizes [n] as [n-1:0]
This commit is contained in:
commit
f176bd7778
2 changed files with 27 additions and 2 deletions
16
tests/svtypes/multirange_array.sv
Normal file
16
tests/svtypes/multirange_array.sv
Normal file
|
@ -0,0 +1,16 @@
|
|||
// test for multirange arrays
|
||||
|
||||
`define STRINGIFY(x) `"x`"
|
||||
`define STATIC_ASSERT(x) if(!(x)) $error({"assert failed: ", `STRINGIFY(x)})
|
||||
|
||||
module top;
|
||||
|
||||
logic a [3];
|
||||
logic b [3][5];
|
||||
logic c [3][5][7];
|
||||
|
||||
`STATIC_ASSERT($bits(a) == 3);
|
||||
`STATIC_ASSERT($bits(b) == 15);
|
||||
`STATIC_ASSERT($bits(c) == 105);
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue