Hi All,
Please help in understanding the below question related to fork/join_none/join/join_any
- When we try to use the fork/join_none during the function/task call i am getting the below output.
module test;
initial begin
for(int i = 0; i < 3;i++)
begin
fork
print(i);
join_none
end
end
task print (int i);
$display("[%0t]: i = %0d",$time,i);
endtask:print
endmodule:test
/*
[0]: i = 3
[0]: i = 3
[0]: i = 3
*/
- when we try to use the fork/join_none during the function/task definition i am getting the below output.
module test;
initial begin
for(int i = 0; i < 3;i++)
begin
print(i);
end
end
task print (int i);
fork
$display("[%0t]: i = %0d",$time,i);
join_none
endtask:print
endmodule:test
/*
[0]: i = 2
[0]: i = 2
[0]: i = 2
]> */
- what is the difference between the approach 1 and 2 . when to use it ?
Please provide some inputs with some practical example.
thanks in advance
Please provide any updates on this.