UVM OBJECTIONS - sagarpattar005/set_up GitHub Wiki
What is an objection mechanism in UVM?
Objection mechanism is a UVM strategy used to decide the end of test. There are number of zero time consuming phases before and after the run_phase. The run_phase is the only time consuming phase which is run in parallel for all the components. With that being said, run_phases of different components complete at different time and there comes a need to track the end of run phases of different components to finally end the test. This need of tracking the end of run_phases of different components. And this is done using the uvm_objections.
A point here to note is that, objections can be raised by components as well as objects. For example a sequence before starting can raise an objection and drop the objection after completion. Objection raising/dropping is not only limited to the run phase of components.
##How is the objection mechanism work?
The uvm_objection class provides a means for sharing a counter between participating components and sequences. Each participant may “raises” and “drops” objections asynchronously, which increases or decreases the counter value. When the counter reaches zero (from a non-zero value), an “all dropped” condition occurs. The meaning of an all-dropped event depends on the intended application for a particular objection object.
##Objection controlling mechanisms:
There are primarily three methods used to control the objections:
raise_objection() drop_objection() set_drain_time() UVM testbench counter will increment or decrement the total objection count based on raise_objection() and drop_objection().
Set_drain_time() method will drain the object till the specified amount of time. This method is mainly used to extend the simulation time after all objection are dropped and it will synchronize all uvm_components.
##Tracing the Objections:
+UVM_OBJECTION_TRACE is a command line option used to trace the objections. A simulation log with the +UVM_OBJECTION_TRACE switch would contain the below information:
Look for the string “OBJTN_TRC” in the simulation log file to check the raised and dropped objection.
For a basic example please refer https://www.edaplayground.com/x/N24r
Bonus tip: add +UVM_PHASE_TRACE to augment objection tracing when debugging phase transition issues.
##Objection status mechanisms:
The following methods can be used to get objections information.
raised: This callback is called when descendant of specific object is raised. dropped: This callback is called when descendant of specific object is dropped. all_dropped: This callback is called when all the descendant of uvm components are dropped. get_objection: This method will get the information of the objection which are raised and not dropped. get_objection_count: This method will return the value of objections raised. get_objection_total: This method will return the value of objections raised in the object and all descendants. For better understanding please refer to the code at https://www.edaplayground.com/x/nNVC explaining all the methods.
##Advance usage of objection mechanism
The following methods are also part of the uvm_objection class:
clear(): Immediately clears the objection state. All counts are cleared and the any processes waiting on a call to wait_for(UVM_ALL_DROPPED, uvm_top) are released.
trace_mode(): Set or get the trace mode for the objection object. If no argument is specified (or an argument other than 0 or 1) the current trace mode is unaffected. A trace_mode of 0 turns tracing off. A trace mode of 1 turns tracing on.
get_drain_time(): Returns drain time for object ( default: 0ns ).
display_objections(): Displays objection information about object.about putty login
- about vnc
##UVM OBJECTIONS What is an objection mechanism in UVM?
Objection mechanism is a UVM strategy used to decide the end of test. There are number of zero time consuming phases before and after the run_phase. The run_phase is the only time consuming phase which is run in parallel for all the components. With that being said, run_phases of different components complete at different time and there comes a need to track the end of run phases of different components to finally end the test. This need of tracking the end of run_phases of different components. And this is done using the uvm_objections.
A point here to note is that, objections can be raised by components as well as objects. For example a sequence before starting can raise an objection and drop the objection after completion. Objection raising/dropping is not only limited to the run phase of components.
##How is the objection mechanism work?
The uvm_objection class provides a means for sharing a counter between participating components and sequences. Each participant may “raises” and “drops” objections asynchronously, which increases or decreases the counter value. When the counter reaches zero (from a non-zero value), an “all dropped” condition occurs. The meaning of an all-dropped event depends on the intended application for a particular objection object.
##Objection controlling mechanisms:
There are primarily three methods used to control the objections:
raise_objection() drop_objection() set_drain_time() UVM testbench counter will increment or decrement the total objection count based on raise_objection() and drop_objection().
Set_drain_time() method will drain the object till the specified amount of time. This method is mainly used to extend the simulation time after all objection are dropped and it will synchronize all uvm_components.
##Tracing the Objections:
+UVM_OBJECTION_TRACE is a command line option used to trace the objections. A simulation log with the +UVM_OBJECTION_TRACE switch would contain the below information:
Look for the string “OBJTN_TRC” in the simulation log file to check the raised and dropped objection.
For a basic example please refer https://www.edaplayground.com/x/N24r
Bonus tip: add +UVM_PHASE_TRACE to augment objection tracing when debugging phase transition issues.
##Objection status mechanisms:
The following methods can be used to get objections information.
raised: This callback is called when descendant of specific object is raised. dropped: This callback is called when descendant of specific object is dropped. all_dropped: This callback is called when all the descendant of uvm components are dropped. get_objection: This method will get the information of the objection which are raised and not dropped. get_objection_count: This method will return the value of objections raised. get_objection_total: This method will return the value of objections raised in the object and all descendants. For better understanding please refer to the code at https://www.edaplayground.com/x/nNVC explaining all the methods.
##Advance usage of objection mechanism
The following methods are also part of the uvm_objection class:
clear(): Immediately clears the objection state. All counts are cleared and the any processes waiting on a call to wait_for(UVM_ALL_DROPPED, uvm_top) are released.
trace_mode(): Set or get the trace mode for the objection object. If no argument is specified (or an argument other than 0 or 1) the current trace mode is unaffected. A trace_mode of 0 turns tracing off. A trace mode of 1 turns tracing on.
get_drain_time(): Returns drain time for object ( default: 0ns ).
display_objections(): Displays objection information about object.