[source]

Class uvm_objection

uvm_pkg::uvm_objection + m_objections[$] : uvm_objection + m_top_all_dropped : bit + all_dropped() + clear(): void + convert2string(): string + create(): uvm_object + display_objections(): void + do_copy(): void + drop_objection(): void + dropped(): void + get_drain_time(): time + get_objection_count(): int + get_objection_total(): int + get_objectors(): void + get_propagate_mode(): bit + get_type(): type_id + get_type_name(): string + m_drop(): void + m_execute_scheduled_forks() + m_forked_drain() + m_get_parent(): uvm_object + m_init_objections(): void + m_propagate(): void + m_raise(): void + m_report(): void + raise_objection(): void + raised(): void + set_drain_time(): void + set_propagate_mode(): void + trace_mode(): bit + wait_for() + wait_for_total_count() uvm_pkg::uvm_test_done_objection

Inheritance Diagram of uvm_objection

uvm_pkg::uvm_objection + m_objections[$] : uvm_objection + m_top_all_dropped : bit + all_dropped() + clear(): void + convert2string(): string + create(): uvm_object + display_objections(): void + do_copy(): void + drop_objection(): void + dropped(): void + get_drain_time(): time + get_objection_count(): int + get_objection_total(): int + get_objectors(): void + get_propagate_mode(): bit + get_type(): type_id + get_type_name(): string + m_drop(): void + m_execute_scheduled_forks() + m_forked_drain() + m_get_parent(): uvm_object + m_init_objections(): void + m_propagate(): void + m_raise(): void + m_report(): void + raise_objection(): void + raised(): void + set_drain_time(): void + set_propagate_mode(): void + trace_mode(): bit + wait_for() + wait_for_total_count() m_objections[]

Collaboration Diagram of uvm_objection

Objections provide a facility for coordinating status information between two or more participating components, objects, and even module-based IP.

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.

Typedefs

Name

Actual Type

Description

type_id

uvm_object_registry#(uvm_objection, "uvm_objection")

Below is all of the basic data stuff that is needed for a uvm_object for factory registration, printing, comparing, etc.

Constructors

function new ( string name ) [source]

Creates a new objection instance. Accesses the command line argument +UVM_OBJECTION_TRACE to turn tracing on for all objection objects.

Functions

function bit trace_mode ( int mode ) [source]

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 set_propagate_mode ( bit prop_mode ) [source]

Sets the propagation mode for this objection.

By default, objections support hierarchical propagation for components. For example, if we have the following basic component tree:

uvm_top.parent.child

Any objections raised by 'child' would get propagated down to parent, and then to uvm_test_top. Resulting in the following counts and totals:

                     | count | total |
uvm_top.parent.child |     1 |    1  |
uvm_top.parent       |     0 |    1  |
uvm_top              |     0 |    1  |

While propagations such as these can be useful, if they are unused by the testbench then they are simply an unnecessary performance hit. If the testbench is not going to use this functionality, then the performance can be improved by setting the propagation mode to 0.

When propagation mode is set to 0, all intermediate callbacks between the source and top will be skipped. This would result in the following counts and totals for the above objection:

                     | count | total |
uvm_top.parent.child |     1 |    1  |
uvm_top.parent       |     0 |    0  |
uvm_top              |     0 |    1  |

Since the propagation mode changes the behavior of the objection, it can only be safely changed if there are no objections raised
or draining . Any attempts to change the mode while objections are raised or draining will result in an error.

function bit get_propagate_mode ( ) [source]

Returns the propagation mode for this objection.

virtual function void raise_objection ( uvm_object obj, string description, int count ) [source]

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_root, is chosen.

Raising an objection causes the following.

  • The source and total objection counts for object are increased by

    count . description is a string that marks a specific objection and is used in tracing/debug.

  • The objection's raised virtual method is called, which calls the uvm_component::raised method for all of the components up the hierarchy.

virtual function void drop_objection ( uvm_object obj, string description, int count ) [source]

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_root, 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 uvm_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 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 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 uvm_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 descendants 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 propagated 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.

virtual function void clear ( uvm_object obj ) [source]

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.

The caller, if a uvm_object-based object, should pass its 'this' handle to the obj argument to document who cleared the objection. Any drain_times set by the user are not affected.

function void set_drain_time ( uvm_object obj, time drain ) [source]

AE

set_drain_time(drain,obj=null)?

virtual function void raised ( uvm_object obj, uvm_object source_obj, string description, int count ) [source]

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 ) [source]

Objection callback that is called when a drop_objection has reached obj . The default implementation calls uvm_component::dropped.

function void get_objectors ( uvm_object list ) [source]

Returns the current list of objecting objects (objects that raised an objection but have not dropped it).

function int get_objection_count ( uvm_object obj ) [source]

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

function int get_objection_total ( uvm_object obj ) [source]

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

function time get_drain_time ( uvm_object obj ) [source]

Returns the current drain time set for the given object (default

0 ns).

virtual function string convert2string ( ) [source]
function void display_objections ( uvm_object obj, bit show_header ) [source]

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.

static function type_id get_type ( ) [source]
virtual function uvm_object create ( string name ) [source]
virtual function string get_type_name ( ) [source]
virtual function void do_copy ( uvm_object rhs ) [source]

Tasks

virtual function all_dropped ( uvm_object obj, uvm_object source_obj, string description, int count ) [source]

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 wait_for ( uvm_objection_event objt_event, uvm_object obj ) [source]

Waits for the raised, dropped, or all_dropped event to occur in the given obj . The task returns after all corresponding callbacks for that event have been executed.

function wait_for_total_count ( uvm_object obj, int count ) [source]