Add regression tests for issue #1256.

This commit is contained in:
Martin Whitaker 2025-07-05 18:21:01 +01:00
parent 0ecb71625b
commit aec91c7754
5 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,24 @@
module test();
typedef struct packed {
logic [3:0] a;
} inner_t;
typedef struct packed {
inner_t [1:0][3:0] fields;
} outer_t;
outer_t var1;
outer_t var2;
initial begin
var1 = 32'h12345678;
var2.fields = var1.fields;
$display("%h", var2);
if (var2 === 32'h12345678)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,25 @@
module test();
typedef struct packed {
logic [3:0] a;
} inner_t;
typedef struct packed {
inner_t [1:0][3:0] fields;
} outer_t;
outer_t var1;
outer_t var2;
initial begin
var1 = 32'h12345678;
var2.fields[0] = var1.fields[1];
var2.fields[1] = var1.fields[0];
$display("%h", var2);
if (var2 === 32'h56781234)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -65,6 +65,8 @@ br_gh1180b vvp_tests/br_gh1180b.json
br_gh1181 vvp_tests/br_gh1181.json
br_gh1184 vvp_tests/br_gh1184.json
br_gh1242 vvp_tests/br_gh1242.json
br_gh1256a vvp_tests/br_gh1256a.json
br_gh1256b vvp_tests/br_gh1256b.json
ca_time_real vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json
case2 vvp_tests/case2.json

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "br_gh1256a.v",
"iverilog-args" : [ "-g2009" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "br_gh1256a.v",
"iverilog-args" : [ "-g2009" ]
}