Files
iverilog/ivtest/ivltests/wait_fork.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

32 lines
553 B
Verilog

module top;
reg [4:1] res;
reg pass;
initial begin
pass = 1'b1;
res = 4'b0000;
fork
#3 res[3] = 1'b1;
#4 res[4] = 1'b1;
join_none
fork
#1 res[1] = 1'b1;
#2 res[2] = 1'b1;
join_any
if (res != 4'b0001) begin
$display("Error: Only first process should have run: %b", res);
pass = 1'b0;
end
wait fork;
if (res != 4'b1111) begin
$display("Error: All processes should have run: %b", res);
pass = 1'b0;
end
if (pass) $display("PASSED");
end
endmodule