Jump to content

Grab, Ungrab lock and unlock for sequences


Recommended Posts

You can use grab in the sequence body or in a parent before the sequence is started (I believe).

grab puts the sequence in the beginning of the queue, lock adds in at it's normal priority.

p_sequencer is a specific sequencer subtype. m_sequencer is the generic type.

Link to comment
Share on other sites

Grabbing a sequencer - If sequencer is doing some sequence and based on some external events if user wants sequencer to pause the current sequence, he/she can grab sequencer and start another sequence. Once the started sequence finishes sequencer can resume the normal operation, upon ungrab. This mechanism is generally used to mimic CPU behavior, where CPU is doing a normal bus operation and when interrup comes, CPU needs to suspend the normal operation and start interrupt handling. Once interrupt handling is over, CPU should resume the normal operation from where it was suspended.

p_sequencer is a handle to parent sequence inside sequence. Since sequences are dynamic objects, they cannot be accessed hierarchically. If inside a sequence, one needs to access hierarchical paths (mostly parent sequencer), p_sequencer can be used.

While p_sequencer returns a extended (typed) parent sequencer, m_sequencer returns base sequencer handle type.

In short, if there is a 'field' in extended sequencer, sequence can access that field using 'p_sequencer.field'.

Link to comment
Share on other sites

  • 2 weeks later...

hi,

>wat is the significance of p_sequencer and m_sequencer?

ANY class member prefixed with "m_" is considered a UVM private field/function/task and should be considered as implementation detail and is therefore subject to change without notice.

/uwe

I think this is an unfortunate coding convention. We (and many others) use the m_ prefix to mean member of class (to distinguish from local variables etc). This one of the few coding conventions that actually works in my experience. UVM should have declared private things local, or, when this is not possible, use a coding convention unlikely to clash with something else.

About the p_sequencer: I wonder what naming convention this is. It seems this symbol is there only to maximize confusion. One should think that users could simply call get_sequencer() to get hold of a handle to the sequencer and then introduce their own cast to the required sequencer when it is _understood_ what get_sequencer returns. It seems to me this is just one example of a problem with UVM, and that is that there are too many little helpers that actually does nothing to help, but instead hide and mystify even the simplest of things.

Regards,

Erling

Link to comment
Share on other sites

hi,

uvm uses the same convention. m_* just tells you NOT to use it. the reason to have it public accessible is because sv doesnt have friend classes, doesnt allow get_sequencer().somefunction() and uvm_sequencer f=get_sequencer(); f.somefunction() ... is looooonnnnnngggggg

p_* is always used as shortcut for parent_*, same arguments apply for the get_parent().xxxx() doesnt work.

/uwe

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...