S
sense
Guest
This is a post related to system verilog.
for(i=0;i<10;i=i+1)
for(i=0;i<10;i=i+1)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sorry, the post died. Here is the full question:This is a post related to system verilog.
for(i=0;i<10;i=i+1)
for(i=0;i<10;i=i+1)
if(arr)
fork
begin
apply(arr);
end
join_none
Having a normal integer for i, results in wrong values read in each
child process ( each child process does not have a copy of i).
I tried a work around as:
for(i=0;i<10;i=i+1)
if(arr)
apply_task(arr);
task apply_task(integer j);
fork
begin
apply(j);
end
join_none
endtask
The automatic task creates local copies which serve the purpose, but
will the child processes be killed when the task ends?
I don't think you need to apologize for that in any way.Thanks, and sorry for my bad english.
No, the child processes will not be killed when the task ends. Andtask apply_task(integer j);
fork
begin
apply(j);
end
join_none
endtask
The automatic task creates local copies which serve the purpose, but
will the child processes be killed when the task ends?
The work around is reliable.However, I'm not sure your workaround is reliable. The
inner "begin...end" should not begin executing until the
task stalls. If you were to add #0; immediately before
the endtask, it would definitely be OK.