uvm_tr_stream

class uvm.base.uvm_tr_stream.m_uvm_tr_stream_cfg[source]

Bases: object

class uvm.base.uvm_tr_stream.UVMTrStream(name='unnamed-UVMTrStream')[source]

Bases: UVMObject

m_ids_by_stream = {}
get_db()[source]

Group: Configuration API

Function: get_db Returns a reference to the database which contains this stream.

A warning will be asserted if get_db is called prior to the stream being initialized via do_open.

Returns:

m_do_open(db, scope='', stream_type_name='')[source]

Function- m_do_open Initializes the state of the stream

Parameters- db - Database which the stream belongs to scope - Optional scope stream_type_name - Optional type name for the stream

This method will trigger a do_open call.

An error will be asserted if- - m_do_open is called more than once without the stream

being freed between.

  • m_do_open is passed a None db

function void m_do_open(uvm_tr_database db,

string scope=””, string stream_type_name=””)

Parameters
  • db

  • scope

  • stream_type_name

is_open()[source]

Function: is_open Returns true if this UVMTrStream was opened on the database, but has not yet been closed.

Returns:

is_closed()[source]

Function: is_closed Returns true if this UVMTrStream was closed on the database, but has not yet been freed.

Returns:

open_recorder(name, open_time=0, type_name='')[source]

Function: open_recorder Marks the opening of a new transaction recorder on the stream.

Parameters: name - A name for the new transaction open_time - Optional time to record as the opening of this transaction type_name - Optional type name for the transaction

If open_time is omitted (or set to 0), then the stream will use the current time.

This method will trigger a do_open_recorder call. If do_open_recorder returns a non-None value, then the <uvm_recorder::do_open> method will be called in the recorder.

Transaction recorders can only be opened if the stream is open on the database (per is_open). Otherwise the request will be ignored, and None will be returned.

Parameters
  • name

  • open_time

  • type_name

Returns:

m_free_recorder(recorder)[source]

Function- m_free_recorder Removes recorder from the internal array

Parameters

recorder

m_streams_by_id = {}
get_handle()[source]

Function: get_handle Returns a unique ID for this stream.

A value of 0 indicates that the recorder has been freed, and no longer has a valid ID.

Returns:

class uvm.base.uvm_tr_stream.UVMTextTrStream(name='unnamed-UVMTextTrStream')[source]

Bases: UVMTrStream

do_open(db, scope, stream_type_name)[source]

Function: do_open Callback triggered via <uvm_tr_database::open_stream>.

protected virtual function void do_open(uvm_tr_database db,

string scope, string stream_type_name)

Parameters
  • db

  • scope

  • stream_type_name

do_open_recorder(name, open_time, type_name)[source]

Function: do_open_recorder Marks the beginning of a new record in the stream

Text-backend specific implementation.

Parameters
  • name

  • open_time

  • type_name

Returns:

create(name='')

Group: Creation

The create method 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

get_object_type()

Function: get_object_type

Returns the type-proxy (wrapper) for this object. The uvm_factory’s type-based override and creation methods take arguments of uvm_object_wrapper. This method, if implemented, can be used as convenient means of supplying those arguments. This method is the same as the static get_type method, but uses an already allocated object to determine the type-proxy to access (instead of using the static object).

The default implementation of this method does a factory lookup of the proxy using the return value from get_type_name. If the type returned by get_type_name is not registered with the factory, then a None handle is returned.

For example:

class cmd (UVMObject):
  type_id = UVMObjectRegistry()
  @classmethod
  def type_id get_type(cls):
    return type_id.get()
  def get_object_type(self):
    return cmd.type_id.get()

This function is implemented by the `uvm_*_utils macros, if employed.

Returns:

classmethod get_type()

Returns the type-proxy (wrapper) for this object. The UVMFactory’s type-based override and creation methods take arguments of uvm_object_wrapper. This method, if implemented, can be used as convenient means of supplying those arguments.

The default implementation of this method produces an error and returns None. To enable use of this method, a user’s subtype must implement a version that returns the subtype’s wrapper.

For example:

class cmd(UVMObject):
  type_id = None

  @classmethod
  def get_type(cls):
    return cls.type_id.get()

Then, to use:

factory.set_type_override(cmd.get_type(), subcmd.get_type())

This function is implemented by the uvm_*_utils functions, if employed.

Returns:

get_type_name()

This function returns the type name of the object, which is typically the type identifier enclosed in quotes. It is used for various debugging functions in the library, and it is used by the factory for creating objects.

This function must be defined in every derived class.

A typical implementation is as follows:

class mytype (UVMObject):
  ...
  type_name = "mytype"

  def get_type_name(self):
    return my_type.type_name

We define the type_name static variable to enable access to the type name without need of an object of the class, i.e., to enable access via the scope operator, ~mytype::type_name~.

Returns

Type name of the object.

Return type

str

type_id = <uvm.base.uvm_registry.UVMObjectRegistry object>
type_name = 'UVMTextTrStream'