Virtual Sequencer - Casting

Hello , i want to know what is the relation between p_sequencer and m_sequencer and why we need to casting ?

also if i am using the method of the uvm declare p sequencer does it violate the environment ? p_sequencer has access to anything in the env?

thanks!

The variable m_sequencer is the generic handle (of type uvm_sequencer parameterized with the sequence_item type) to the sequencer that the sequence is running on. The variable p_sequencer is the handle to the actual sequencer.

You should never use p_sequencer as it removes flexibility in your environment. Instead, you should add any required data elements to the sequence itself.

For agent specific sequencers, they should be declared as a typedef with the required sequence_item. Virtual sequences should always run on the ‘null’ sequencer.