Skip to content

Commit

Permalink
Add regression test for issue #1122.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwhitaker committed May 6, 2024
1 parent 3b61c00 commit 94d9d19
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
49 changes: 49 additions & 0 deletions ivtest/ivltests/br_gh1122.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module tranif_or(a, b, y);
input a, b;
inout y;

supply1 vdd;
supply0 vss;

wire w1, w2;

// NOR
tranif0(w1, vdd, a);
tranif0(w2, w1, b);
tranif1(w2, vss, a);
tranif1(w2, vss, b);

// OR
tranif0(y, vdd, w2);
tranif1(y, vss, w2);
endmodule

module test;

reg a, b;
wire y;

tranif_or dut(a, b, y);

reg failed = 0;

initial begin
$monitor("%t a=%b b=%b Y=%b", $time, a, b, y);
#10 a = 0; b = 0;
#0 if (y !== 0) failed = 1;
#10 a = 0; b = 1;
#0 if (y !== 1) failed = 1;
#10 a = 1; b = 0;
#0 if (y !== 1) failed = 1;
#10 a = 1; b = 1;
#0 if (y !== 1) failed = 1;
#1;
if (failed)
$display("FAILED");
else
$display("PASSED");
end

endmodule


1 change: 1 addition & 0 deletions ivtest/regress-vvp.list
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ br_gh1099a vvp_tests/br_gh1099a.json
br_gh1099b vvp_tests/br_gh1099b.json
br_gh1099c vvp_tests/br_gh1099c.json
br_gh1104 vvp_tests/br_gh1104.json
br_gh1122 vvp_tests/br_gh1122.json
ca_time_real` vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json
case2 vvp_tests/case2.json
Expand Down
4 changes: 4 additions & 0 deletions ivtest/vvp_tests/br_gh1122.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "normal",
"source" : "br_gh1122.v"
}

0 comments on commit 94d9d19

Please sign in to comment.