Jump to content

m_sequencer vs p_sequencer


Recommended Posts

Hi Karthik,

m_sequencer : this enables sequence item and sequences to access the sequencer and use services it make avaliable. it's set automatically when you call start();

p_sequencer : it need a declaration , implement a function to set its value. `uvm_declare_p_sequencer will do the things.

Link to comment
Share on other sites

Hi Tedd, Roman,

Thanks for the answers.

I am migrating code from uvm1.0ea to uvm1.0p1. And I have a virtual_sequencer and associated sequences. In the current code (ea version) I use p_sequencer to run the sequences on:

eg:

`uvm_do_on(iq_srfmem_read_order, p_sequencer.iq_seqr)

I am not sure what the best way is to migrate this code.

Should I use the `uvm_declare_p_sequencer macro and use the p_sequencer or is there a way to do the same with m_sequencer ?

Thanks for the help,

Karthik.

Link to comment
Share on other sites

Hi,

looking at the src files from uvm1.o-p1,

m_sequencer is indeed protected and p_sequencer is not.

Looking at the `uvm_declare_p_sequencer definition:

`define uvm_declare_p_sequencer(SEQUENCER) \

SEQUENCER p_sequencer;\

virtual function void m_set_p_sequencer();\

super.m_set_p_sequencer(); \

if( !$cast(p_sequencer, m_sequencer)) \

`uvm_fatal("DCLPSQ", \

$psprintf("%m %s Error casting p_sequencer, please verify that this sequence/sequence item is intended to execute on this type of sequencer", get_full_name())) \

endfunction

p_sequencer point to the same sequencer as m_sequencer, but is declared as a USER defined SEQUENCER rather than the uvm_sequencer_base.

So I guess using the `uvm_declare_p_sequencer macro is the only way I can use virtual sequencers and sequences.

Thanks for the help.

Link to comment
Share on other sites

hi,

  1. m_* members (fields+methods) are considered internal UVM fields and should never be used. they are implementation details, can change at any time and without any notification. i think the technical reason is that SV does not have 'friends' like c++ has.
  2. p_* are normal members and can be used.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...