The following classes define the objection mechanism and end-of-test functionality, which is based on uvm_objection.
Objection Mechanism | The following classes define the objection mechanism and end-of-test functionality, which is based on uvm_objection. |
uvm_objection | Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP. |
uvm_callbacks_objection | The uvm_callbacks_objection is a specialized uvm_objection which contains callbacks for the raised and dropped events. |
uvm_objection_callback | The uvm_objection is the callback type that defines the callback implementations for an objection callback. |
Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP. In particular, the uvm_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 <uvm_component::run> phase. When all participating components have dropped their raised objections with uvm_test_done, an implicit call to global_stop_request is issued.
Tracing of objection activity can be turned on to follow the activity of the objection mechanism. It may be turned on for a specific objection instance with uvm_objection::trace_mode, or it can be set for all objections from the command line using the option +UVM_OBJECTION_TRACE.
uvm_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. | ||||
trace_mode | Set or get the trace mode for the objection object. | ||||
Objection Control | |||||
m_set_hier_mode | Hierarchical mode only needs to be set for intermediate components, not for uvm_root or a leaf component. | ||||
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_objectors | Returns the current list of objecting objects (objects that raised an objection but have not dropped it). | ||||
wait_for | Waits for the raised, dropped, or all_dropped event to occur in the given obj. | ||||
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 new( string name = "" )
Creates a new objection instance. Accesses the command line argument +UVM_OBJECTION_TRACE to turn tracing on for all objection objects.
function bit trace_mode ( int mode = -1 )
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. The return value is the mode prior to being reset.
function void m_set_hier_mode ( uvm_object obj )
Hierarchical mode only needs to be set for intermediate components, not for uvm_root or a leaf component.
virtual function void raise_objection ( uvm_object obj = null, string description = "", 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, uvm_top, is chosen.
Rasing an objection causes the following.
virtual function void drop_objection ( uvm_object obj = null, string description = "", 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, uvm_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 uvm_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.
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 ( uvm_object obj, uvm_object source_obj, string description, int count )
Objection callback that is called when a raise_objection has reached obj. The default implementation calls uvm_component::raised.
virtual function void dropped ( uvm_object obj, uvm_object source_obj, string description, int count )
Objection callback that is called when a drop_objection has reached obj. The default implementation calls uvm_component::dropped.
virtual task all_dropped ( uvm_object obj, uvm_object source_obj, string description, 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 uvm_component::all_dropped.
function void get_objectors( ref uvm_object list[$] )
Returns the current list of objecting objects (objects that raised an objection but have not dropped it).
task wait_for( uvm_objection_event objt_event, uvm_object obj = null )
Waits for the raised, dropped, or all_dropped event to occur in the given obj. The task returns after all corresponding callbacks have been executed.
function int get_objection_count ( uvm_object obj = null )
Returns the current number of objections raised by the given object.
function int get_objection_total ( uvm_object obj = null )
Returns the current number of objections raised by the given object and all descendants.
function time get_drain_time ( uvm_object obj = null )
Returns the current drain time set for the given object (default: 0 ns).
function void display_objections( uvm_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, uvm_root, is chosen. The show_header argument allows control of whether a header is output.
The uvm_callbacks_objection is a specialized uvm_objection which contains callbacks for the raised and dropped events. Callbacks happend for the three standard callback activities, raised, dropped, and all_dropped.
The uvm_heartbeat mechanism use objections of this type for creating heartbeat conditions. Whenever the objection is raised or dropped, the component which did the raise/drop is considered to be alive.
uvm_callbacks_objection | ||||||
The uvm_callbacks_objection is a specialized uvm_objection which contains callbacks for the raised and dropped events. | ||||||
Class Hierarchy | ||||||
| ||||||
Class Declaration | ||||||
| ||||||
Methods | ||||||
raised | Executes the uvm_objection_callback::raised method in the user callback class whenever this objection is raised at the object obj. | |||||
dropped | Executes the uvm_objection_callback::dropped method in the user callback class whenever this objection is dropped at the object obj. | |||||
all_dropped | Executes the uvm_objection_callback::all_dropped task in the user callback class whenever the objection count for this objection in reference to obj goes to zero. |
virtual function void raised ( uvm_object obj, uvm_object source_obj, string description, int count )
Executes the uvm_objection_callback::raised method in the user callback class whenever this objection is raised at the object obj.
virtual function void dropped ( uvm_object obj, uvm_object source_obj, string description, int count )
Executes the uvm_objection_callback::dropped method in the user callback class whenever this objection is dropped at the object obj.
virtual task all_dropped ( uvm_object obj, uvm_object source_obj, string description, int count )
Executes the uvm_objection_callback::all_dropped task in the user callback class whenever the objection count for this objection in reference to obj goes to zero.
The uvm_objection is the callback type that defines the callback implementations for an objection callback. A user uses the callback type uvm_objection_cbs_t to add callbacks to specific objections.
class my_objection_cb extends uvm_objection_callback; function new(string name); super.new(name); endfunction virtual function void raised (uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count); $display("%0t: Objection %s: Raised for %s", $time, objection.get_name(), obj.get_full_name()); endfunction endclass ... initial begin my_objection_cb cb = new("cb"); uvm_objection_cbs_t::add(null, cb); //typewide callback end
uvm_objection_callback | |||||
The uvm_objection is the callback type that defines the callback implementations for an objection callback. | |||||
Class Hierarchy | |||||
| |||||
Class Declaration | |||||
| |||||
Methods | |||||
raised | Objection raised callback function. | ||||
dropped | Objection dropped callback function. | ||||
all_dropped | Objection all_dropped callback function. |
virtual function void raised ( uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count )
Objection raised callback function. Called by uvm_callbacks_objection::raised.
virtual function void dropped ( uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count )
Objection dropped callback function. Called by uvm_callbacks_objection::dropped.
virtual task all_dropped ( uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count )
Objection all_dropped callback function. Called by uvm_callbacks_objection::all_dropped.
Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP.
class uvm_objection extends uvm_report_object
The uvm_callbacks_objection is a specialized uvm_objection which contains callbacks for the raised and dropped events.
class uvm_callbacks_objection extends uvm_objection
The uvm_objection is the callback type that defines the callback implementations for an objection callback.
class uvm_objection_callback extends uvm_callback
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_object extends uvm_void
The uvm_report_object provides an interface to the UVM reporting facility.
class uvm_report_object extends uvm_object
Creates a new objection instance.
function new( string name = "" )
Set or get the trace mode for the objection object.
function bit trace_mode ( int mode = -1 )
Hierarchical mode only needs to be set for intermediate components, not for uvm_root or a leaf component.
function void m_set_hier_mode ( uvm_object obj )
Raises the number of objections for the source object by count, which defaults to 1.
virtual function void raise_objection ( uvm_object obj = null, string description = "", int count = 1 )
Drops the number of objections for the source object by count, which defaults to 1.
virtual function void drop_objection ( uvm_object obj = null, string description = "", int count = 1 )
Objection callback that is called when a raise_objection has reached obj.
virtual function void raised ( uvm_object obj, uvm_object source_obj, string description, int count )
Objection callback that is called when a drop_objection has reached obj.
virtual function void dropped ( uvm_object obj, uvm_object source_obj, string description, 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 ( uvm_object obj, uvm_object source_obj, string description, int count )
Returns the current list of objecting objects (objects that raised an objection but have not dropped it).
function void get_objectors( ref uvm_object list[$] )
Waits for the raised, dropped, or all_dropped event to occur in the given obj.
task wait_for( uvm_objection_event objt_event, uvm_object obj = null )
Returns the current number of objections raised by the given object.
function int get_objection_count ( uvm_object obj = null )
Returns the current number of objections raised by the given object and all descendants.
function int get_objection_total ( uvm_object obj = null )
Returns the current drain time set for the given object (default: 0 ns).
function time get_drain_time ( uvm_object obj = null )
Displays objection information about the given object.
function void display_objections( uvm_object obj = null, bit show_header = 1 )
The raised callback is called when this or a descendant of this component instance raises the specfied objection.
virtual function void raised ( uvm_objection objection, uvm_object source_obj, string description, int count )
The dropped callback is called when this or a descendant of this component instance drops the specfied objection.
virtual function void dropped ( uvm_objection objection, uvm_object source_obj, string description, int count )
The all_droppped callback is called when all objections have been dropped by this component and all its descendants.
virtual task all_dropped ( uvm_objection objection, uvm_object source_obj, string description, int count )
Executes the uvm_objection_callback::raised method in the user callback class whenever this objection is raised at the object obj.
virtual function void raised ( uvm_object obj, uvm_object source_obj, string description, int count )
Objection raised callback function.
virtual function void raised ( uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count )
Executes the uvm_objection_callback::dropped method in the user callback class whenever this objection is dropped at the object obj.
virtual function void dropped ( uvm_object obj, uvm_object source_obj, string description, int count )
Objection dropped callback function.
virtual function void dropped ( uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count )
Executes the uvm_objection_callback::all_dropped task in the user callback class whenever the objection count for this objection in reference to obj goes to zero.
virtual task all_dropped ( uvm_object obj, uvm_object source_obj, string description, int count )
Objection all_dropped callback function.
virtual task all_dropped ( uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count )
The uvm_callback class is the base class for user-defined callback classes.
class uvm_callback extends uvm_object