For the following code..
module tb_top();
initial begin
for(int i=0;i<5;i++)begin
$display("%0d",i);
fork
automatic int var=i;
$display("%0d",var);
join_none
end
end
endmodule: tb_top
it outputs 0 1 2 3 4 all i values
and then the spawned processes prints 4 3 2 1 0
but why it is in reverse order...?
I know the automatic variables gets initialized before any process are spawned