UVM Recorders

UVMkit » 1800.2-2017

The uvm_recorder class serves two purposes

  • Firstly, it is an abstract representation of a record within a <uvm_tr_stream>.
  • Secondly, it is a policy object for recording fields into that record within the stream.
Contents
UVM Recorders
uvm_recorderAbstract class which defines the recorder API.
uvm_text_recorderThe uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database.

uvm_recorder

Abstract class which defines the recorder API.

Summary
uvm_recorder
Abstract class which defines the recorder API.
Class Hierarchy
Class Declaration
virtual class uvm_recorder extends uvm_policy
default_radixThis is the default radix setting if <record_field> is called without a radix.
physicalThis bit provides a filtering mechanism for fields.
abstractThis bit provides a filtering mechanism for fields.
identifierThis bit is used to specify whether or not an object’s reference should be recorded when the object is recorded.
recursion_policySets the recursion policy for recording objects.
Configuration API
Transaction Recorder APIOnce a recorder has been opened via <uvm_tr_stream::open_recorder>, the user can close the recorder.
Handles
Attribute Recording
Implementation Agnostic API

default_radix

uvm_radix_enum default_radix = UVM_HEX

This is the default radix setting if <record_field> is called without a radix.

physical

bit physical = 1

This bit provides a filtering mechanism for fields.

The abstract and physical settings allow an object to distinguish between two different classes of fields.

It is up to you, in the uvm_object::do_record method, to test the setting of this field if you want to use the physical trait as a filter.

abstract

bit abstract = 1

This bit provides a filtering mechanism for fields.

The abstract and physical settings allow an object to distinguish between two different classes of fields.

It is up to you, in the uvm_object::do_record method, to test the setting of this field if you want to use the abstract trait as a filter.

identifier

bit identifier = 1

This bit is used to specify whether or not an object’s reference should be recorded when the object is recorded.

recursion_policy

`ifndef UVM_ENABLE_DEPRECATED_API local `endif uvm_recursion_policy_enum policy = UVM_DEFAULT_POLICY

Sets the recursion policy for recording objects.

The default policy is deep (which means to recurse an object).

Transaction Recorder API

Once a recorder has been opened via <uvm_tr_stream::open_recorder>, the user can close the recorder.

Due to the fact that many database implementations will require crossing a language boundary, an additional step of freeing the recorder is required.

A link can be established within the database any time between open and free, however it is illegal to establish a link after freeing the recorder.

uvm_text_recorder

The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database.

@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_recorder
The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database.
Class Hierarchy
Class Declaration
class uvm_text_recorder extends uvm_recorder
newConstructor
Implementation Agnostic API
do_openCallback triggered via <uvm_tr_stream::open_recorder>.
do_closeCallback triggered via <uvm_recorder::close>.
do_freeCallback triggered via <uvm_recorder::free>.
do_record_fieldRecords an integral field (less than or equal to 4096 bits).
do_record_field_intRecords an integral field (less than or equal to 64 bits).
do_record_field_realRecord a real field.
do_record_objectRecord an object field.
do_record_stringRecords a string field.
do_record_timeRecords a time field.
do_record_genericRecords a name/value pair, where value has been converted to a string.
Implementation Specific API
write_attributeOutputs a uvm_bitstream_t attribute to the textual log.
write_attribute_intOutputs an uvm_integral_t attribute to the textual log

new

function new( string  name  =  "unnamed-uvm_text_recorder" )

Constructor

Parameters --NODOCS-- name - Instance name

do_open

protected virtual function void do_open( uvm_tr_stream  stream,
time  open_time,
string  type_name )

Callback triggered via <uvm_tr_stream::open_recorder>.

Text-backend specific implementation.

do_close

protected virtual function void do_close( time  close_time )

Callback triggered via <uvm_recorder::close>.

Text-backend specific implementation.

do_free

protected virtual function void do_free()

Callback triggered via <uvm_recorder::free>.

Text-backend specific implementation.

do_record_field

protected virtual function void do_record_field( string  name,
uvm_bitstream_t  value,
int  size,
uvm_radix_enum  radix )

Records an integral field (less than or equal to 4096 bits).

Text-backend specific implementation.

do_record_field_int

protected virtual function void do_record_field_int( string  name,
uvm_integral_t  value,
int  size,
uvm_radix_enum  radix )

Records an integral field (less than or equal to 64 bits).

Text-backend specific implementation.

do_record_field_real

protected virtual function void do_record_field_real( string  name,
real  value )

Record a real field.

Text-backened specific implementation.

do_record_object

protected virtual function void do_record_object( string  name,
uvm_object  value )

Record an object field.

Text-backend specific implementation.

The method uses identifier to determine whether or not to record the object instance id, and recursion_policy to determine whether or not to recurse into the object.

do_record_string

protected virtual function void do_record_string( string  name,
string  value )

Records a string field.

Text-backend specific implementation.

do_record_time

protected virtual function void do_record_time( string  name,
time  value )

Records a time field.

Text-backend specific implementation.

do_record_generic

protected virtual function void do_record_generic( string  name,
string  value,
string  type_name )

Records a name/value pair, where value has been converted to a string.

Text-backend specific implementation.

write_attribute

function void write_attribute( string  nm,   
uvm_bitstream_t  value,   
uvm_radix_enum  radix,   
int  numbits  =  $bits(uvm_bitstream_t) )

Outputs a uvm_bitstream_t attribute to the textual log.

Parameters

nmName of the attribute
valueValue
radixRadix of the output
numbitsnumber of valid bits

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

write_attribute_int

function void write_attribute_int( string  nm,   
uvm_integral_t  value,   
uvm_radix_enum  radix,   
int  numbits  =  $bits(uvm_bitstream_t) )

Outputs an uvm_integral_t attribute to the textual log

Parameters

nmName of the attribute
valueValue
radixRadix of the output
numbitsnumber of valid bits

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

virtual class uvm_recorder extends uvm_policy
Abstract class which defines the recorder API.
class uvm_text_recorder extends uvm_recorder
The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database.
class uvm_text_tr_database extends uvm_tr_database
The uvm_text_tr_database is the default implementation for the uvm_tr_database.
virtual class uvm_void
The uvm_void class is the base class for all UVM classes.
virtual class uvm_object extends uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_policy extends uvm_object
The abstract uvm_policy class provides a common base from which all UVM policy classes derive Implementation as per Section 16.1 UVM Policy
uvm_radix_enum default_radix = UVM_HEX
This is the default radix setting if record_field is called without a radix.
bit physical = 1
This bit provides a filtering mechanism for fields.
bit abstract = 1
This bit provides a filtering mechanism for fields.
bit identifier = 1
This bit is used to specify whether or not an object’s reference should be recorded when the object is recorded.
`ifndef UVM_ENABLE_DEPRECATED_API local `endif uvm_recursion_policy_enum policy = UVM_DEFAULT_POLICY
Sets the recursion policy for recording objects.
virtual function void do_record ( uvm_recorder  recorder )
The do_record method is the user-definable hook called by the record method.
function new( string  name  =  "unnamed-uvm_text_recorder" )
Constructor
protected virtual function void do_open( uvm_tr_stream  stream,
time  open_time,
string  type_name )
Callback triggered via uvm_tr_stream::open_recorder.
protected virtual function void do_close( time  close_time )
Callback triggered via uvm_recorder::close.
protected virtual function void do_free()
Callback triggered via uvm_recorder::free.
protected virtual function void do_record_field( string  name,
uvm_bitstream_t  value,
int  size,
uvm_radix_enum  radix )
Records an integral field (less than or equal to 4096 bits).
protected virtual function void do_record_field_int( string  name,
uvm_integral_t  value,
int  size,
uvm_radix_enum  radix )
Records an integral field (less than or equal to 64 bits).
protected virtual function void do_record_field_real( string  name,
real  value )
Record a real field.
protected virtual function void do_record_object( string  name,
uvm_object  value )
Record an object field.
protected virtual function void do_record_string( string  name,
string  value )
Records a string field.
protected virtual function void do_record_time( string  name,
time  value )
Records a time field.
protected virtual function void do_record_generic( string  name,
string  value,
string  type_name )
Records a name/value pair, where value has been converted to a string.
function void write_attribute( string  nm,   
uvm_bitstream_t  value,   
uvm_radix_enum  radix,   
int  numbits  =  $bits(uvm_bitstream_t) )
Outputs a uvm_bitstream_t attribute to the textual log.
The bitstream type is used as a argument type for passing integral values in such methods as uvm_object::set_int_local, uvm_config_int, uvm_printer::print_field, uvm_recorder::record_field, uvm_packer::pack_field and uvm_packer::unpack_field.
function void write_attribute_int( string  nm,   
uvm_integral_t  value,   
uvm_radix_enum  radix,   
int  numbits  =  $bits(uvm_bitstream_t) )
Outputs an uvm_integral_t attribute to the textual log
The integral type is used as a argument type for passing integral values of 64 bits or less in such methods as uvm_printer::print_field_int, uvm_recorder::record_field_int, uvm_packer::pack_field_int and uvm_packer::unpack_field_int.