[source]

Class uvm_pkg::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

CLASS

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

new(string name = "unnamed-uvm_tr_database")

Function

new

Constructor

Parameters

name

Instance name

Parameters:

name (string)

Functions

open_db()

Function

open_db

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.

close_db()

Function

close_db

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.

is_open()

Function

is_open

Returns the open/closed status of the database.

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

open_stream(string name, string scope = "", string type_name = "")

Function

open_stream

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.

Parameters:
  • name (string)

  • scope (string)

  • type_name (string)

Return type:

uvm_tr_stream

get_streams(uvm_tr_stream q)

Function

get_streams

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
Parameters:

q (uvm_tr_stream)

establish_link(uvm_link_base link)

Function

establish_link

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.

Parameters:

link (uvm_link_base)