Class uvm_comparer
Name |
Type |
Description |
---|---|---|
policy |
Determines whether comparison is UVM_DEEP, UVM_REFERENCE, or UVM_SHALLOW. |
|
show_max |
int unsigned |
Sets the maximum number of messages to send to the printer for miscompares of an object. |
verbosity |
int unsigned |
Sets the verbosity for printed messages. The verbosity setting is used by the messaging mechanism to determine whether messages should be suppressed or shown. |
sev |
Sets the severity for printed messages. The severity setting is used by the messaging mechanism for printing and filtering messages. |
|
miscompares |
string |
This string is reset to an empty string when a comparison is started. The string holds the last set of miscompares that occurred during a comparison. |
physical |
bit |
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_compare method, to test the setting of this field if you want to use the physical trait as a filter. |
abstract |
bit |
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_compare method, to test the setting of this field if you want to use the abstract trait as a filter. |
check_type |
bit |
This bit determines whether the type, given by uvm_object::get_type_name, is used to verify that the types of two objects are the same. This bit is used by the compare_object method. In some cases it is useful to set this to 0 when the two operands are related by inheritance but are different types. |
result |
int unsigned |
This bit stores the number of miscompares for a given compare operation. You can use the result to determine the number of miscompares that were found. |
depth |
int |
current depth of objects |
compare_map |
||
scope |
Functions
- virtual function bit compare_field ( string name, uvm_bitstream_t lhs, uvm_bitstream_t rhs, int size, uvm_radix_enum radix ) [source]
Compares two integral values.
The name input is used for purposes of storing and printing a miscompare.
The left-hand-side lhs and right-hand-side rhs objects are the two objects used for comparison.
The size variable indicates the number of bits to compare; size must be less than or equal to 4096.
The radix is used for reporting purposes, the default radix is hex.
- virtual function bit compare_field_int ( string name, uvm_integral_t lhs, uvm_integral_t rhs, int size, uvm_radix_enum radix ) [source]
This method is the same as compare_field except that the arguments are small integers, less than or equal to 64 bits. It is automatically called by compare_field if the operand size is less than or equal to 64.
- virtual function bit compare_field_real ( string name, real lhs, real rhs ) [source]
This method is the same as compare_field except that the arguments are real numbers.
- virtual function bit compare_object ( string name, uvm_object lhs, uvm_object rhs ) [source]
Compares two class objects using the policy knob to determine whether the comparison should be deep, shallow, or reference.
The name input is used for purposes of storing and printing a miscompare.
The lhs and rhs objects are the two objects used for comparison.
The check_type determines whether or not to verify the object types match (the return from lhs.get_type_name() matches rhs.get_type_name() ).
- function void print_msg ( string msg ) [source]
Causes the error count to be incremented and the message, msg , to be appended to the miscompares string (a newline is used to separate messages).
If the message count is less than the show_max setting, then the message is printed to standard-out using the current verbosity and severity settings. See the verbosity and sev variables for more information.
- function void print_rollup ( uvm_object rhs, uvm_object lhs ) [source]
Need this function because sformat doesn't support objects
- function void print_msg_object ( uvm_object lhs, uvm_object rhs ) [source]
print_msg_object
- static function uvm_comparer init ( ) [source]
init ??
The uvm_comparer class provides a policy object for doing comparisons. The policies determine how miscompares are treated and counted. Results of a comparison are stored in the comparer object. The uvm_object::compare and uvm_object::do_compare methods are passed a uvm_comparer policy object.