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

41 lines
801 B
Verilog

/*
* This is a simple test for the for...join_none syntax. There is a
* fork statement to start a bunch of threads. We wait for none of
* them and instead watch them progress with the master thread.
*/
module main;
int flag;
initial begin
flag = 0;
fork
# 10 flag = 10;
# 20 flag = 20;
# 30 flag = 30;
join_none
#5 if (flag != 0) begin
$display("FAILED -- flag=%d (s.b. 0)", flag);
$finish;
end
#10 if (flag != 10) begin
$display("FAILED -- flag=%d (s.b. 10)", flag);
$finish;
end
#10 if (flag != 20) begin
$display("FAILED -- flag=%d (s.b. 20)", flag);
$finish;
end
#10 if (flag != 30) begin
$display("FAILED -- flag=%d (s.b. 30)", flag);
$finish;
end
$display("PASSED");
end
endmodule