What is Virtual Seqeuncer???????

Hello guys,

Today we are going to learn that why we actually required virtual sequencer to have in our environment and how we can implement virtual sequencer in our environment using two different methods.

Why Virtual Sequencer?????

 

  • A virtual sequence is a sequence which controls stimulus generation using several sequencers. In UVM architecture, sequences, sequencers and drivers are focused on point interfaces and  hence there needs to be a higher layer sequence to coordinate stimulus generation across different interfaces and the interactions between them which is what a virtual sequence is. 
  • A virtual sequencer is a uvm_sequencer which contains the handles of all the target sequencers  focused on each point interface.  A virtual sequence can be started on a virtual sequencer and the virtual sequence can generate and run sub-sequences on target sequencers in a coordinated manner.   
  • Usage of virtual sequencer is a convenient way of  handling all target sequencers in a single component  and this is useful while creating integrated verification environments (sub-system and system level environments). You can also chain more than one virtual sequencer to a higher layer virtual sequencer in building higher integration testbenches. 
So as we have seen when ever we want to control more than one interface sequence flow thorough single sequence there we need to have some mechanism which control the flow of different sequences on different interfaces this can be achieved by virtual sequencer or virtual sequence mechanism.

How to Implement Virtual Sequencer??????
There are mainly two methods using which one can implement  a mechanism which will control the flow of different sequences on different interfaces. Based on which sequencer we are using either m_sequencer or p_sequencer there are different methods to implement above mechanism.

1) Virtual Sequencer with m_sequencer :

As we know when we are using m_sequencer we are not able to access properties and methods of sequencer into the sequence class so here manually we have to implement those methods through which we can assign virtual sequencer handles to actual sequencers. There are two methods for implementing that logic as shown below.
  1. With Virtual Sequencer Class :
    In this method we are actually creating one virtual sequencer class which contains the handles of all actual sequencers. Now our main task is to how to assign this virtual sequencer class sequencer handles to actual sequencer. For that instantiate this virtual sequencer class in top_env class. In top_env class in connect phase we are connecting virtual sequencer handle to actual sequencer. Now as we are having instance of top_env in top_test, we can pass virtual sequencer handle in vseq.start(virtual_seqr_handle) method. In virtual seq top class we declare all this handles and using type casting we can assign them to m_sequencer.

    Use below eda link for further reference :
    https://www.edaplayground.com/x/3R65

  2. Without Virtual Sequencer Class :
    Here in this method we do not require to make virtual_sequence class instead we will create one function in top_test which will connect actual sequencers to virtual sequencer handles. So every time in extended test when ever you want to use seq.start method just before it call this function which will connect all virtual sequencer handles to actual sequencers. There are mainly two advantage of this method over the other one.
    • Extra virtual sequencer class is not required.
    • Type casting is also not required in this method for connecting virtual sequencer handles to actual sequencers.

    Use below eda link for further reference :
    https://www.edaplayground.com/x/2LXJ


2) Virtual Sequencer with p_sequencer :

If we are using p_sequencer we can directly use its properties in our sequence class so in our base sequence class we can directly connect locally declared sequencer handles to virtual sequencer handles. For doing this we have to add  `uvm_declare_p_sequencer(sequencer_name) macro in our top_virtual_sequence class also by using p_sequencer.handle name  we can connect virtual sequencer handles to handles declared here locally.
So basically in this method we do not require type casting or even any function mechanism for connecting locally declared sequencer handles to virtual sequencer handles.

Use below eda link for further reference :

Hope you will enjoy this article and article will be helpful to you in your projects. 

Comments

Popular posts from this blog

'WITH' Operator in SV Coverage

Difference Between m_sequencer and p_sequencer

Cross Auto Bin Max