目录
学到的,要分享;赚到的,要回馈
关于fork ...join的用法理解:
需要等待线程全部结束,才能退出!
initial begin
$display("@%0t:start fork... join example", $time);
#10 $display("@%0t: sequential after #10", $time);
fork
$display("@%0t:parallel start", $time);
#50 $display("@%0t: parallel after #50", $time);
#10 $display("@%0t: parallel after #10", $time);
begin
#30 $display("@%0t: sequential after #30", $time);
#10 $display("@%0t: sequential after #10", $time);
end
join
$display("@%0t: after join", $time);
#80 $display("@%0t: finish after #80",$time);
end
仿真开始,首先是执行第一行代码,不消耗时间!
0ns时刻,执行 $display("@%0