Write code to execute task A in parallel 10 times, and call task B only after task A has finished executing 10 times

In reply to vk7715:

fork/join_none does not start any processes until the parent process suspends or terminates.



module fork_join;
  
  event a;
  task A(input int i);
    $display("Task A. Time = %0t, i = %0d", $time, i);
  endtask
  
  task B(i);
    $display("Task B. Time = %0t, i = %0d", $time, i);
  endtask
  
  initial begin
    for(int j = 0; j < 10; j++) begin
      fork
        A(j);
      join_none
      #0;
    end
    ->a;
    
    @(a);
    B(2);
  end
    
endmodule