pyuvm._s13_uvm_component

Module Contents

Classes

uvm_component

uvm_test

The base class for all tests

uvm_root

F.7. We do not use uvm_pkg to hold uvm_root. Instead it is a class variable of uvm_component. This avoids circular reference issues regarding uvm_pkg.

ConfigDB

uvm_config_db

API

class pyuvm._s13_uvm_component.uvm_component(name, parent)

Bases: pyuvm._s06_reporting_classes.uvm_report_object

component_dict

None

classmethod clear_components()
clear_children()

Removes the direct children from this component.

clear_hierarchy()

Removes self from the UVM hierarchy

do_execute_op(op)
classmethod create(name='', parent=None)
get_parent()

:return: parent object

13.1.3.1

raise_objection(description='', stacklevel=1)

Raise an objection, usually at the start of the run_phase()

:param str description: A meaningful description speeds up timeout debug :param int stacklevel: For debug, increase to associate with higher level caller

drop_objection(description='')

Drop an objection, usually at the end of the run_phase()

:param str description: Not used, but kept for symmetry with raise_objection

objection()
cdb_set(label, value, inst_path='*')

A convenience routing to store an object in the config_db using this component’s get_full_name() path.

:param value: The object to store :param label: The label to use to retrieve it :param inst_path: A path with globs or if left blank the get_full_name() path

cdb_get(label, inst_path='')

A convenience routine that retrieves an object from the config_db using this component’s get_full_name() path. Can find objects stored with wildcards

:param inst_path: The path below this component :param label: The label used to store the value :return: The object at this path stored at the label

property parent
get_full_name()

:return: This component’s name concatenated to parent name.

13.1.3.2

get_children()

13.1.3.3 :return: A dict containing children objects

add_child(name, child)
property hierarchy

We return a generator to find the children. This is more pythonic and saves memory for large hierarchies.

:return: A generator that returns the children.

property children

13.1.3.4 Implements the intention of this requirement without the approach taken in the UVM We use a generator instead.

__repr__()
get_child(name)

13.1.3.4 :param self: :param name: child’s name :return: child uvm_component of that name

get_num_children()

13.1.3.5 :param self: :return: The number of children in component

has_child(name)

13.1.3.6 :param name: Name of child the object :return: True if exists, False otherwise

lookup(name)

13.1.3.7 Return a component base on the path. If . then use full name from root otherwise relative

:param name: The search name :return: either the component or None

get_depth()

13.1.3.8 Get the depth that I am from the top component. uvm_root is 0.

:return: The hierarchy depth from me to the bottom.

set_logging_level_hier(logging_level)

Set the logging level for this component’s logger and all the way down the hierarchy

:param logging_level: typically a constant from logging module :return: None

add_logging_handler_hier(handler)

Add an additional handler all the way down the component hierarchy

:param handler: A logging.Handler object :return: None

remove_logging_handler_hier(handler)

Remove a handler from all loggers below this component

:param handler: logging handler :return: None

remove_streaming_handler_hier()

Remove this component’s streaming handler and all the way down the hierarchy

disable_logging_hier()

Disable logging for this component and all the way down the hierarchy

build_phase()
connect_phase()
end_of_elaboration_phase()
start_of_simulation_phase()
async run_phase()
extract_phase()
check_phase()
report_phase()
final_phase()
class pyuvm._s13_uvm_component.uvm_test(name, parent)

Bases: pyuvm._s13_uvm_component.uvm_component

The base class for all tests

Initialization

13.1.2.1—This is new() in the IEEE-UVM, but we mean the same thing with init()

:param name: The name of the component. Used in the UVM hierarchy :param parent: The parent component. If None, the parent is uvm_root

class pyuvm._s13_uvm_component.uvm_root

Bases: pyuvm._s13_uvm_component.uvm_component

F.7. We do not use uvm_pkg to hold uvm_root. Instead it is a class variable of uvm_component. This avoids circular reference issues regarding uvm_pkg.

Plus, it’s cleaner.

uvm_root is still a singleton that you access through its constructor instead of through a get() method.

Much of the functionality in Annex F delivers functionality in SystemVerilog that is already built into Python. So we’re going to skip much of that Annex.

Initialization

13.1.2.1—This is new() in the IEEE-UVM, but we mean the same thing with init()

:param name: The name of the component. Used in the UVM hierarchy :param parent: The parent component. If None, the parent is uvm_root

classmethod clear_singletons(keep_set={})

Clear the singletons in the system. This is used for testing

_utt()

Used in testing

async run_test(test_name, keep_singletons=False, keep_set=set())

:param test_name: The uvm test name or test class :param keep_singletons: If True do not clear singletons (default False) :param keep_set: Set of singleton classes to keep if keep_singletons is False. Pass a list of singletons to set() :return: none

_find_all_recurse(comp_match, comp) list[pyuvm._s13_uvm_component.uvm_component]

Recursively finds all components matching comp_match. Returns a list of matching uvm_component instances.

find_all(comp_match: str, comp: pyuvm._s13_uvm_component.uvm_component | None = None) list[pyuvm._s13_uvm_component.uvm_component]

Returns a list of components matching a given comp_match string. Matches are determined using uvm_is_match (see F.3.3.1), with comp_match as expr, and the component’s full name (see 13.1.3.2) as str. If the comp argument is not None, the search begins from that component down; otherwise, all component instances are compared.

find(comp_match: str) pyuvm._s13_uvm_component.uvm_component | None

find does a find_all with comp = None and returns the first element in the output list or None if there is an empty list.

class pyuvm._s13_uvm_component.ConfigDB

Initialization

default_get

‘object(…)’

default_precedence

1000

legal_chars

None

A path-based singleton storage system

clear()

Reset the ConfigDB. Used for testing.

static _get_context_inst_name(context, inst_name)

Get the config_key from context and passed inst_name

:param context: uvm_component or None :param inst_name: string that can be a glob :return: string that is the key

_get_event_key(context, inst_name, field_name)

Key for lookup events in dictionary

trace(method, context, inst_name, field_name, value)

Output the ConfigDB activity if tracing is on.

set(context, inst_name, field_name, value)

Stores an object in the db using the context and inst_name to create a retrieval path, and the key name.

:param context: A handle to a component :param inst_name: The instance name within the component :param field_name: The key we’re setting :param value: The object to be stored :return: None

get(context, inst_name, field_name, default=default_get)

The component path matches against the paths in the ConfigDB. The path cannot have wildcards, but can match against keys with wildcards. Return the value stored at key. If the key is missing, returns default or raises UVMConfigItemNotFound.

:param context: The component making the call :param inst_name: component full path with no wildcards :param field_name: the field_name being retrieved :param default: the value to return if there is no key, defaults to default_get :raises UVMConfigItemNotFound: if the key is not found and the default is not set :return: value found at location

_not_found(msg, default)
exists(context, inst_name, field_name)

Returns true if there is data in the database at this location

:param context: None or uvm_component :param inst_name: instance name string in context :param field_name: key name for location :return: True if exists

async wait_modified(context, inst_name, field_name)
__str__()
class pyuvm._s13_uvm_component.uvm_config_db
classmethod set(cntxt: pyuvm._s13_uvm_component.uvm_component | None, inst_name: str, field_name: str, value: Any) None
classmethod get(cntxt: pyuvm._s13_uvm_component.uvm_component | None, inst_name: str, field_name: str, default: Any = ConfigDB().default_get) Any
classmethod exists(cntxt: pyuvm._s13_uvm_component.uvm_component | None, inst_name: str, field_name: str) bool
async classmethod wait_modified(cntxt: pyuvm._s13_uvm_component.uvm_component | None, inst_name: str, field_name: str)