Hi,
Below is what I've tried to start a task with parameter from a function.
function fork_task_in_func()
for (int i = O; i < 3; i++) begin
fork
print_me(i);
join_none
end
endfunction
task print_me(int i);
$display("print me: i: %Od\n", i);
endtask
What I expect is as follows,
print me: i: 0
print me: i: 1
print me: i: 2
But the actual outputs are,
print me: i: 3
print me: i: 3
print me: i: 3
Anyone can explain a bit for this result?
Thanks.