UVM Recorders | |
uvm_recorder | Abstract class which defines the recorder API. |
uvm_text_recorder | The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database. |
Abstract class which defines the recorder API.
uvm_recorder | ||||
Abstract class which defines the recorder API. | ||||
Class Hierarchy | ||||
| ||||
Class Declaration | ||||
| ||||
default_radix | This is the default radix setting if record_field is called without a radix. | |||
physical | This bit provides a filtering mechanism for fields. | |||
abstract | This bit provides a filtering mechanism for fields. | |||
identifier | This bit is used to specify whether or not an object’s reference should be recorded when the object is recorded. | |||
recursion_policy | Sets the recursion policy for recording objects. | |||
Configuration API | ||||
get_stream | Returns a reference to the stream which created this record. | |||
Transaction Recorder API | Once a recorder has been opened via uvm_tr_stream::open_recorder, the user can close the recorder. | |||
close | Closes this recorder. | |||
free | Frees this recorder | |||
is_open | Returns true if this uvm_recorder was opened on its stream, but has not yet been closed. | |||
get_open_time | Returns the open_time | |||
is_closed | Returns true if this uvm_recorder was closed on its stream, but has not yet been freed. | |||
get_close_time | Returns the close_time | |||
Handles | ||||
get_handle | Returns a unique ID for this recorder. | |||
get_recorder_from_handle | Static accessor, returns a recorder reference for a given unique id. | |||
Attribute Recording | ||||
record_field | Records an integral field (less than or equal to 4096 bits). | |||
record_field_int | Records an integral field (less than or equal to 64 bits). | |||
record_field_real | Records a real field. | |||
record_object | Records an object field. | |||
record_string | Records a string field. | |||
record_time | Records a time field. | |||
record_generic | Records a name/value pair, where value has been converted to a string. | |||
use_record_attribute | Indicates that this recorder does (or does not) support usage of the `uvm_record_attribute macro. | |||
get_record_attribute_handle | Provides a tool-specific handle which is compatible with `uvm_record_attribute. | |||
Implementation Agnostic API | ||||
do_open | Callback triggered via uvm_tr_stream::open_recorder. | |||
do_close | Callback triggered via close. | |||
do_free | Callback triggered via free. | |||
do_record_field | Records an integral field (less than or equal to 4096 bits). | |||
do_record_field_int | Records an integral field (less than or equal to 64 bits). | |||
do_record_field_real | Records a real field. | |||
do_record_object | Records an object field. | |||
do_record_string | Records a string field. | |||
do_record_time | Records a time field. | |||
do_record_generic | Records a name/value pair, where value has been converted to a string. |
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.
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.
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.
bit identifier = 1
This bit is used to specify whether or not an object’s reference should be recorded when the object is recorded.
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).
function uvm_tr_stream get_stream()
Returns a reference to the stream which created this record.
A warning will be asserted if get_stream is called prior to the record being initialized via do_open.
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.
function void free( time close_time = 0 )
Frees this recorder
Freeing a recorder indicates that the stream and database can release any references to the recorder.
close_time | Optional time to record as the closing time of this transaction. |
If a recorder has not yet been closed (via a call to close), then close will automatically be called, and passed the close_time. If the recorder has already been closed, then the close_time will be ignored.
This method will trigger a do_free call.
function bit is_open()
Returns true if this uvm_recorder was opened on its stream, but has not yet been closed.
function bit is_closed()
Returns true if this uvm_recorder was closed on its stream, but has not yet been freed.
function integer get_handle()
Returns a unique ID for this recorder.
A value of 0 indicates that the recorder has been freed, and no longer has a valid ID.
static function uvm_recorder get_recorder_from_handle( integer id )
Static accessor, returns a recorder reference for a given unique id.
If no recorder exists with the given id, or if the recorder with that id has been freed, then null is returned.
This method can be used to access the recorder associated with a call to uvm_transaction::begin_tr or uvm_component::begin_tr.
integer handle = tr.begin_tr(); uvm_recorder recorder = uvm_recorder::get_recorder_from_handle(handle); if (recorder != null) begin recorder.record_string("begin_msg", "Started recording transaction!"); end
function void record_field( string name, uvm_bitstream_t value, int size, uvm_radix_enum radix = UVM_NORADIX )
Records an integral field (less than or equal to 4096 bits).
name | Name of the field |
value | Value of the field to record. |
size | Number of bits of the field which apply (Usually obtained via $bits). |
radix | The uvm_radix_enum to use. |
This method will trigger a do_record_field call.
function void record_field_int( string name, uvm_integral_t value, int size, uvm_radix_enum radix = UVM_NORADIX )
Records an integral field (less than or equal to 64 bits).
This optimized version of record_field is useful for sizes up to 64 bits.
name | Name of the field |
value | Value of the field to record |
size | Number of bits of the wfield which apply (Usually obtained via $bits). |
radix | The uvm_radix_enum to use. |
This method will trigger a do_record_field_int call.
function void record_field_real( string name, real value )
Records a real field.
name | Name of the field |
value | Value of the field to record |
This method will trigger a do_record_field_real call.
function void record_object( string name, uvm_object value )
Records an object field.
name | Name of the field |
value | Object to record |
The implementation must use the recursion_policy and identifier to determine exactly what should be recorded.
function void record_string( string name, string value )
Records a string field.
name | Name of the field |
value | Value of the field |
function void record_time( string name, time value )
Records a time field.
name | Name of the field |
value | Value of the field |
function void record_generic( string name, string value, string type_name = "" )
Records a name/value pair, where value has been converted to a string.
recorder.record_generic("myvar","var_type", $sformatf("%0d",myvar), 32);
name | Name of the field |
value | Value of the field |
type_name | optional Type name of the field |
virtual function bit use_record_attribute()
Indicates that this recorder does (or does not) support usage of the `uvm_record_attribute macro.
The default return value is 0 (not supported), developers can optionally extend uvm_recorder and set the value to 1 if they support the `uvm_record_attribute macro.
virtual function integer get_record_attribute_handle()
Provides a tool-specific handle which is compatible with `uvm_record_attribute.
By default, this method will return the same value as get_handle, however tool vendors can override this method to provide tool-specific handles which will be passed to the `uvm_record_attribute macro.
protected virtual function void do_open( uvm_tr_stream stream, time open_time, string type_name )
Callback triggered via uvm_tr_stream::open_recorder.
The do_open callback can be used to initialize any internal state within the recorder, as well as providing a location to record any initial information.
pure virtual protected 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).
Mandatory Backend implementation of record_field
pure virtual protected 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).
Mandatory Backend implementation of record_field_int
pure virtual protected function void do_record_field_real( string name, real value )
Records a real field.
Mandatory Backend implementation of record_field_real
pure virtual protected function void do_record_object( string name, uvm_object value )
Records an object field.
Mandatory Backend implementation of record_object
pure virtual protected function void do_record_string( string name, string value )
Records a string field.
Mandatory Backend implementation of record_string
pure virtual protected function void do_record_time( string name, time value )
Records a time field.
Mandatory Backend implementation of record_time
pure virtual protected 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.
Mandatory Backend implementation of record_generic
The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database.
uvm_text_recorder | |||||
The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database. | |||||
Class Hierarchy | |||||
| |||||
Class Declaration | |||||
| |||||
new | Constructor | ||||
Implementation Agnostic API | |||||
do_open | Callback triggered via uvm_tr_stream::open_recorder. | ||||
do_close | Callback triggered via uvm_recorder::close. | ||||
do_free | Callback triggered via uvm_recorder::free. | ||||
do_record_field | Records an integral field (less than or equal to 4096 bits). | ||||
do_record_field_int | Records an integral field (less than or equal to 64 bits). | ||||
do_record_field_real | Record a real field. | ||||
do_record_object | Record an object field. | ||||
do_record_string | Records a string field. | ||||
do_record_time | Records a time field. | ||||
do_record_generic | Records a name/value pair, where value has been converted to a string. | ||||
Implementation Specific API | |||||
write_attribute | Outputs an integral attribute to the textual log | ||||
write_attribute_int | Outputs an integral attribute to the textual log |
function new( string name = "unnamed-uvm_text_recorder" )
Constructor
name | Instance name |
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.
protected virtual function void do_close( time close_time )
Callback triggered via uvm_recorder::close.
Text-backend specific implementation.
protected virtual function void do_free()
Callback triggered via uvm_recorder::free.
Text-backend specific implementation.
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.
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.
protected virtual function void do_record_field_real( string name, real value )
Record a real field.
Text-backened specific implementation.
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.
protected virtual function void do_record_string( string name, string value )
Records a string field.
Text-backend specific implementation.
protected virtual function void do_record_time( string name, time value )
Records a time field.
Text-backend specific implementation.
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.
function void write_attribute( string nm, uvm_bitstream_t value, uvm_radix_enum radix, integer numbits = $bits(uvm_bitstream_t) )
Outputs an integral attribute to the textual log
nm | Name of the attribute |
value | Value |
radix | Radix of the output |
numbits | number of valid bits |
function void write_attribute_int( string nm, uvm_integral_t value, uvm_radix_enum radix, integer numbits = $bits(uvm_bitstream_t) )
Outputs an integral attribute to the textual log
nm | Name of the attribute |
value | Value |
radix | Radix of the output |
numbits | number of valid bits |
Abstract class which defines the recorder API.
virtual class uvm_recorder extends uvm_object
The uvm_text_recorder is the default recorder implementation for the uvm_text_tr_database.
class uvm_text_recorder extends uvm_recorder
The uvm_text_tr_database is the default implementation for the uvm_tr_database.
class uvm_text_tr_database extends uvm_tr_database
The uvm_tr_stream base class is a representation of a stream of records within a uvm_tr_database.
virtual class uvm_tr_stream extends uvm_object
The uvm_void class is the base class for all UVM classes.
virtual class uvm_void
The uvm_object class is the base class for all UVM data and hierarchical classes.
virtual class uvm_object extends uvm_void
This is the default radix setting if record_field is called without a radix.
uvm_radix_enum default_radix = UVM_HEX
Records an integral field (less than or equal to 4096 bits).
function void record_field( string name, uvm_bitstream_t value, int size, uvm_radix_enum radix = UVM_NORADIX )
This bit provides a filtering mechanism for fields.
bit physical = 1
This bit provides a filtering mechanism for fields.
bit abstract = 1
This bit is used to specify whether or not an object’s reference should be recorded when the object is recorded.
bit identifier = 1
Sets the recursion policy for recording objects.
uvm_recursion_policy_enum policy = UVM_DEFAULT_POLICY
Returns a reference to the stream which created this record.
function uvm_tr_stream get_stream()
Marks the opening of a new transaction recorder on the stream.
function uvm_recorder open_recorder( string name, time open_time = 0, string type_name = "" )
Closes this recorder.
function void close( time close_time = 0 )
Frees this recorder
function void free( time close_time = 0 )
Returns true if this uvm_recorder was opened on its stream, but has not yet been closed.
function bit is_open()
Returns the open_time
function time get_open_time()
Returns true if this uvm_recorder was closed on its stream, but has not yet been freed.
function bit is_closed()
Returns the close_time
function time get_close_time()
Returns a unique ID for this recorder.
function integer get_handle()
Static accessor, returns a recorder reference for a given unique id.
static function uvm_recorder get_recorder_from_handle( integer id )
Records an integral field (less than or equal to 64 bits).
function void record_field_int( string name, uvm_integral_t value, int size, uvm_radix_enum radix = UVM_NORADIX )
Records a real field.
function void record_field_real( string name, real value )
Records an object field.
function void record_object( string name, uvm_object value )
Records a string field.
function void record_string( string name, string value )
Records a time field.
function void record_time( string name, time value )
Records a name/value pair, where value has been converted to a string.
function void record_generic( string name, string value, string type_name = "" )
Indicates that this recorder does (or does not) support usage of the `uvm_record_attribute macro.
virtual function bit use_record_attribute()
Provides a tool-specific handle which is compatible with `uvm_record_attribute.
virtual function integer get_record_attribute_handle()
Callback triggered via uvm_tr_stream::open_recorder.
protected virtual function void do_open( uvm_tr_stream stream, time open_time, string type_name )
Callback triggered via close.
protected virtual function void do_close( time close_time )
Callback triggered via free.
protected virtual function void do_free()
Records an integral field (less than or equal to 4096 bits).
pure virtual protected 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 64 bits).
pure virtual protected function void do_record_field_int( string name, uvm_integral_t value, int size, uvm_radix_enum radix )
Records a real field.
pure virtual protected function void do_record_field_real( string name, real value )
Records an object field.
pure virtual protected function void do_record_object( string name, uvm_object value )
Records a string field.
pure virtual protected function void do_record_string( string name, string value )
Records a time field.
pure virtual protected function void do_record_time( string name, time value )
Records a name/value pair, where value has been converted to a string.
pure virtual protected function void do_record_generic( string name, string value, string type_name )
The do_record method is the user-definable hook called by the record method.
virtual function void do_record ( uvm_recorder recorder )
This function indicates that the transaction has been started and is not the child of another transaction.
function integer begin_tr ( time begin_time = 0 )
This function marks the start of a transaction, tr, by this component.
function integer begin_tr ( uvm_transaction tr, string stream_name = "main", string label = "", string desc = "", time begin_time = 0, integer parent_handle = 0 )
Constructor
function new( string name = "unnamed-uvm_text_recorder" )
Callback triggered via uvm_tr_stream::open_recorder.
protected virtual function void do_open( uvm_tr_stream stream, time open_time, string type_name )
Callback triggered via uvm_recorder::close.
protected virtual function void do_close( time close_time )
Callback triggered via uvm_recorder::free.
protected virtual function void do_free()
Records an integral field (less than or equal to 4096 bits).
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 64 bits).
protected virtual function void do_record_field_int( string name, uvm_integral_t value, int size, uvm_radix_enum radix )
Record a real field.
protected virtual function void do_record_field_real( string name, real value )
Record an object field.
protected virtual function void do_record_object( string name, uvm_object value )
Records a string field.
protected virtual function void do_record_string( string name, string value )
Records a time field.
protected virtual function void do_record_time( string name, time value )
Records a name/value pair, where value has been converted to a string.
protected virtual function void do_record_generic( string name, string value, string type_name )
Outputs an integral attribute to the textual log
function void write_attribute( string nm, uvm_bitstream_t value, uvm_radix_enum radix, integer numbits = $bits(uvm_bitstream_t) )
Outputs an integral attribute to the textual log
function void write_attribute_int( string nm, uvm_integral_t value, uvm_radix_enum radix, integer numbits = $bits(uvm_bitstream_t) )