From 6e78f3a197509a12bdd5dc09244f31f13b8321fc Mon Sep 17 00:00:00 2001 From: Lukasz Dalek Date: Mon, 3 Aug 2020 15:34:43 +0200 Subject: [PATCH] Test multirange (unpacked) arrays size Signed-off-by: Lukasz Dalek --- tests/svtypes/multirange_array.sv | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/svtypes/multirange_array.sv diff --git a/tests/svtypes/multirange_array.sv b/tests/svtypes/multirange_array.sv new file mode 100644 index 000000000..be0d3dfc2 --- /dev/null +++ b/tests/svtypes/multirange_array.sv @@ -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 -- 2.30.2