Jump to content

Proper way to use objection ?


Recommended Posts

What is the proper way to specify objection inside a sequence ? Do I need to add objection code in both regular sequences and virtual sequences ?

Method 1 :

virtual task pre_body();

uvm_test_done.raise_objection(this);

endtask : pre_body

virtual task post_body();

uvm_test_done.drop_objection(this);

endtask : post_body

Method 2:

virtual task pre_body;

if (starting_phase != null)

starting_phase.raise_objection(this, "Starting seq");

endtask: pre_body

virtual task post_body;

if ((get_parent_sequence() == null) && (starting_phase != null))

starting_phase.drop_objection(this, "Ending seq");

endtask: post_body

Link to comment
Share on other sites

hi,

>What is the proper way to specify objection inside a sequence ?

the typical way would be:

virtual task pre_body;

if (starting_phase != null)

starting_phase.raise_objection(this, "Starting seq");

endtask: pre_body

virtual task post_body;

if (starting_phase != null)

starting_phase.drop_objection(this, "stoping seq");

endtask

but finally its upto the user to specify the time ranges which are protected from phase progression.

>Do I need to add objection code in both regular sequences and virtual sequences ?

you always need to raise an objection if you want the phasing system to wait until your behaviour is finished.this is the same for all like sequences, virtual sequences, initial blocks, running tasks, etc...

>your code:

- method1 will not really work with the new phasing (because its not objecting the end of a phase)

- method2/post_body

>if ((get_parent_sequence() == null) && (starting_phase != null))

it seems strange that you have a different expression in the drop which might lead to a different drop number than raise and therefore errors out.

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