[source]

Class uvm_tr_stream

uvm_pkg::uvm_tr_stream + close(): void + free(): void + get_db(): uvm_tr_database + get_handle(): integer + get_recorders(): logic unsigned + get_scope(): string + get_stream_from_handle(): uvm_tr_stream + get_stream_type_name(): string + is_closed(): bit + is_open(): bit + m_do_open(): void + m_free_id(): void + m_free_recorder(): void + m_get_handle(): integer + open_recorder(): uvm_recorder uvm_pkg::uvm_text_tr_stream

Inheritance Diagram of uvm_tr_stream

The uvm_tr_stream base class is a representation of a stream of records within a uvm_tr_database.

The record stream is intended to hide the underlying database implementation from the end user, as these details are often vendor or tool-specific.

The uvm_tr_stream class is pure virtual, and must be extended with an implementation. A default text-based implementation is provided via the uvm_text_tr_stream class.

Constructors

function new ( string name ) [source]

Constructor

Parameters

name

Stream instance name

Functions

function uvm_tr_database get_db ( ) [source]

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.

function string get_scope ( ) [source]

Returns the scope supplied when opening this stream.

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

function string get_stream_type_name ( ) [source]

Returns a reference to the database which contains this stream.

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

function void close ( ) [source]

Closes this stream.

Closing a stream closes all open recorders in the stream.

This method will trigger a do_close call, followed by uvm_recorder::close on all open recorders within the stream.

function void free ( ) [source]

Frees this stream.

Freeing a stream indicates that the database can free any references to the stream (including references to records within the stream).

This method will trigger a do_free call, followed by uvm_recorder::free on all recorders within the stream.

function bit is_open ( ) [source]

Returns true if this uvm_tr_stream was opened on the database, but has not yet been closed.

function bit is_closed ( ) [source]

Returns true if this uvm_tr_stream was closed on the database, but has not yet been freed.

function uvm_recorder open_recorder ( string name, time open_time, string type_name ) [source]

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- null 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 null will be returned.

function logic unsigned get_recorders ( uvm_recorder q ) [source]

Provides a queue of all transactions within the stream.

Parameters

q

A reference to the queue of uvm_recorders

The get_recorders method returns the size of the queue, such that the user can conditionally process the elements.

uvm_recorder tr_q[$];
if (my_stream.get_recorders(tr_q)) begin
  // Process the queue...
end

function integer get_handle ( ) [source]

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.

static function uvm_tr_stream get_stream_from_handle ( integer id ) [source]

Static accessor, returns a stream reference for a given unique id.

If no stream exists with the given id , or if the stream with that id has been freed, then null is returned.