fork: frameo_wd_timer
@(negedge router.cb.frameo_n[da]);
begin
repeat(1000) @(router.cb);
$display("\n%m\n[ERROR]%t Frame signal timed out!\n", $realtime);
$finish;
end
join_any: frameo_wd_timer
disable frameo_wd_timer;
join_none是指父进程根本不等自进程,继续往下执行,此时的子进程在队列中排队等待,直到父进程遇到阻塞性的语句,即wait,#,@。不包括阻塞性的赋值语句(a = 1'b1)。如下面的语句:
program automatic test;
reg a;
initial
begin
fork
begin
#2;
$display("%t:state1",$time);
end
begin
$display("%t:state2",$time);
#2;
end
join_none
$display("%t:state3",$time);
$display("%t:state4",$time);
a =1'b1;
$display("%t:state4.1",$time);
fork
begin
$display("%t:state5",$time);
#2;
end
begin
$display("%t:state6",$time);
#2;
end
join_none
$display("%t:state7",$time);
wait fork;
end
endprogram
在VCS中执行结果为;
0:state3
0:state4
0:state4.1
0,state7
0:state2
0:state5
0:state6
2:state1
由于fork-join_none的不阻塞特性,经常用于monitor进程观测对象,也用于产生很多独立的激励进程。如下面的语句:
task Generator::start();
if (TRACE_ON) $display("[TRACE]%t %s:%m", $realtime, name);
fork
for (int i=0; i
gen();
begin
Packet pkt = new pkt2send;
out_box[pkt.sa].put(pkt);
end
end
join_none
endtask
1 条评论:
Thanks for posting Question from my site.
Im very much thankfull for the link www.testbench.in on your blog.
-- Gopi Krishna
发表评论