Files
iverilog/ivtest/ivltests/br991a.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

37 lines
506 B
Verilog

module test();
reg clk;
reg [1:0] state;
always begin
case (state)
0 : state = 1;
1 : state = 2;
default : /* do nothing */ ;
endcase
@(posedge clk);
end
reg failed = 0;
initial begin
clk = 0;
state = 0;
#1 clk = 1;
#1 clk = 0;
if (state !== 1) failed = 1;
#1 clk = 1;
#1 clk = 0;
if (state !== 2) failed = 1;
#1 clk = 1;
#1 clk = 0;
if (state !== 2) failed = 1;
if (failed)
$display("FAILED");
else
$display("PASSED");
end
endmodule