In reply to rag123:
For some reason task B is not executed.
This works
module m;
// event a;
bit [9:0] done;
task automatic A(input int i);
$display("Task A. Time = %0t, i = %0d", $time, i);
done[i] = 1;
endtask
task automatic B(i);
$display("Task B. Time = %0t, i = %0d", $time, i);
endtask
/* task automatic t();
for (int j = 0; j <= 1; j++) begin
#10;
fork
A(j);
join_none
end
endtask */
task automatic t();
for (int j = 0; j <= 9; j++) begin
int k = j;
// #10;
fork
begin
$display("j %0d k %0d ",j,k);
A(k);
end
join_none
end
endtask
initial begin
t();
$display("sent t()");
// wait (done == 10'b00_0000_0011);
@ (done == 10'b11_1111_1111);
$display("done=%b", done);
// @(a);
B(2);
end
endmodule