# uvm_text_tr_database

The uvm_text_tr_database is the default implementation for the <uvm_tr_database>. It provides the ability to store recording information into a textual log file.

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

Summary

uvm_text_tr_database
The uvm_text_tr_database is the default implementation for the <uvm_tr_database>.
Class Hierarchy
uvm_tr_database
uvm_text_tr_database
Class Declaration
> class uvm_text_tr_database extends uvm_tr_database
new | Constructor
Implementation Agnostic API |
do_open_db | Open the backend connection to the database.
do_close_db | Close the backend connection to the database.
do_open_stream | Provides a reference to a stream within the database.
do_establish_link | Establishes a link between two elements in the database
Implementation Specific API |
set_file_name | Sets the file name which will be used for output.

### new

> function new(
> | string | name | = | "unnamed-uvm_text_tr_database"
> )

Constructor

#### Parameters

name | Instance name

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

### Implementation Agnostic API

### do_open_db

> protected virtual function bit do_open_db()

Open the backend connection to the database.

Text-Backend implementation of <uvm_tr_database::open_db>.

The text-backend will open a text file to dump all records in to. The name of this text file is controlled via set_file_name.

This will also lock the file_name, so that it cannot be modified while the connection is open.

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

### do_close_db

> protected virtual function bit do_close_db()

Close the backend connection to the database.

Text-Backend implementation of <uvm_tr_database::close_db>.

The text-backend will close the text file used to dump all records in to, if it is currently opened.

This unlocks the file_name, allowing it to be modified again.

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

### do_open_stream

> protected virtual function uvm_tr_stream do_open_stream(
> | string | name,
> | string | scope,
> | string | type_name
> )

Provides a reference to a stream within the database.

Text-Backend implementation of <uvm_tr_database::open_stream>

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

### do_establish_link

> protected virtual function void do_establish_link(
> | uvm_link_base | link
> )

Establishes a link between two elements in the database

Text-Backend implementation of <uvm_tr_database::establish_link>.

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

### Implementation Specific API

### set_file_name

> function void set_file_name(
> | string | filename
> )

Sets the file name which will be used for output.

The set_file_name method can only be called prior to open_db.

By default, the database will use a file named “tr_db.log”.

@uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2

> class uvm_text_tr_database extends uvm_tr_database

The uvm_text_tr_database is the default implementation for the uvm_tr_database.

> function new(
> | string | name | = | "unnamed-uvm_text_tr_database"
> )

Constructor

> protected virtual function bit do_open_db()

Open the backend connection to the database.

> protected virtual function bit do_close_db()

Close the backend connection to the database.

> protected virtual function uvm_tr_stream do_open_stream(
> | string | name,
> | string | scope,
> | string | type_name
> )

Provides a reference to a stream within the database.

> protected virtual function void do_establish_link(
> | uvm_link_base | link
> )

Establishes a link between two elements in the database

> function void set_file_name(
> | string | filename
> )

Sets the file name which will be used for output.