In reply to abs:
I found an article Virtual Sequences in UVM: Why, How?
However, I don't agree with the following part in the article at all.
Quote:
This is not the most efficient way of controlling the sequencers as we are directly using the simple sequences inside the test and making it complex. By doing this, we cannot reuse these complex scenarios further to develop more complex scenarios.
Obviously, having virtual sequencer(s) is making the environment more complex and we can reuse each sequence to create more complex senarios.
On the other hand, I understand the following part.
Quote:
Rather if we try to create a sequence and use this sequence in the test, then we can re-use these sequences in other tests (or sequences) as well. Also it will be easier to maintain and debug these sequences compared to creating entire scenario in the top-level test.
So, my advocacy of virtual sequence use is to make that virtual sequence reusable for another virtual sequences. This is true only when the virtual sequence is complex like the sequences inside that virtual sequences have complex interactions.
E.g.)
task virtual_sequence1::body()
fork
begin
seq1.start(seqr1);
@seq2.flagB;
seq1.param1 = seq2.cnt1*4;
repeat(2) seq1.start(seq1);
end
begin
@seq1.flagA;
seq2.start(seqr2);
@seq1.flagC;
seq2.val = seq1.cnt2+seq1.cnt1;
@seq1.flagC;
seq2.start(seqr2)
end
join
endtask
task virtual_sequence2::body()
v_seq1.start(null);
fork
seq1.start(seqr1);
seq2.start(seqr2);
join
v_seq1.start(null);
endtask
In other words, virtual sequence is totally senseless if no complex sequence interaction is considered like simple parallel or serial sequences run.
I.e.)
fork
seq1.start(seqr1);
seq2.start(seqr2);
join
seq1.start(seqr1);
seq2.start(seqr2);
This is my conclusion.