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