diff --git a/ivtest/ivltests/br_gh1256a.v b/ivtest/ivltests/br_gh1256a.v new file mode 100644 index 000000000..6dcb5005d --- /dev/null +++ b/ivtest/ivltests/br_gh1256a.v @@ -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 diff --git a/ivtest/ivltests/br_gh1256b.v b/ivtest/ivltests/br_gh1256b.v new file mode 100644 index 000000000..8ca8cd5b6 --- /dev/null +++ b/ivtest/ivltests/br_gh1256b.v @@ -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 diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 72a2fd2cf..4075dd59d 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -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 diff --git a/ivtest/vvp_tests/br_gh1256a.json b/ivtest/vvp_tests/br_gh1256a.json new file mode 100644 index 000000000..c1598a869 --- /dev/null +++ b/ivtest/vvp_tests/br_gh1256a.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1256a.v", + "iverilog-args" : [ "-g2009" ] +} diff --git a/ivtest/vvp_tests/br_gh1256b.json b/ivtest/vvp_tests/br_gh1256b.json new file mode 100644 index 000000000..c1598a869 --- /dev/null +++ b/ivtest/vvp_tests/br_gh1256b.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1256a.v", + "iverilog-args" : [ "-g2009" ] +}