program test(busif.TB bus);
task check_trans(Transaction tr);
fork
begin
wait (bus.cb.addr != tr.addr);
end
join_none
endtask
Transaction tr;
initial begin
check_trans(tr0);
fork
begin
check_trans(tr1);
fork
check_trans(tr2);
join
#(TIME_OUT) disable fork;
end
join
end
endprogram
Can some one please explain me the spawning of threads here. I am confused?
fork join: the parent thread will terminate when all sub thread is over!
fork join_none: the parent thread will continue to run when all sub thread is over!
fork join_any : the parent thread will terminate when any sub thread is over!
Thanks. I am confused with the behavior of the above code which has nested for joins and a disable fork also. Also a begin end statement inside the fork join.