[source]

Class uvm_tr_database

uvm_pkg::uvm_tr_database + close_db(): bit + establish_link(): void + get_streams(): logic unsigned + is_open(): bit + m_free_stream(): void + open_db(): bit + open_stream(): uvm_tr_stream uvm_pkg::uvm_text_tr_database

Inheritance Diagram of uvm_tr_database

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

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

Constructors

function new ( string name ) [source]

Constructor

Parameters

name

Instance name

Functions

function bit open_db ( ) [source]

Open the backend connection to the database.

If the database is already open, then this method will return 1.

Otherwise, the method will call do_open_db, and return the result.

function bit close_db ( ) [source]

Closes the backend connection to the database.

Closing a database implicitly closes and frees all uvm_tr_streams within the database.

If the database is already closed, then this method will return 1.

Otherwise, this method will trigger a do_close_db call, and return the result.

function bit is_open ( ) [source]

Returns the open/closed status of the database.

This method returns 1 if the database has been successfully opened, but not yet closed.

function uvm_tr_stream open_stream ( string name, string scope, string type_name ) [source]

Provides a reference to a stream within the database.

Parameters

name

A string name for the stream. This is the name associated with the stream in the database.

scope

An optional scope for the stream.

type_name

An optional name describing the type of records which will be created in this stream.

The method returns a reference to a uvm_tr_stream object if successful, null otherwise.

This method will trigger a do_open_stream call, and if a non null stream is returned, then uvm_tr_stream::do_open will be called.

Streams can only be opened if the database is open (per is_open). Otherwise the request will be ignored, and null will be returned.

function logic unsigned get_streams ( uvm_tr_stream q ) [source]

Provides a queue of all streams within the database.

Parameters

q

A reference to a queue of uvm_tr_streams

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

uvm_tr_stream stream_q[$];
if (my_db.get_streams(stream_q)) begin
  // Process the queue...
end

Establishes a link between two elements in the database

Links are only supported between streams and records within a single database.

This method will trigger a do_establish_link call.