uvm_pool¶
-
class
uvm.base.uvm_pool.UVMPool(name='', T=None)[source]¶ Bases:
uvm.base.uvm_object.UVMObject,Generic[uvm.base.uvm_pool.KEY,uvm.base.uvm_pool.VAL]Implements a class-based dynamic associative array. Allows sparse arrays to be allocated on demand, and passed and stored by reference.
-
type_name= 'uvm_pool'¶
-
m_global_pool= None¶
-
classmethod
get_global_pool() → uvm.base.uvm_pool.UVMPool[source]¶ Returns the singleton global pool. Unlike in SV, uvm-python has only one global pool.
This allows items to be shared amongst components throughout the verification environment.
- Returns
Single global pool
- Return type
-
classmethod
get_global(key) → Any[source]¶ Returns the specified item instance from the global item pool.
- Parameters
key (str) –
- Returns
Item matching the given key.
- Return type
any
-
get(key: KEY) → VAL[source]¶ Function: get
Returns the item with the given
key.If no item exists by that key, a new item is created with that key and returned. :param key:
Returns:
-
create(name='') → uvm.base.uvm_pool.UVMPool[source]¶ Group: Creation
The
createmethod allocates a new object of the same type as this object and returns it via a base uvm_object handle. Every class deriving from uvm_object, directly or indirectly, must implement the create method.A typical implementation is as follows:
class mytype (UVMObject): ... def create(self, name=""): mytype t = mytype(name) return t
- Parameters
name (str) – Name of the created object.
- Returns
New object.
- Return type
obj
-
do_print(printer) → None[source]¶ The
do_printmethod is the user-definable hook called byprintandsprintthat allows users to customize what gets printed or sprinted beyond the field information provided by the `uvm_field_* macros, <Utility and Field Macros for Components and Objects>.The
printerargument is the policy object that governs the format and content of the output. To ensure correctprintandsprintoperation, and to ensure a consistent output format, theprintermust be used by alldo_printimplementations. That is, instead of using ~$display~ or string concatenations directly, ado_printimplementation must call through the ~printer’s~ API to add information to be printed or sprinted.An example implementation of
do_printis as follows:class mytype (UVMObject): data_obj data int f1 virtual function void do_print (uvm_printer printer) super.do_print(printer) printer.print_field_int("f1", f1, $bits(f1), UVM_DEC) printer.print_object("data", data) endfunctionThen, to print and sprint the object, you could write:
t = mytype() t.print() uvm_report_info("Received",t.sprint())
See
UVMPrinterfor information about the printer API.- Parameters
printer (UVMPrinter) – Printer that is used in printing.
-
-
class
uvm.base.uvm_pool.UVMObjectStringPool(name='', Constr=<class 'uvm.base.uvm_object.UVMObject'>)[source]¶ Bases:
uvm.base.uvm_pool.UVMPool[str,uvm.base.uvm_object.UVMObject]This provides a specialization of the generic
UVMPoolclass for an associative array ofUVMObject-based objects indexed by string. Specializations of this class include theUVMEventPool(aUVMObjectStringPoolstoringUVMEventandUVMBarrierPool(aUVMObjectStringPoolstoringUVMBarrier).-
m_global_pool= None¶
-
type_name= 'uvm_obj_str_pool'¶
-
get_type_name() → str[source]¶ Returns the type name of this object.
- Returns
Type name of this object.
- Return type
-
classmethod
get_global_pool() → uvm.base.uvm_pool.UVMObjectStringPool[source]¶ Returns the singleton global pool.
This allows objects to be shared amongst components throughout the verification environment.
- Returns
Global pool
- Return type
-
classmethod
get_global(key: str) → uvm.base.uvm_object.UVMObject[source]¶ Returns the specified item instance from the global item pool.
- Parameters
key (str) – Key used for getting the item from global pool.
- Returns
Object matching the key in the global pool.
- Return type
any
-
get(key: str) → uvm.base.uvm_object.UVMObject[source]¶ Returns the object item at the given string
key.If no item exists by the given
key, a new item is created for that key and returned.- Parameters
key (str) – Key used for getting the item.
- Returns
Item matching the key. If no match, returns new object.
- Return type
any
-
delete(key: str) → None[source]¶ Removes the item with the given string
keyfrom the pool.- Parameters
key (str) – Key used for removing the item.
-
do_print(printer) → None[source]¶ Function- do_print
- Parameters
printer (UVMPrinter) – Printer used for printing
-
-
class
uvm.base.uvm_pool.UVMEventPool(name='')[source]¶ Bases:
uvm.base.uvm_pool.UVMPool[str,uvm.base.uvm_object.UVMObject]
-
class
uvm.base.uvm_pool.UVMBarrierPool(name='')[source]¶ Bases:
uvm.base.uvm_pool.UVMPool[str,uvm.base.uvm_object.UVMObject]