RISE_OBJECTION, DROP_OBJECTION AND SET_DRAIN_TIME - NISHUNISARGA/UVM_notes GitHub Wiki
In UVM (Universal Verification Methodology), raise_objection and drop_objection are methods used to control the duration of simulation phases, especially the run_phase. They are part of the UVM phase objection mechanism, which ensures that a phase doesn’t end until all components are done with their tasks/work.
Purpose
- raise_objection: Signals that a component is still performing its tasks and the current phase should not end.
- drop_objection: Signals that the component has completed its tasks and is ready for the phase to end. These methods allow multiple components to synchronize their activities during a phase.
How It Works
- when the UVM phase (like run_phase) starts, the Components can raise objections to indicate they are working on tasks/functionality in that phase.
- The phase continues to work as long as the active objections are present.
- Once all objections are dropped, the phase ends and moves to the next phase.
when to use
- raise the objection before starting the components' activities/work/tasks/functionality.
- drop the objection once all the activities are completed
where we can all them
-
we can call them from any uvm component(test,env,agent,monitor,driver,scoreboard,sequence)
-
In env
-
The environment often manages objections for the overall testbench, ensuring the run_phase does not end prematurely (means Managing the global behavior of the testbench and ensuring all agents, monitors, and sequences are complete before the run_phase ends.)
-
example:
class my_env extends uvm_env; task run_phase(uvm_phase phase); phase.raise_objection(this); `uvm_info("ENV", "Starting environment tasks", UVM_LOW); // Perform some tasks #100; phase.drop_objection(this); endtask endclass
-
-
In driver
-
Any UVM component can raise and drop objections to ensure it completes its work before the phase ends(When generating stimulus or waiting for responses. To ensure the run_phase doesn’t end while the driver is still processing).
-
example:
class my_driver extends uvm_driver; task run_phase(uvm_phase phase); phase.raise_objection(this); `uvm_info("DRIVER", "Driving stimulus", UVM_LOW); repeat (10) begin drive_tx(); #10; end phase.drop_objection(this); endtask endclass
-
-
In Sequence
-
Sequences often raise objections to keeping the run_phase active while generating stimulus.
-
example:
class my_sequence extends uvm_sequence; task body(); phase.raise_objection(this); `uvm_info("SEQUENCE", "Starting of objection", UVM_LOW); start_item(txn); finish_item(txn); phase.drop_objection(this); `uvm_info("SEQUENCE", "end of objection", UVM_LOW); endtask endclass
-
-
In Monitor or Scoreboard
- To allow post-processing or data analysis even after the stimulus is complete.
-
In UVM_test