P_sequencer

Hi,

Why do we need to use p_sequencer in the UVM testbench containing virtual sequences?

Thanks
Shankar

In reply to shankar_logic:

You should never use p_sequencer in any sequence. For a virtual sequence, the sequence should have handles to the various sequencers that the sub-sequences will run on. After the virtual sequence is created by the test, the sequencer handles will be assigned by the test and the sequence will be started. The virtual sequence will in turn start the sub-sequences on the appropriate sequencers using the sequencer handles.

In reply to cgales:

In reply to shankar_logic:
You should never use p_sequencer in any sequence. For a virtual sequence, the sequence should have handles to the various sequencers that the sub-sequences will run on. After the virtual sequence is created by the test, the sequencer handles will be assigned by the test and the sequence will be started. The virtual sequence will in turn start the sub-sequences on the appropriate sequencers using the sequencer handles.

But the testbench I am currently working contains a macro `uvm_declare_p_sequencer(sequencer_name)

In reply to shankar_logic:

Hi shankar,
p_sequencer always should point to the actual sequencer on which you gonna run your sequence.Preferably its a good practice to point p_sequencer to the virtual sequencer.

In reply to shankar_logic:

You can have a lot of things defined that shouldn’t be used. p_sequencer is one of those. By putting sequencer handles in your virtual sequence, you can start() your virtual sequence on any sequencer. Trying to use p_sequencer just adds additional complexity that isn’t warranted.

In reply to cgales:

Imagine your current project has only one sequencer and you have written the virtual sequences and testcases whose virtual sequence runs on a particular sequencer.Tommorrow your environment has multiple sequencers.Now you have to port all your virtual sequences,testcases to run on a new sequencer.But in my case,I just need to declare new sequencers handles inside virtual sequencer and easy reuse the existing testcases in a very easy way!!

In reply to rajanpassionate:
If you are working with virtual sequencers you do not Need the p_sequencer at all. Because you should start always your virtual sequence manually. And you even do not Need a virtual sequencer in this case.