Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP. In particular, the ovm_test_done built-in objection provides a means for coordinating when to end a test, i.e. when to call global_stop_request to end the ovm_component::run phase. When all participating components have dropped their raised objections with ovm_test_done, an implicit call to global_stop_request is issued.
ovm_objection | ||||
Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP. | ||||
Class Hierarchy | ||||
| ||||
Class Declaration | ||||
| ||||
new | Creates a new objection instance. | |||
Objection Control | ||||
raise_objection | Raises the number of objections for the source object by count, which defaults to 1. | |||
drop_objection | Drops the number of objections for the source object by count, which defaults to 1. | |||
set_drain_time | Sets the drain time on the given object to drain. | |||
Callback Hooks | ||||
raised | Objection callback that is called when a raise_objection has reached obj. | |||
dropped | Objection callback that is called when a drop_objection has reached obj. | |||
all_dropped | Objection callback that is called when a drop_objection has reached obj, and the total count for obj goes to zero. | |||
Objection Status | ||||
get_objection_count | Returns the current number of objections raised by the given object. | |||
get_objection_total | Returns the current number of objections raised by the given object and all descendants. | |||
get_drain_time | Returns the current drain time set for the given object (default: 0 ns). | |||
display_objections | Displays objection information about the given object. |
function void raise_objection ( ovm_object obj = null, int count = 1 )
Raises the number of objections for the source object by count, which defaults to 1. The object is usually the this handle of the caller. If object is not specified or null, the implicit top-level component, ovm_top, is chosen.
Rasing an objection causes the following.
function void drop_objection ( ovm_object obj = null, int count = 1 )
Drops the number of objections for the source object by count, which defaults to 1. The object is usually the this handle of the caller. If object is not specified or null, the implicit top-level component, ovm_top, is chosen.
Dropping an objection causes the following.
If the total objection count reaches zero, propagation up the hierarchy is deferred until a configurable drain-time has passed and the ovm_component::all_dropped callback for the current hierarchy level has returned. The following process occurs for each instance up the hierarchy from the source caller:
A process is forked in a non-blocking fashion, allowing the drop call to return. The forked process then does the following:
If a new objection for this object or any of its descendents is raised during the drain time or during execution of the all_dropped callback at any point, the hierarchical chain described above is terminated and the dropped callback does not go up the hierarchy. The raised objection will propagate up the hierarchy, but the number of raised propagated up is reduced by the number of drops that were pending waiting for the all_dropped/drain time completion. Thus, if exactly one objection caused the count to go to zero, and during the drain exactly one new objection comes in, no raises or drops are propagted up the hierarchy,
As an optimization, if the object has no set drain-time and no registered callbacks, the forked process can be skipped and propagation proceeds immediately to the parent as described.
function void set_drain_time ( ovm_object obj, time drain )
Sets the drain time on the given object to drain.
The drain time is the amount of time to wait once all objections have been dropped before calling the all_dropped callback and propagating the objection to the parent.
If a new objection for this object or any of its descendents is raised during the drain time or during execution of the all_dropped callbacks, the drain_time/all_dropped execution is terminated.
virtual function void raised ( ovm_object obj, ovm_object source_obj, int count )
Objection callback that is called when a raise_objection has reached obj. The default implementation calls ovm_component::raised.
virtual function void dropped ( ovm_object obj, ovm_object source_obj, int count )
Objection callback that is called when a drop_objection has reached obj. The default implementation calls ovm_component::dropped.
virtual task all_dropped ( ovm_object obj, ovm_object source_obj, int count )
Objection callback that is called when a drop_objection has reached obj, and the total count for obj goes to zero. This callback is executed after the drain time associated with obj. The default implementation calls ovm_component::all_dropped.
function int get_objection_count ( ovm_object obj )
Returns the current number of objections raised by the given object.
function int get_objection_total ( ovm_object obj = null )
Returns the current number of objections raised by the given object and all descendants.
function time get_drain_time ( ovm_object obj )
Returns the current drain time set for the given object (default: 0 ns).
protected function string m_display_objections( ovm_object obj = null, bit show_header = 1 )
Displays objection information about the given object. If object is not specified or null, the implicit top-level component, <ovm_top>, is chosen. The show_header argument allows control of whether a header is output.
Built-in end-of-test coordination
ovm_test_done_objection | |||||
Built-in end-of-test coordination | |||||
Class Hierarchy | |||||
| |||||
Class Declaration | |||||
| |||||
Methods | |||||
qualify | Checks that the given object is derived from either ovm_component or ovm_sequence_base. | ||||
all_dropped | This callback is called when the given object’s objection count reaches zero; if the object is the implicit top-level, <ovm_top> then it means there are no more objections raised for the ovm_test_done objection. | ||||
raise_objection | Calls ovm_objection::raise_objection after calling qualify. | ||||
drop | Calls ovm_objection::drop_objection after calling qualify. | ||||
force_stop |
virtual function void qualify( ovm_object obj = null, bit is_raise )
Checks that the given object is derived from either ovm_component or ovm_sequence_base.
virtual task all_dropped ( ovm_object obj, ovm_object source_obj, int count )
This callback is called when the given object’s objection count reaches zero; if the object is the implicit top-level, <ovm_top> then it means there are no more objections raised for the ovm_test_done objection. Thus, after calling ovm_objection::all_dropped, this method will call global_stop_request to stop the current task-based phase (e.g. run).
virtual function void raise_objection ( ovm_object obj = null, int count = 1 )
Calls ovm_objection::raise_objection after calling qualify. If the object is not provided or is null, then the implicit top-level component, ovm_top, is chosen.
virtual function void drop_objection ( ovm_object obj = null, int count = 1 )
Calls ovm_objection::drop_objection after calling qualify. If the object is not provided or is null, then the implicit top-level component, ovm_top, is chosen.
virtual task force_stop( ovm_object obj = null )
The ovm_object class is the base class for all OVM data and hierarchical classes.
virtual class ovm_object extends ovm_void
The ovm_report_object provides an interface to the OVM reporting facility.
class ovm_report_object extends ovm_object
Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP.
class ovm_objection extends ovm_report_object
Creates a new objection instance.
function new( string name = "" )
Raises the number of objections for the source object by count, which defaults to 1.
function void raise_objection ( ovm_object obj = null, int count = 1 )
Drops the number of objections for the source object by count, which defaults to 1.
function void drop_objection ( ovm_object obj = null, int count = 1 )
Sets the drain time on the given object to drain.
function void set_drain_time ( ovm_object obj, time drain )
Objection callback that is called when a raise_objection has reached obj.
virtual function void raised ( ovm_object obj, ovm_object source_obj, int count )
Objection callback that is called when a drop_objection has reached obj.
virtual function void dropped ( ovm_object obj, ovm_object source_obj, int count )
Objection callback that is called when a drop_objection has reached obj, and the total count for obj goes to zero.
virtual task all_dropped ( ovm_object obj, ovm_object source_obj, int count )
Returns the current number of objections raised by the given object.
function int get_objection_count ( ovm_object obj )
Returns the current number of objections raised by the given object and all descendants.
function int get_objection_total ( ovm_object obj = null )
Returns the current drain time set for the given object (default: 0 ns).
function time get_drain_time ( ovm_object obj )
Displays objection information about the given object.
protected function string m_display_objections( ovm_object obj = null, bit show_header = 1 )
Convenience function for ovm_top.stop_request().
function void global_stop_request()
The run phase callback is the only predefined phase that is time-consuming, i.e., task-based.
virtual task run ()
The raised callback is called when a decendant of the component instance raises the specfied objection.
virtual function void raised ( ovm_objection objection, ovm_object source_obj, int count )
The dropped callback is called when a decendant of the component instance raises the specfied objection.
virtual function void dropped ( ovm_objection objection, ovm_object source_obj, int count )
The all_dropped callback is called when a decendant of the component instance raises the specfied objection.
virtual task all_dropped ( ovm_objection objection, ovm_object source_obj, int count )
Built-in end-of-test coordination
class ovm_test_done_objection extends ovm_objection
Checks that the given object is derived from either ovm_component or ovm_sequence_base.
virtual function void qualify( ovm_object obj = null, bit is_raise )
The ovm_component class is the root base class for OVM components.
virtual class ovm_component extends ovm_report_object
The ovm_sequence_base class provides the interfaces needed to create streams of sequence items and/or other sequences.
class ovm_sequence_base extends ovm_sequence_item
This callback is called when the given object’s objection count reaches zero; if the object is the implicit top-level, ovm_top then it means there are no more objections raised for the ovm_test_done objection.
virtual task all_dropped ( ovm_object obj, ovm_object source_obj, int count )
Calls ovm_objection::raise_objection after calling qualify.
virtual function void raise_objection ( ovm_object obj = null, int count = 1 )
Calls ovm_objection::drop_objection after calling qualify.
virtual function void drop_objection ( ovm_object obj = null, int count = 1 )
virtual task force_stop( ovm_object obj = null )