Showing posts with label objection. Show all posts
Showing posts with label objection. Show all posts

Tuesday, 6 November 2018

Drop all objection manually in UVM


Test requirement is like,
1) When polling for more than one interrupts by continuously reading different registers in parallel and based on some indication move to next phase of UVM
2) Waiting for some timer to be expired and then moving to next phase of UVM

Let’s take one scenario where,
Driver is raising objection but never dropping objection and requirement is to move to next phase (extract_phase) after #50 timeunit. But because all the objection are not dropped in run_phase, simulation is not going to extract_phase.
Let’s go through example.
-------------------------------------------------------------------------
-------------------------------------------------------------------------


Now let’s take another scenario,
Here driver is dropping objection after #105 timeunit. So simulation will move to next phase after #105. But the requirement is to move to next phase which is extract_phase after #50.
Let’s go through example.
-------------------------------------------------------------------------
-------------------------------------------------------------------------


To fulfill the requirement we need to any how drop the pending objection after #50 to move to next phase after #50.
We can do this by getting list of all uvm_components (through get_objector method of uvm_objection class) who raised objection and then we can manually drop the objection after #50 timeunit.
Let’s go through example.
-------------------------------------------------------------------------
-------------------------------------------------------------------------

Reference:
1) uvm_objection.svh file 

Saturday, 22 July 2017

Extend run_phase using set_drain_time and all_dropped callback after all objection drops

It is more often that two or more components in verification environment are not in sync with each other. And there may be a case where driver/transmitter finish it's job first and call item_done. After item_done is called from driver and if there is no action pending in sequence then start method of sequence finishes and objection is also dropped.
But we want that simulation (more precisely we can say run_phase) should extend to some more time after all objection are dropped, so that other components which are late with respect to driver can finish it's job. We can achieve this by using set_drain_time in UVM.

Let's go through example and see how we can achieve this using set_drain_time in UVM.
--------------------------------------------------------------------

--------------------------------------------------------------------


UVM also provides callback hookups when every objection raises and drops and when all objection drops.
Let's go through example and see how it works,

--------------------------------------------------------------------

--------------------------------------------------------------------
--------------------------------------------------------------------

--------------------------------------------------------------------

Once all the objections are dropped, Drain time takes effect. After Drain time is finished, all_dropped callback takes effect.