diff --git a/ivtest/ivltests/br_gh1286.v b/ivtest/ivltests/br_gh1286.v new file mode 100644 index 000000000..0bd6aaa37 --- /dev/null +++ b/ivtest/ivltests/br_gh1286.v @@ -0,0 +1,38 @@ +module test; + +reg [1:0] a; +reg b; +reg c; +reg d; + +always_latch begin + if (a[1]) + c = 1; + else if (a[0]) + c = 0; +end + +always_latch begin + if (b) + d = 1; + else if (a[0]) + d = 0; +end + +reg failed = 0; + +initial begin + $monitor("%0t : %b %b : %b %b", $time, a, b, c, d); + a[0] = 1'b1; + #1 if (c !== 1'b0 && d !== 1'b0) failed = 1; + a[1] = 1'b1; + #1 if (c !== 1'b1 && d !== 1'b0) failed = 1; + b = 1'b1; + #1 if (c !== 1'b1 && d !== 1'b1) failed = 1; + if (failed) + $display("FAILED"); + else + $display("PASSED"); +end + +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 2d5a229e1..107f68e07 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -69,6 +69,7 @@ br_gh1256a vvp_tests/br_gh1256a.json br_gh1256b vvp_tests/br_gh1256b.json br_gh1258a vvp_tests/br_gh1258a.json br_gh1258b vvp_tests/br_gh1258b.json +br_gh1286 vvp_tests/br_gh1286.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_gh1286.json b/ivtest/vvp_tests/br_gh1286.json new file mode 100644 index 000000000..f3c26ae24 --- /dev/null +++ b/ivtest/vvp_tests/br_gh1286.json @@ -0,0 +1,5 @@ +{ + "type" : "normal", + "source" : "br_gh1286.v", + "iverilog-args" : [ "-g2009" ] +}