Fork within loop with join ALL

Because fork/join is a blocking statement, only the statements inside the fork/join are executed in parallel.

What you need to do add a wait fork statement after the for loop. This block the current thread until all child threads have completed. You have to be careful if there are any other earlier fork_join_none statements that you do not want to wait for them to finish. If there are, the you need to create an isolating thread.


fork 
  begin : isolating_thread
    for(int index=0;index<14;index++)begin : for_loop

      fork
      automatic int idx=index;
        begin
            `ovm_do_on(sequence_inst,p_sequencer.my_sqr[idx]);
        end
      join_none;
    end : for_loop
  wait fork;
  end : isolating_thread
join