How to use wait fork statement in nested fork join_none block

Hi All,

Currently I am trying to implement a test that will spawn several uvm_sequence simultaneously and wait for them to finish before the test process to next stage. However, I am having troubles in using wait fork.

Below is my code snippet, basically I have two sequences types, type_I has 6 objects, and type_II has 1 object, I want them to run in parrallel.


//Declare sequence
uvm_seq_type_I  seq_type_I[6];
uvm_seq_type_II seq_type_II;
//Declare sequencer
uvm_seqr_type_I  seqr_type_I[6];
uvm_seqr_type_II seqr_type_II;
...
      fork:parallel_traffic
        for(int j=i;j<6;j++)begin
          automatic int k=j;
          fork
            begin
              seq_type_I[k].start(seqr_type_I[k]);
              seq_type_I[k].wait_for_sequence_state(256); //seq_type_I[0-5] will finish in a time order of 0->5
              #10;
            end
          join_none
        end
        seq_type_II.start(seqr_type_II);
        seq_type_II.wait_for_sequence_state(256);
      join_none
      `uvm_info("TEST",$sformatf("Before wait fork"),UVM_LOW);
      wait fork;
      `uvm_info("TEST",$sformatf("After wait fork"),UVM_LOW);

However, in the simulation, once seq_type_I[0] and seq_type_II is completed, the wait fork statement is also completed. And the test will move on and won’t wait for seq_type_I[2-5] to finish.

I wonder how to make the test to wait for all the seven seqs to finish before it moves on?

Thanks in advance!

Hao

In reply to peterjin:

What you wrote should have worked. are you sure all seq_type_I[2-5] sequences are blocking?

In reply to dave_59:
Hi Dave,

Thanks for the reply.

Actually seq_type_I[0-5] and seq_type_II are same class.
I made a typo on my last post, the declaration should be


//SEQ_TYPE_I[6] and SEQ_TYPE_II are same class, with some different configuration
uvm_seq_type_I  seq_type_I[6];
uvm_seq_type_I  seq_type_II;

But I wonder how to check if a sequence is blocking or not?

This is the sim result:

UVM_INFO $FILE_PATH/my_sequences.sv(562) @ 85810.5ns: uvm_test_top.agt_type_I[1].m_seqr@@seq_type_I[1] [MY_SEQUENCE] End of sequence
UVM_INFO $FILE_PATH/my_sequences.sv(562) @ 85811.5ns: uvm_test_top.agt_type_I[0].m_seqr@@seq_type_I[0] [MY_SEQUENCE] End of sequence
UVM_INFO $FILE_PATH/my_sequences.sv(562) @ 85811.5ns: uvm_test_top.agt_type_II.m_seqr@@seq_type_II [MY_SEQUENCE] End of sequence
UVM_INFO $FILE_PATH/my_test.sv(1023) @ 85811.5ns: uvm_test_top [TEST] After wait fork

Thanks

Hao