ovm_objection

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.

Summary
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
class ovm_objection extends ovm_report_object
newCreates a new objection instance.
Objection Control
raise_objectionRaises the number of objections for the source object by count, which defaults to 1.
drop_objectionDrops the number of objections for the source object by count, which defaults to 1.
set_drain_timeSets the drain time on the given object to drain.
Callback Hooks
raisedObjection callback that is called when a raise_objection has reached obj.
droppedObjection callback that is called when a drop_objection has reached obj.
all_droppedObjection callback that is called when a drop_objection has reached obj, and the total count for obj goes to zero.
Objection Status
get_objection_countReturns the current number of objections raised by the given object.
get_objection_totalReturns the current number of objections raised by the given object and all descendants.
get_drain_timeReturns the current drain time set for the given object (default: 0 ns).
display_objectionsDisplays objection information about the given object.

new

function new(string name = "")

Creates a new objection instance.

raise_objection

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.

  • The source and total objection counts for object are increased by count.
  • The objection’s raised virtual method is called, which calls the ovm_component::raised method for all of the components up the hierarchy.

drop_objection

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.

  • The source and total objection counts for object are decreased by count.  It is an error to drop the objection count for object below zero.
  • The objection’s dropped virtual method is called, which calls the ovm_component::dropped method for all of the components up the hierarchy.
  • If the total objection count has not reached zero for object, then the drop is propagated up the object hierarchy as with raise_objection.  Then, each object in the hierarchy will have updated their source counts--objections that they originated--and total counts--the total number of objections by them and all their descendants.

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 drain time was set for the given object, the process waits for that amount of time.
  • The objection’s all_dropped virtual method is called, which calls the ovm_component::all_dropped method (if object is a component).
  • The process then waits for the all_dropped callback to complete.
  • After the drain time has elapsed and all_dropped callback has completed, propagation of the dropped objection to the parent proceeds as described in raise_objection, except as described below.

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.

set_drain_time

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.

raised

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.

dropped

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.

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

get_objection_count

function int get_objection_count (ovm_object obj)

Returns the current number of objections raised by the given object.

get_objection_total

function int get_objection_total (ovm_object obj = null)

Returns the current number of objections raised by the given object and all descendants.

get_drain_time

function time get_drain_time (ovm_object obj)

Returns the current drain time set for the given object (default: 0 ns).

display_objections

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.

ovm_test_done_objection

Built-in end-of-test coordination

Summary
ovm_test_done_objection
Built-in end-of-test coordination
Class Hierarchy
ovm_test_done_objection
Class Declaration
class ovm_test_done_objection extends ovm_objection
Methods
qualifyChecks that the given object is derived from either ovm_component or ovm_sequence_base.
all_droppedThis 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_objectionCalls ovm_objection::raise_objection after calling qualify.
dropCalls ovm_objection::drop_objection after calling qualify.
force_stop

qualify

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.

all_dropped

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

raise_objection

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.

drop

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.

force_stop

virtual task force_stop(ovm_object obj = null)
virtual class ovm_object extends ovm_void
The ovm_object class is the base class for all OVM data and hierarchical classes.
class ovm_report_object extends ovm_object
The ovm_report_object provides an interface to the OVM reporting facility.
class ovm_objection extends ovm_report_object
Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP.
function new(string name = "")
Creates a new objection instance.
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.
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.
function void set_drain_time (ovm_object obj,
time drain)
Sets the drain time on the given object to drain.
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.
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.
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.
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.
function void global_stop_request()
Convenience function for ovm_top.stop_request().
virtual task run ()
The run phase callback is the only predefined phase that is time-consuming, i.e., task-based.
virtual function void raised (ovm_objection objection,
ovm_object source_obj,
int count)
The raised 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 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)
The all_dropped callback is called when a decendant of the component instance raises the specfied objection.
class ovm_test_done_objection extends ovm_objection
Built-in end-of-test coordination
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 class ovm_component extends ovm_report_object
The ovm_component class is the root base class for OVM components.
class ovm_sequence_base extends ovm_sequence_item
The ovm_sequence_base class provides the interfaces needed to create streams of sequence items and/or other sequences.
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.
virtual function void raise_objection (ovm_object obj = null,
int count = 1)
Calls ovm_objection::raise_objection after calling qualify.
virtual function void drop_objection (ovm_object obj = null,
int count = 1)
Calls ovm_objection::drop_objection after calling qualify.
virtual task force_stop(ovm_object obj = null)