Starting multiple sequence in parallel inside a for loop

hi I want to start 3 sequences inside a for loop
the code is like this:

for(int i=o; i<4; i++)begin
  fork
  begin
  abc_seq.start(top.virtual_sequencer);
  end
  begin
   if(condition=="true") begin
      fork
      begin
         for(int j=0; j<3;j++) begin
           xyz_seq.start(top.virtual_sequencer);
         end
     end
     begin
       pqr.seq.start(top.virtual_sequencer);
     end
     join_any
   end
   else begin
       pqr.seq.start(top.virtual_sequencer);
   end

  end
  join
end

when i execute the first sequence abc executes once as well the second begin end.but in the second iteration of outer for loop the sequence completes abc sequence and when it comes to start xyz it shoots uvm fatal seq not done. Can u guys help me out.

In reply to Vineeth g k:

Please use code tags making your code easier to read. I have added them for you.

After the join_any proceeds, you still have an active sequence running. You need to kill them off, or construct new sequence objects.

Am curious to know in what circumstances do we use a loop around starting a sequence. I have used loops within the body of sequence to loop around stimulus generation.

for(int i=o; i<4; i++)begin
  fork
  begin
  abc_seq.start(top.virtual_sequencer);
  end
  begin
   if(condition=="true") begin
      fork
      begin
         for(int j=0; j<3;j++) begin
           xyz_seq.start(top.virtual_sequencer);
         end
     end
     begin
       pqr.seq.start(top.virtual_sequencer);
     end
     join_any
   end
   else begin
       pqr.seq.start(top.virtual_sequencer);
   end
 
  end
  join
end: for_loop

hi dave,

hi my intention is to start all 3 sequence in parallel.but if pqr sequence completes then don’t wait for xyz to proceed terminate it and start next iteration of outer for loop.so its like abc executes and pqr completes in every iteration if xyz completes before pqr then its fine but every time I need abc and pqr to be completed to go to next iteration.can u help me dave with it.