Creating virtual sequencer

Dear All,

I’m trying to understand about virtual sequencer concept I found the below links.

/code

//Create a virtual sequencer
class v_seqr extends uvm_sequencer;
uvm_sequencer#(seq_item_1) seqr1;
seqr_2 seqr2;

function new(string name=‘v_seqr’, ubm_component parent);
endfunction
endclass

in the above example OP just used “class v_seqr extends uvm_sequencer;”
there is of no use to declare “virtual keyword”.
My question that how do we make virtual sequencer?
I thought that that was created such as “virtual calss v_seqr extends uvm_sequencer”.

Would you please let me know about how to create the virtual sequencer?

In reply to UVM_LOVE:

The word ‘virtual’ means that the sequencer generates no specific sequence_items. It is used only to start sub-sequences on another sequencer.

You will never see the keyword ‘virtual’ when declaring a virtual sequencer. The virtual sequencer will extend uvm_sequencer with no specialization.

Please see the UVM Cookbook.
Note that we don not recommend the use of virtual sequence**r**s, as they are not strictly necessary and can limit reuse by enforcing additional hierarchy in your environment. The link above shows how you can use virtual sequences without using a virtual sequencer. However, if you insist on using a virtual sequencer, there is a link at the bottom of the page that discusses them.

In reply to tfitz:

Please see the UVM Cookbook.
Note that we don not recommend the use of virtual sequence**r**s, as they are not strictly necessary and can limit reuse by enforcing additional hierarchy in your environment. The link above shows how you can use virtual sequences without using a virtual sequencer. However, if you insist on using a virtual sequencer, there is a link at the bottom of the page that discusses them.

Thanks tfitz,
I think this is depending on the project style. if I need to handle of 300 sequencers or more , once I will make a virtual sequences library then I can use handy keyword (p_sequence) and connect to sequences. it is more handy and cost effective. What do you think ?

If you dont mind, Would you please introduce about what you recommend like it?

In reply to UVM_LOVE:

I believe you misunderstood tfitz. He meant you do not need a virtual sequencer, because you can start virtual sequences on a 'null’sequencer like this:

vseq.start(null);

If you want to use a virtual sequencer you can define it as you did. Any sequencer which does not itself create seq_items can be considered to be a virtual sequencer

In reply to chr_sue:

In reply to UVM_LOVE:
I believe you misunderstood tfitz. He meant you do not need a virtual sequencer, because you can start virtual sequences on a 'null’sequencer like this:

vseq.start(null);

If you want to use a virtual sequencer you can define it as you did. Any sequencer which does not itself create seq_items can be considered to be a virtual sequencer

Regarding of your comments, I took for a while and searching it. but I can’t find about the usage of 'uvm_declare_p_sequencer(…) in the link.
So I’m confused what he saying about do not use virtual sequencer means it is or not.

In reply to UVM_LOVE:

Please see Advanced UVM: Layered Sequences.
Notice that nowhere do I use `uvm_declare_p_sequencer(…)
Good luck.