Add regression tests for packed/unpacked array parameter declarations.

These are currently unsupported, so should result in a compiler error.
This commit is contained in:
Martin Whitaker 2024-11-15 21:06:05 +00:00
parent b2eaedfc94
commit 62727e8b2e
7 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1 @@
ivltests/br_gh1180a.v:3: sorry: packed array parameters are not supported yet.

View File

@ -0,0 +1 @@
ivltests/br_gh1180b.v:3: sorry: unpacked array parameters are not supported yet.

View File

@ -0,0 +1,13 @@
module test();
parameter [3:0][3:0] array = { 4'd0, 4'd1, 4'd2, 4'd3 };
initial begin
$display("%h", array);
if (array === 16'h0123)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,13 @@
module test();
parameter [3:0] array[0:3] = '{ 4'd0, 4'd1, 4'd2, 4'd3 };
initial begin
$display("%h %h %h %h", array[0], array[1], array[2], array[3]);
if (array[0] === 4'h0 && array[1] === 4'h1 && array[2] === 4'h2 && array[3] === 4'h3)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -60,6 +60,8 @@ br_gh1143g vvp_tests/br_gh1143g.json
br_gh1143h vvp_tests/br_gh1143h.json
br_gh1155 vvp_tests/br_gh1155.json
br_gh1163 vvp_tests/br_gh1163.json
br_gh1180a vvp_tests/br_gh1180a.json
br_gh1180b vvp_tests/br_gh1180b.json
br_gh1181 vvp_tests/br_gh1181.json
ca_time_real` vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json

View File

@ -0,0 +1,6 @@
{
"type" : "CE",
"source" : "br_gh1180a.v",
"iverilog-args" : [ "-g2009" ],
"gold" : "br_gh1180a"
}

View File

@ -0,0 +1,6 @@
{
"type" : "CE",
"source" : "br_gh1180b.v",
"iverilog-args" : [ "-g2009" ],
"gold" : "br_gh1180b"
}