Class uvm_pkg::uvm_comparer
Collaboration Diagram of uvm_comparer
Name |
Type |
Description |
---|---|---|
policy |
Variable policy Determines whether comparison is UVM_DEEP, UVM_REFERENCE, or UVM_SHALLOW. |
|
show_max |
int unsigned |
Variable show_max Sets the maximum number of messages to send to the printer for miscompares of an object. |
verbosity |
int unsigned |
Variable verbosity 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 |
Variable sev Sets the severity for printed messages. The severity setting is used by the messaging mechanism for printing and filtering messages. |
|
miscompares |
string |
Variable miscompares 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 |
Variable physical 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 |
Variable abstract 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 |
Variable check_type 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 |
Variable result 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
- compare_field(string name, uvm_bitstream_t lhs, uvm_bitstream_t rhs, int size, uvm_radix_enum radix = UVM_NORADIX)
Function
compare_field
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.
- Parameters:
name (string)
lhs (uvm_bitstream_t)
rhs (uvm_bitstream_t)
size (int)
radix (uvm_radix_enum)
- compare_field_int(string name, uvm_integral_t lhs, uvm_integral_t rhs, int size, uvm_radix_enum radix = UVM_NORADIX)
Function
compare_field_int
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.
- Parameters:
name (string)
lhs (uvm_integral_t)
rhs (uvm_integral_t)
size (int)
radix (uvm_radix_enum)
- compare_field_real(string name, real lhs, real rhs)
Function
compare_field_real
This method is the same as compare_field except that the arguments are real numbers.
- Parameters:
name (string)
lhs (real)
rhs (real)
- compare_object(string name, uvm_object lhs, uvm_object rhs)
Function
compare_object
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() ).
- Parameters:
name (string)
lhs (uvm_object)
rhs (uvm_object)
- compare_string(string name, string lhs, string rhs)
Function
compare_string
Compares two string variables.
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.
- Parameters:
name (string)
lhs (string)
rhs (string)
- print_msg(string msg)
Function
print_msg
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.
- Parameters:
msg (string)
- print_rollup(uvm_object rhs, uvm_object lhs)
Need this function because sformat doesn't support objects
- Parameters:
rhs (uvm_object)
lhs (uvm_object)
- print_msg_object(uvm_object lhs, uvm_object rhs)
print_msg_object
- Parameters:
lhs (uvm_object)
rhs (uvm_object)
- init()
init ??
- Return type:
CLASS
uvm_comparer
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.