[source]

Class uvm_component

uvm_pkg::uvm_component + enable_stop_interrupt : int + m_build_done : bit + m_config_deprecated_warned : bit + m_config_set : bit + m_current_phase : uvm_phase + m_name : string + m_parent : uvm_component + m_phase_imps[uvm_phase] : uvm_phase + m_phasing_active : int + m_time_settings[$] : m_verbosity_setting + m_uvm_applied_cl_action[$] : uvm_cmdline_parsed_arg_t + m_uvm_applied_cl_sev[$] : uvm_cmdline_parsed_arg_t + m_verbosity_settings[$] : m_verbosity_setting + print_config_matches : bit + print_enabled : bit + recording_detail : int unsigned + tr_database : uvm_tr_database + type_name : string + accept_tr(): void + all_dropped() + apply_config_settings(): void + begin_child_tr(): integer + begin_tr(): integer + build(): void + build_phase(): void + check(): void + check_config_usage(): void + check_phase(): void + clone(): uvm_object + configure_phase() + connect(): void + connect_phase(): void + create(): uvm_object + create_component(): uvm_component + create_object(): uvm_object + do_flush(): void + do_kill_all(): void + do_print(): void + do_resolve_bindings(): void + dropped(): void + end_of_elaboration(): void + end_of_elaboration_phase(): void + end_tr(): void + extract(): void + extract_phase(): void + final_phase(): void + flush(): void + free_tr_stream(): void + get_child(): uvm_component + get_children(): void + get_config_int(): bit + get_config_object(): bit + get_config_string(): bit + get_depth(): int unsigned + get_domain(): uvm_domain + get_first_child(): int + get_full_name(): string + get_next_child(): int + get_num_children(): int + get_parent(): uvm_component + get_tr_stream(): uvm_tr_stream + get_type_name(): string + has_child(): int + kill(): void + lookup(): uvm_component + m_apply_verbosity_settings(): void + m_do_pre_abort(): void + m_get_tr_database(): uvm_tr_database + m_set_cl_action(): void + m_set_cl_msg_args(): void + m_set_cl_sev(): void + m_set_cl_verb(): void + main_phase() + massage_scope(): string + phase_ended(): void + phase_ready_to_end(): void + phase_started(): void + post_configure_phase() + post_main_phase() + post_reset_phase() + post_shutdown_phase() + pre_abort(): void + pre_configure_phase() + pre_main_phase() + pre_reset_phase() + pre_shutdown_phase() + print_config(): void + print_config_settings(): void + print_config_with_audit(): void + print_override_info(): void + raised(): void + record_error_tr(): integer + record_event_tr(): integer + report(): void + report_phase(): void + reset_phase() + resolve_bindings(): void + resume() + run() + run_phase() + set_config_int(): void + set_config_object(): void + set_config_string(): void + set_domain(): void + set_inst_override(): void + set_inst_override_by_type(): void + set_int_local(): void + set_name(): void + set_phase_imp(): void + set_report_default_file_hier(): void + set_report_id_action_hier(): void + set_report_id_file_hier(): void + set_report_id_verbosity_hier(): void + set_report_severity_action_hier(): void + set_report_severity_file_hier(): void + set_report_severity_id_action_hier(): void + set_report_severity_id_file_hier(): void + set_report_severity_id_verbosity_hier(): void + set_report_verbosity_level_hier(): void + set_type_override(): void + set_type_override_by_type(): void + shutdown_phase() + start_of_simulation(): void + start_of_simulation_phase(): void + status(): string + stop() + stop_phase() + suspend() uvm_pkg::uvm_root uvm_pkg::uvm_env uvm_pkg::uvm_sequencer_base uvm_pkg::uvm_port_component_base uvm_pkg::uvm_tlm_fifo_base <T> uvm_pkg::uvm_tlm_req_rsp_channel <REQ, RSP> uvm_pkg::uvm_in_order_comparator <T, comp_type, convert, pair_type> uvm_pkg::uvm_algorithmic_comparator <BEFORE, AFTER, TRANSFORMER> uvm_pkg::uvm_random_stimulus <T> uvm_pkg::uvm_subscriber <T> uvm_pkg::uvm_monitor uvm_pkg::uvm_driver <REQ, RSP> uvm_pkg::uvm_push_driver <REQ, RSP> uvm_pkg::uvm_scoreboard uvm_pkg::uvm_agent uvm_pkg::uvm_test uvm_pkg::uvm_reg_predictor <BUSTYPE>

Inheritance Diagram of uvm_component

uvm_pkg::uvm_component + enable_stop_interrupt : int + m_build_done : bit + m_config_deprecated_warned : bit + m_config_set : bit + m_current_phase : uvm_phase + m_name : string + m_parent : uvm_component + m_phase_imps[uvm_phase] : uvm_phase + m_phasing_active : int + m_time_settings[$] : m_verbosity_setting + m_uvm_applied_cl_action[$] : uvm_cmdline_parsed_arg_t + m_uvm_applied_cl_sev[$] : uvm_cmdline_parsed_arg_t + m_verbosity_settings[$] : m_verbosity_setting + print_config_matches : bit + print_enabled : bit + recording_detail : int unsigned + tr_database : uvm_tr_database + type_name : string + accept_tr(): void + all_dropped() + apply_config_settings(): void + begin_child_tr(): integer + begin_tr(): integer + build(): void + build_phase(): void + check(): void + check_config_usage(): void + check_phase(): void + clone(): uvm_object + configure_phase() + connect(): void + connect_phase(): void + create(): uvm_object + create_component(): uvm_component + create_object(): uvm_object + do_flush(): void + do_kill_all(): void + do_print(): void + do_resolve_bindings(): void + dropped(): void + end_of_elaboration(): void + end_of_elaboration_phase(): void + end_tr(): void + extract(): void + extract_phase(): void + final_phase(): void + flush(): void + free_tr_stream(): void + get_child(): uvm_component + get_children(): void + get_config_int(): bit + get_config_object(): bit + get_config_string(): bit + get_depth(): int unsigned + get_domain(): uvm_domain + get_first_child(): int + get_full_name(): string + get_next_child(): int + get_num_children(): int + get_parent(): uvm_component + get_tr_stream(): uvm_tr_stream + get_type_name(): string + has_child(): int + kill(): void + lookup(): uvm_component + m_apply_verbosity_settings(): void + m_do_pre_abort(): void + m_get_tr_database(): uvm_tr_database + m_set_cl_action(): void + m_set_cl_msg_args(): void + m_set_cl_sev(): void + m_set_cl_verb(): void + main_phase() + massage_scope(): string + phase_ended(): void + phase_ready_to_end(): void + phase_started(): void + post_configure_phase() + post_main_phase() + post_reset_phase() + post_shutdown_phase() + pre_abort(): void + pre_configure_phase() + pre_main_phase() + pre_reset_phase() + pre_shutdown_phase() + print_config(): void + print_config_settings(): void + print_config_with_audit(): void + print_override_info(): void + raised(): void + record_error_tr(): integer + record_event_tr(): integer + report(): void + report_phase(): void + reset_phase() + resolve_bindings(): void + resume() + run() + run_phase() + set_config_int(): void + set_config_object(): void + set_config_string(): void + set_domain(): void + set_inst_override(): void + set_inst_override_by_type(): void + set_int_local(): void + set_name(): void + set_phase_imp(): void + set_report_default_file_hier(): void + set_report_id_action_hier(): void + set_report_id_file_hier(): void + set_report_id_verbosity_hier(): void + set_report_severity_action_hier(): void + set_report_severity_file_hier(): void + set_report_severity_id_action_hier(): void + set_report_severity_id_file_hier(): void + set_report_severity_id_verbosity_hier(): void + set_report_verbosity_level_hier(): void + set_type_override(): void + set_type_override_by_type(): void + shutdown_phase() + start_of_simulation(): void + start_of_simulation_phase(): void + status(): string + stop() + stop_phase() + suspend() uvm_pkg::uvm_tr_database uvm_pkg::uvm_phase tr_database m_phase_imps[] m_current_phase m_parent

Collaboration Diagram of uvm_component

The uvm_component class is the root base class for UVM components. In addition to the features inherited from uvm_object and uvm_report_object, uvm_component provides the following interfaces:

Hierarchy

provides methods for searching and traversing the component hierarchy.

Phasing

defines a phased test flow that all components follow, with a group of standard phase methods and an API for custom phases and multiple independent phasing domains to mirror DUT behavior e.g. power

Reporting

provides a convenience interface to the uvm_report_handler. All messages, warnings, and errors are processed through this interface.

Transaction recording

provides methods for recording the transactions produced or consumed by the component to a transaction database (vendor specific).

Factory

provides a convenience interface to the uvm_factory. The factory is used to create new components and other objects based on type-wide and instance-specific configuration.

The uvm_component is automatically seeded during construction using UVM seeding, if enabled. All other objects must be manually reseeded, if appropriate. See uvm_object::reseed for more information.

Variables

Name

Type

Description

enable_stop_interrupt

int

Variable- enable_stop_interrupt - DEPRECATED

This bit allows a component to raise an objection to the stopping of the current phase. It affects only time consuming phases (such as the run phase).

When this bit is set, the stop task in the component is called as a result of a call to global_stop_request. Components that are sensitive to an immediate killing of its run-time processes should set this bit and implement the stop task to prepare for shutdown.

bit

Setting this static variable causes uvm_config_db::get() to print info about matching configuration settings as they are being applied.

bit

This bit determines if this component should automatically be printed as a child of its parent object.

By default, all children are printed. However, this bit allows a parent component to disable the printing of specific children.

tr_database

uvm_tr_database

Specifies the uvm_tr_database object to use for begin_tr and other methods in the <Recording Interface>.
Default is uvm_coreservice_t::get_default_tr_database.

type_name

string

recording_detail

int unsigned

Constructors

function new ( string name, uvm_component parent ) [source]

Creates a new component with the given leaf instance name and handle to its parent . If the component is a top-level component (i.e. it is created in a static module or interface), parent should be null .

The component will be inserted as a child of the parent object, if any. If parent already has a child by the given name , an error is produced.

If parent is null , then the component will become a child of the implicit top-level component, uvm_top .

All classes derived from uvm_component must call super.new(name,parent). New

Structs

typedef struct uvm_cmdline_parsed_arg_t [source]

Functions

virtual function uvm_component get_parent ( ) [source]

Returns a handle to this component's parent, or null if it has no parent. Get_parent

virtual function string get_full_name ( ) [source]

Returns the full hierarchical name of this object. The default implementation concatenates the hierarchical name of the parent, if any, with the leaf name of this object, as given by uvm_object::get_name. Get_full_name

function void get_children ( uvm_component children ) [source]

This function populates the end of the children array with the list of this component's children.

uvm_component array[$];
my_comp.get_children(array);
foreach(array[i])
  do_something(array[i]);. Get_children
function uvm_component get_child ( string name ) [source]

Function

get_child. Get_child

function int get_next_child ( string name ) [source]

Function

get_next_child. Get_next_child

function int get_first_child ( string name ) [source]

These methods are used to iterate through this component's children, if any. For example, given a component with an object handle, comp , the following code calls uvm_object::print for each child:

string name;
uvm_component child;
if (comp.get_first_child(name))
  do begin
    child = comp.get_child(name);
    child.print();
  end while (comp.get_next_child(name));. Get_first_child
function int get_num_children ( ) [source]

Returns the number of this component's children. Get_num_children

function int has_child ( string name ) [source]

Returns 1 if this component has a child with the given name , 0 otherwise. Has_child

virtual function void set_name ( string name ) [source]

Function

set_name

Renames this component to name and recalculates all descendants' full names. This is an internal function for now. Set_name

function uvm_component lookup ( string name ) [source]

Looks for a component with the given hierarchical name relative to this component. If the given name is preceded with a '.' (dot), then the search begins relative to the top level (absolute lookup). The handle of the matching component is returned, else null . The name must not contain wildcards. Lookup

function int unsigned get_depth ( ) [source]

Returns the component's depth from the root level. uvm_top has a depth of 0. The test and any other top level components have a depth of 1, and so on. Get_depth

virtual function void build_phase ( uvm_phase phase ) [source]

The uvm_build_phase phase implementation method.

Any override should call super.build_phase(phase) to execute the automatic configuration of fields registered in the component by calling apply_config_settings. To turn off automatic configuration for a component, do not call super.build_phase(phase).

This method should never be called directly. Phase methods

these are prototypes for the methods to be implemented in user components build_phase() has a default implementation, the others have an empty default

virtual function void build ( ) [source]

For backward compatibility the base build_phase method calls build. Backward compatibility build function

virtual function void connect_phase ( uvm_phase phase ) [source]

The uvm_connect_phase phase implementation method.

This method should never be called directly. These phase methods are common to all components in UVM. For backward compatibility, they call the old style name (without the _phse)

virtual function void connect ( ) [source]

For backward compatibility the base connect_phase method calls connect. These are the old style phase names. In order for runtime phase names to not conflict with user names, the _phase postfix was added.

virtual function void end_of_elaboration_phase ( uvm_phase phase ) [source]

The uvm_end_of_elaboration_phase phase implementation method.

This method should never be called directly.

virtual function void end_of_elaboration ( ) [source]

For backward compatibility the base end_of_elaboration_phase method calls end_of_elaboration.

virtual function void start_of_simulation_phase ( uvm_phase phase ) [source]

The uvm_start_of_simulation_phase phase implementation method.

This method should never be called directly.

virtual function void start_of_simulation ( ) [source]

For backward compatibility the base start_of_simulation_phase method calls start_of_simulation.

virtual function void extract_phase ( uvm_phase phase ) [source]

The uvm_extract_phase phase implementation method.

This method should never be called directly.

virtual function void extract ( ) [source]

For backward compatibility the base extract_phase method calls extract.

virtual function void check_phase ( uvm_phase phase ) [source]

The uvm_check_phase phase implementation method.

This method should never be called directly.

virtual function void check ( ) [source]

For backward compatibility the base check_phase method calls check.

virtual function void report_phase ( uvm_phase phase ) [source]

The uvm_report_phase phase implementation method.

This method should never be called directly.

virtual function void report ( ) [source]

For backward compatibility the base report_phase method calls report.

virtual function void final_phase ( uvm_phase phase ) [source]

The uvm_final_phase phase implementation method.

This method should never be called directly.

virtual function void phase_started ( uvm_phase phase ) [source]

Invoked at the start of each phase. The phase argument specifies the phase being started. Any threads spawned in this callback are not affected when the phase ends. Phase_started

phase_started() and phase_ended() are extra callbacks called at the beginning and end of each phase, respectively. Since they are called for all phases the phase is passed in as an argument so the extender can decide what to do, if anything, for each phase.

virtual function void phase_ready_to_end ( uvm_phase phase ) [source]

Invoked when all objections to ending the given phase and all sibling phases have been dropped, thus indicating that phase is ready to begin a clean exit. Sibling phases are any phases that have a common successor phase in the schedule plus any phases that sync'd to the current phase. Components needing to consume delta cycles or advance time to perform a clean exit from the phase may raise the phase's objection.

phase.raise_objection(this,&quot;Reason&quot;);

It is the responsibility of this component to drop the objection once it is ready for this phase to end (and processes killed). If no objection to the given phase or sibling phases are raised, then phase_ended() is called after a delta cycle. If any objection is raised, then when all objections to ending the given phase and siblings are dropped, another iteration of phase_ready_to_end is called. To prevent endless iterations due to coding error, after 20 iterations, phase_ended() is called regardless of whether previous iteration had any objections raised. Phase_ready_to_end

virtual function void phase_ended ( uvm_phase phase ) [source]

Invoked at the end of each phase. The phase argument specifies the phase that is ending. Any threads spawned in this callback are not affected when the phase ends. Phase_ended

function void set_domain ( uvm_domain domain, int hier ) [source]

Apply a phase domain to this component and, if hier is set, recursively to all its children.

Calls the virtual define_domain method, which derived components can override to augment or replace the domain definition of its base class. Set_domain

assigns this component [tree] to a domain. adds required schedules into graph If called from build, hier won't recurse into all chilren (which don't exist yet) If we have components inherit their parent's domain by default, then hier isn't needed and we need a way to prevent children from inheriting this component's domain

function uvm_domain get_domain ( ) [source]

Return handle to the phase domain set on this component. Get_domain

function void set_phase_imp ( uvm_phase phase, uvm_phase imp, int hier ) [source]

Override the default implementation for a phase on this component (tree) with a custom one, which must be created as a singleton object extending the default one and implementing required behavior in exec and traverse methods

The hier specifies whether to apply the custom functor to the whole tree or just this component. Set_phase_imp

function string status ( ) [source]
virtual function void kill ( ) [source]

Function- kill - DEPRECATED

Kills the process tree associated with this component's currently running task-based phase, e.g., run. Kill

virtual function void do_kill_all ( ) [source]

Function- do_kill_all - DEPRECATED

Recursively calls kill on this component and all its descendants, which abruptly ends the currently running task-based phase, e.g., run. See run_phase for better options to ending a task-based phase. Do_kill_all

virtual function void resolve_bindings ( ) [source]

Processes all port, export, and imp connections. Checks whether each port's min and max connection requirements are met.

It is called just before the end_of_elaboration phase.

Users should not call directly. Resolve_bindings

function string massage_scope ( string scope ) [source]
virtual function void set_config_int ( string inst_name, string field_name, uvm_bitstream_t value ) [source]

Function- set_config_int. Set_config_int

virtual function void set_config_string ( string inst_name, string field_name, string value ) [source]

Function- set_config_string. Set_config_string

virtual function void set_config_object ( string inst_name, string field_name, uvm_object value, bit clone ) [source]

Set_config_object

virtual function bit get_config_int ( string field_name, uvm_bitstream_t value ) [source]

Function- get_config_int. Get_config_int

virtual function bit get_config_string ( string field_name, string value ) [source]

Function- get_config_string. Get_config_string

virtual function bit get_config_object ( string field_name, uvm_object value, bit clone ) [source]

Function- get_config_object

These methods retrieve configuration settings made by previous calls to their set_config_* counterparts. As the methods' names suggest, there is direct support for integral types, strings, and objects. Settings of other types can be indirectly supported by defining an object to contain them.

Configuration settings are stored in a global table and in each component instance. With each call to a get_config_* method, a top-down search is made for a setting that matches this component's full name and the given field_name . For example, say this component's full instance name is top.u1.u2. First, the global configuration table is searched. If that fails, then it searches the configuration table in component 'top', followed by top.u1.

The first instance/field that matches causes value to be written with the value of the configuration setting and 1 is returned. If no match is found, then value is unchanged and the 0 returned.

Calling the get_config_object method requires special handling. Because value is an output of type uvm_object, you must provide a uvm_object handle to assign to (not a derived class handle). After the call, you can then $cast to the actual type.

For example, the following code illustrates how a component designer might call upon the configuration mechanism to assign its data object property, whose type myobj_t derives from uvm_object.

class mycomponent extends uvm_component;

  local myobj_t data;

  function void build_phase(uvm_phase phase);
    uvm_object tmp;
    super.build_phase(phase);
    if(get_config_object(&quot;data&quot;, tmp))
      if (!$cast(data, tmp))
        uvm_error(&quot;CFGERR&quot;,&quot;error! config setting for &#39;data&#39; not of type myobj_t&quot;)
      endfunction
    ...

The above example overrides the build_phase method. If you want to retain any base functionality, you must call super.build_phase(uvm_phase phase).

The clone bit clones the data inbound. The get_config_object method can also clone the data outbound.

See Members for information on setting the global configuration table. Get_config_object

Note that this does not honor the set_config_object clone bit

function void check_config_usage ( bit recurse ) [source]

Check all configuration settings in a components configuration table to determine if the setting has been used, overridden or not used. When recurse is 1 (default), configuration for this and all child components are recursively checked. This function is automatically called in the check phase, but can be manually called at any time.

To get all configuration information prior to the run phase, do something like this in your top object:

function void start_of_simulation_phase(uvm_phase phase);
  check_config_usage();
endfunction. Check_config_usage
virtual function void apply_config_settings ( bit verbose ) [source]

Searches for all config settings matching this component's instance path. For each match, the appropriate set_local method is called using the matching config setting's field_name and value. Provided the set_local method is implemented, the component property associated with the field_name is assigned the given value.

This function is called by uvm_component::build_phase.

The apply_config_settings method determines all the configuration settings targeting this component and calls the appropriate set_local method to set each one. To work, you must override one or more set_local methods to accommodate setting of your component's specific properties. Any properties registered with the optional uvm_field macros do not require special handling by the set_local methods; the macros provide the set_*_local functionality for you.

If you do not want apply_config_settings to be called for a component, then the build_phase() method should be overloaded and you should not call super.build_phase(phase). Likewise, apply_config_settings can be overloaded to customize automated configuration.

When the verbose bit is set, all overrides are printed as they are applied. If the component's print_config_matches property is set, then apply_config_settings is automatically called with verbose = 1. Apply_config_settings

Called without arguments, print_config_settings prints all configuration information for this component, as set by previous calls to uvm_config_db::set(). The settings are printing in the order of their precedence.

If field is specified and non-empty, then only configuration settings matching that field, if any, are printed. The field may not contain wildcards.

If comp is specified and non- null , then the configuration for that component is printed.

If recurse is set, then configuration information for all comp 's children and below are printed as well.

This function has been deprecated. Use print_config instead. Print_config_settings

Print_config_settings prints all configuration information for this component, as set by previous calls to uvm_config_db::set() and exports to the resources pool. The settings are printing in the order of their precedence.

If recurse is set, then configuration information for all children and below are printed as well.

if audit is set then the audit trail for each resource is printed along with the resource name and value. Print_config

Operates the same as print_config except that the audit bit is forced to 1. This interface makes user code a bit more readable as it avoids multiple arbitrary bit settings in the argument list.

If recurse is set, then configuration information for all children and below are printed as well. Print_config_with_audit

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

The raised callback is called when this or a descendant of this component instance raises the specified objection . The source_obj is the object that originally raised the objection. The description is optionally provided by the source_obj to give a reason for raising the objection. The count indicates the number of objections raised by the source_obj .

virtual function void dropped ( uvm_objection objection, uvm_object source_obj, string description, int count ) [source]

The dropped callback is called when this or a descendant of this component instance drops the specified objection . The source_obj is the object that originally dropped the objection. The description is optionally provided by the source_obj to give a reason for dropping the objection. The count indicates the number of objections dropped by the source_obj .

function uvm_component create_component ( string requested_type_name, string name ) [source]

A convenience function for uvm_factory::create_component_by_name, this method calls upon the factory to create a new child component whose type corresponds to the preregistered type name, requested_type_name , and instance name, name . This method is equivalent to:

factory.create_component_by_name(requested_type_name,
                                 get_full_name(), name, this);

If the factory determines that a type or instance override exists, the type of the component created may be different than the requested type. See set_type_override and set_inst_override. See also uvm_factory for details on factory operation. Create_component

function uvm_object create_object ( string requested_type_name, string name ) [source]

A convenience function for uvm_factory::create_object_by_name, this method calls upon the factory to create a new object whose type corresponds to the preregistered type name, requested_type_name , and instance name, name . This method is equivalent to:

factory.create_object_by_name(requested_type_name,
                              get_full_name(), name);

If the factory determines that a type or instance override exists, the type of the object created may be different than the requested type. See uvm_factory for details on factory operation. Create_object

static function void set_type_override_by_type ( uvm_object_wrapper original_type, uvm_object_wrapper override_type, bit replace ) [source]

A convenience function for uvm_factory::set_type_override_by_type, this method registers a factory override for components and objects created at this level of hierarchy or below. This method is equivalent to:

factory.set_type_override_by_type(original_type, override_type,replace);

The relative_inst_path is relative to this component and may include wildcards. The original_type represents the type that is being overridden. In subsequent calls to uvm_factory::create_object_by_type or uvm_factory::create_component_by_type, if the requested_type matches the original_type and the instance paths match, the factory will produce the override_type .

The original and override type arguments are lightweight proxies to the types they represent. See set_inst_override_by_type for information on usage. Set_type_override_by_type (static)

function void set_inst_override_by_type ( string relative_inst_path, uvm_object_wrapper original_type, uvm_object_wrapper override_type ) [source]

A convenience function for uvm_factory::set_inst_override_by_type, this method registers a factory override for components and objects created at this level of hierarchy or below. In typical usage, this method is equivalent to:

factory.set_inst_override_by_type( original_type,
                                   override_type,
                                   {get_full_name(),&quot;.&quot;,
                                    relative_inst_path});

The relative_inst_path is relative to this component and may include wildcards. The original_type represents the type that is being overridden. In subsequent calls to uvm_factory::create_object_by_type or uvm_factory::create_component_by_type, if the requested_type matches the original_type and the instance paths match, the factory will produce the override_type .

The original and override types are lightweight proxies to the types they represent. They can be obtained by calling type::get_type() , if implemented by type , or by directly calling type::type_id::get() , where type is the user type and type_id is the name of the typedef to <uvm_object_registry #(T,Tname)> or <uvm_component_registry #(T,Tname)>.

If you are employing the uvm_*_utils macros, the typedef and the get_type method will be implemented for you. For details on the utils macros refer to <Utility and Field Macros for Components and Objects>.

The following example shows uvm_*_utils usage:

class comp extends uvm_component;
  uvm_component_utils(comp)
  ...
endclass

class mycomp extends uvm_component;
  uvm_component_utils(mycomp)
  ...
endclass

class block extends uvm_component;
  uvm_component_utils(block)
  comp c_inst;
  virtual function void build_phase(uvm_phase phase);
    set_inst_override_by_type(&quot;c_inst&quot;,comp::get_type(),
                                       mycomp::get_type());
  endfunction
  ...
endclass. Set_inst_override_by_type
static function void set_type_override ( string original_type_name, string override_type_name, bit replace ) [source]

A convenience function for uvm_factory::set_type_override_by_name, this method configures the factory to create an object of type override_type_name whenever the factory is asked to produce a type represented by original_type_name . This method is equivalent to:

factory.set_type_override_by_name(original_type_name,
                                  override_type_name, replace);

The original_type_name typically refers to a preregistered type in the factory. It may, however, be any arbitrary string. Subsequent calls to create_component or create_object with the same string and matching instance path will produce the type represented by override_type_name. The override_type_name must refer to a preregistered type in the factory. Set_type_override (static)

function void set_inst_override ( string relative_inst_path, string original_type_name, string override_type_name ) [source]

A convenience function for uvm_factory::set_inst_override_by_name, this method registers a factory override for components created at this level of hierarchy or below. In typical usage, this method is equivalent to:

factory.set_inst_override_by_name(original_type_name,
                                  override_type_name,
                                  {get_full_name(),&quot;.&quot;,
                                   relative_inst_path}
                                   );

The relative_inst_path is relative to this component and may include wildcards. The original_type_name typically refers to a preregistered type in the factory. It may, however, be any arbitrary string. Subsequent calls to create_component or create_object with the same string and matching instance path will produce the type represented by override_type_name . The override_type_name must refer to a preregistered type in the factory. Set_inst_override

This factory debug method performs the same lookup process as create_object and create_component, but instead of creating an object, it prints information about what type of object would be created given the provided arguments. Print_override_info

function void set_report_id_verbosity_hier ( string id, int verbosity ) [source]

Function

set_report_id_verbosity_hier. Set_report_id_verbosity_hier

function void set_report_severity_id_verbosity_hier ( uvm_severity severity, string id, int verbosity ) [source]

These methods recursively associate the specified verbosity with reports of the given severity , id , or severity-id pair. A verbosity associated with a particular severity-id pair takes precedence over a verbosity associated with id, which takes precedence over a verbosity associated with a severity.

For a list of severities and their default verbosities, refer to uvm_report_handler. Set_report_severity_id_verbosity_hier

function void set_report_severity_action_hier ( uvm_severity severity, uvm_action action ) [source]

Function

set_report_severity_action_hier. Set_report_severity_action_hier

function void set_report_id_action_hier ( string id, uvm_action action ) [source]

Function

set_report_id_action_hier. Set_report_id_action_hier

function void set_report_severity_id_action_hier ( uvm_severity severity, string id, uvm_action action ) [source]

These methods recursively associate the specified action with reports of the given severity , id , or severity-id pair. An action associated with a particular severity-id pair takes precedence over an action associated with id, which takes precedence over an action associated with a severity.

For a list of severities and their default actions, refer to uvm_report_handler. Set_report_severity_id_action_hier

function void set_report_default_file_hier ( UVM_FILE file ) [source]

Function

set_report_default_file_hier. Set_report_default_file_hier

function void set_report_severity_file_hier ( uvm_severity severity, UVM_FILE file ) [source]

Function

set_report_severity_file_hier. Set_report_severity_file_hier

function void set_report_id_file_hier ( string id, UVM_FILE file ) [source]

Function

set_report_id_file_hier. Set_report_id_file_hier

function void set_report_severity_id_file_hier ( uvm_severity severity, string id, UVM_FILE file ) [source]

These methods recursively associate the specified FILE descriptor with reports of the given severity , id , or severity-id pair. A FILE associated with a particular severity-id pair takes precedence over a FILE associated with id, which take precedence over an a FILE associated with a severity, which takes precedence over the default FILE descriptor.

For a list of severities and other information related to the report mechanism, refer to uvm_report_handler. Set_report_severity_id_file_hier

function void set_report_verbosity_level_hier ( int verbosity ) [source]

This method recursively sets the maximum verbosity level for reports for this component and all those below it. Any report from this component subtree whose verbosity exceeds this maximum will be ignored.

See uvm_report_handler for a list of predefined message verbosity levels and their meaning. Set_report_verbosity_level_hier

virtual function void pre_abort ( ) [source]

This callback is executed when the message system is executing a <UVM_EXIT> action. The exit action causes an immediate termination of the simulation, but the pre_abort callback hook gives components an opportunity to provide additional information to the user before the termination happens. For example, a test may want to executed the report function of a particular component even when an error condition has happened to force a premature termination you would write a function like:

function void mycomponent::pre_abort();
  report();
endfunction

The pre_abort() callback hooks are called in a bottom-up fashion.

function void accept_tr ( uvm_transaction tr, time accept_time ) [source]

This function marks the acceptance of a transaction, tr , by this component. Specifically, it performs the following actions:

Calls the tr 's uvm_transaction::accept_tr method, passing to it the accept_time argument.

Calls this component's do_accept_tr method to allow for any post-begin action in derived classes.

Triggers the component's internal accept_tr event. Any processes waiting on this event will resume in the next delta cycle. Accept_tr

function integer begin_tr ( uvm_transaction tr, string stream_name, string label, string desc, time begin_time, integer parent_handle ) [source]

This function marks the start of a transaction, tr , by this component. Specifically, it performs the following actions:

Calls tr 's uvm_transaction::begin_tr method, passing to it the begin_time argument. The begin_time should be greater than or equal to the accept time. By default, when begin_time = 0, the current simulation time is used.

If recording is enabled (recording_detail != UVM_OFF), then a new database-transaction is started on the component's transaction stream given by the stream argument. No transaction properties are recorded at this time.

Calls the component's do_begin_tr method to allow for any post-begin action in derived classes.

Triggers the component's internal begin_tr event. Any processes waiting on this event will resume in the next delta cycle.

A handle to the transaction is returned. The meaning of this handle, as well as the interpretation of the arguments stream_name , label , and desc are vendor specific. Begin_tr

function integer begin_child_tr ( uvm_transaction tr, integer parent_handle, string stream_name, string label, string desc, time begin_time ) [source]

This function marks the start of a child transaction, tr , by this component. Its operation is identical to that of begin_tr, except that an association is made between this transaction and the provided parent transaction. This association is vendor-specific. Begin_child_tr

function void end_tr ( uvm_transaction tr, time end_time, bit free_handle ) [source]

This function marks the end of a transaction, tr , by this component. Specifically, it performs the following actions:

Calls tr 's uvm_transaction::end_tr method, passing to it the end_time argument. The end_time must at least be greater than the begin time. By default, when end_time = 0, the current simulation time is used.

The transaction's properties are recorded to the database-transaction on which it was started, and then the transaction is ended. Only those properties handled by the transaction's do_record method (and optional uvm_*_field macros) are recorded.

Calls the component's do_end_tr method to accommodate any post-end action in derived classes.

Triggers the component's internal end_tr event. Any processes waiting on this event will resume in the next delta cycle.

The free_handle bit indicates that this transaction is no longer needed. The implementation of free_handle is vendor-specific. End_tr

function integer record_error_tr ( string stream_name, uvm_object info, string label, string desc, time error_time, bit keep_active ) [source]

This function marks an error transaction by a component. Properties of the given uvm_object, info , as implemented in its uvm_object::do_record method, are recorded to the transaction database.

An error_time of 0 indicates to use the current simulation time. The keep_active bit determines if the handle should remain active. If 0, then a zero-length error transaction is recorded. A handle to the database-transaction is returned.

Interpretation of this handle, as well as the strings stream_name , label , and desc , are vendor-specific. Record_error_tr

function integer record_event_tr ( string stream_name, uvm_object info, string label, string desc, time event_time, bit keep_active ) [source]

This function marks an event transaction by a component.

An event_time of 0 indicates to use the current simulation time.

A handle to the transaction is returned. The keep_active bit determines if the handle may be used for other vendor-specific purposes.

The strings for stream_name , label , and desc are vendor-specific identifiers for the transaction. Record_event_tr

virtual function uvm_tr_stream get_tr_stream ( string name, string stream_type_name ) [source]

Returns a tr stream with this component's full name as a scope.

Streams which are retrieved via this method will be stored internally, such that later calls to get_tr_stream will return the same stream reference.

The stream can be removed from the internal storage via a call to free_tr_stream.

Parameters

name

Name for the stream

stream_type_name

Type name for the stream (Default = ""). Get_tr_stream

virtual function void free_tr_stream ( uvm_tr_stream stream ) [source]

Frees the internal references associated with stream .

The next call to get_tr_stream will result in a newly created uvm_tr_stream. If the current stream is open (or closed), then it will be freed. Free_tr_stream

virtual function void set_int_local ( string field_name, uvm_bitstream_t value, bit recurse ) [source]

Set_int_local (override)

function void do_resolve_bindings ( ) [source]

Do_resolve_bindings

function void do_flush ( ) [source]

Do_flush (flush_hier?)

virtual function void flush ( ) [source]

Flush

virtual function uvm_object create ( string name ) [source]

overridden to disable. Create

virtual function uvm_object clone ( ) [source]

Clone

virtual function string get_type_name ( ) [source]
virtual function void do_print ( uvm_printer printer ) [source]

Do_print (override)

Tasks

virtual function run_phase ( uvm_phase phase ) [source]

The uvm_run_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. Thus the phase will automatically end once all objections are dropped using phase.drop_objection() .

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

The run_phase task should never be called directly.

virtual function run ( ) [source]

For backward compatibility the base run_phase method calls run.

virtual function pre_reset_phase ( uvm_phase phase ) [source]

The uvm_pre_reset_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly. These runtime phase methods are only called if a set_domain() is done

virtual function reset_phase ( uvm_phase phase ) [source]

The uvm_reset_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function post_reset_phase ( uvm_phase phase ) [source]

The uvm_post_reset_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function pre_configure_phase ( uvm_phase phase ) [source]

The uvm_pre_configure_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function configure_phase ( uvm_phase phase ) [source]

The uvm_configure_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function post_configure_phase ( uvm_phase phase ) [source]

The uvm_post_configure_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function pre_main_phase ( uvm_phase phase ) [source]

The uvm_pre_main_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function main_phase ( uvm_phase phase ) [source]

The uvm_main_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function post_main_phase ( uvm_phase phase ) [source]

The uvm_post_main_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function pre_shutdown_phase ( uvm_phase phase ) [source]

The uvm_pre_shutdown_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function shutdown_phase ( uvm_phase phase ) [source]

The uvm_shutdown_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function post_shutdown_phase ( uvm_phase phase ) [source]

The uvm_post_shutdown_phase phase implementation method.

This task returning or not does not indicate the end or persistence of this phase. It is necessary to raise an objection using phase.raise_objection() to cause the phase to persist. Once all components have dropped their respective objection using phase.drop_objection() , or if no components raises an objection, the phase is ended.

Any processes forked by this task continue to run after the task returns, but they will be killed once the phase ends.

This method should not be called directly.

virtual function suspend ( ) [source]

Suspend this component.

This method must be implemented by the user to suspend the component according to the protocol and functionality it implements. A suspended component can be subsequently resumed using resume(). Suspend

virtual function resume ( ) [source]

Resume this component.

This method must be implemented by the user to resume a component that was previously suspended using suspend(). Some component may start in the suspended state and may need to be explicitly resumed. Resume

virtual function stop_phase ( uvm_phase phase ) [source]

Task- stop_phase -- DEPRECATED

The stop_phase task is called when this component's enable_stop_interrupt bit is set and global_stop_request is called during a task-based phase, e.g., run.

Before a phase is abruptly ended, e.g., when a test deems the simulation complete, some components may need extra time to shut down cleanly. Such components may implement stopphase to finish the currently executing transaction, flush the queue, or perform other cleanup. Upon return from stopphase, a component signals it is ready to be stopped.

The stop_phase method will not be called if enable_stop_interrupt is 0.

The default implementation is empty, i.e., it will return immediately.

This method should never be called directly. Stop_phase

virtual function stop ( string ph_name ) [source]

backward compat. Stop

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

The all_droppped callback is called when all objections have been dropped by this component and all its descendants. The source_obj is the object that dropped the last objection. The description is optionally provided by the source_obj to give a reason for raising the objection. The count indicates the number of objections dropped by the source_obj .