In reply to ben@SystemVerilog.us:
To kill any lingering threads on the fork activity tesryou should disable
disable CLOCK1 as shown below.
task automatic t_clk1();
fork
PERIOD1: begin
#P1;
active1=1'b0;
disable CLOCK1;
end
CLOCK1: begin
@(clk1);
active1=1'b1;
disable PERIOD1;
end
join_any
done=1; ->e;
endtask