diff --git a/ivtest/ivltests/sv_typedef_nested_array.v b/ivtest/ivltests/sv_typedef_nested_array.v new file mode 100644 index 000000000..8078b5c84 --- /dev/null +++ b/ivtest/ivltests/sv_typedef_nested_array.v @@ -0,0 +1,43 @@ +// Check that nested unpacked array types are supported. + +module test; + + localparam A = 3; + localparam B = 5; + localparam C = 2; + localparam D = 7; + + typedef logic [31:0] T1[A]; + typedef T1 T2[B][C]; + + T2 x[D]; + T2 y; + + bit failed = 1'b0; + + `define check(expr, val) \ + if (expr !== val) begin \ + $display("FAILED: %s, expected %0d, got %0d", `"expr`", val, expr); \ + failed = 1'b1; \ + end + + initial begin + `check($unpacked_dimensions(x), 4) + `check($size(x, 1), A) + `check($size(x, 2), B) + `check($size(x, 3), C) + `check($size(x, 4), D) + + `check($unpacked_dimensions(y), 3) + `check($size(y, 1), A) + `check($size(y, 2), B) + `check($size(y, 3), C) + + `check($bits(T2), $bits(integer) * A * B * C) + + if (!failed) begin + $display("PASSED"); + end + end + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 547a3752c..d75b11333 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -674,6 +674,7 @@ sv_typedef_darray_base1 normal,-g2009 ivltests sv_typedef_darray_base2 normal,-g2009 ivltests sv_typedef_darray_base3 normal,-g2009 ivltests sv_typedef_darray_base4 normal,-g2009 ivltests +sv_typedef_nested_array normal,-g2009 ivltests sv_typedef_queue_base1 normal,-g2009 ivltests sv_typedef_queue_base2 normal,-g2009 ivltests sv_typedef_queue_base3 normal,-g2009 ivltests