Compares two streams of data objects of type T, a parameter to this class. These transactions may either be classes or built-in types. To be successfully compared, the two streams of data must be in the same order. Apart from that, there are no assumptions made about the relative timing of the two streams of data.
|T||Specifies the type of transactions to be compared.|
|comp||The type of the comparator to be used to compare the two transaction streams.|
|convert||A policy class to allow convert2string() to be called on the transactions being compared. If T is an extension of ovm_transaction, then it uses T::convert2string(). If T is a built-in type, then the policy provides a convert2string() method for the comparator to call.|
|pair_type||A policy class to allow pairs of transactions to be handled as a single ovm_transaction type.|
Built in types (such as ints, bits, logic, and structs) can be compared using the default values for comp_type, convert, and pair_type. For convenience, you can use the subtype, <ovm_in_order_builtin_comparator #(T)> for built-in types.
When T is a class, T must implement comp and convert2string, and you must specify class-based policy classes for comp_type, convert, and pair_type. In most cases, you can use the convenient subtype, ovm_in_order_class_comparator #(T).
Comparisons are commutative, meaning it does not matter which data stream is connected to which export, before_export or after_export.
Comparisons are done in order and as soon as a transaction is received from both streams. Internal fifos are used to buffer incoming transactions on one stream until a transaction to compare arrives on the other stream.
|Compares two streams of data objects of type T, a parameter to this class.|
|before_export||The export to which one stream of data is written.|
|after_export||The export to which the other stream of data is written.|
|pair_ap||The comparator sends out pairs of transactions across this analysis port.|
|flush||This method sets m_matches and m_mismatches back to zero.|
The export to which one stream of data is written. The port must be connected to an analysis port that will provide such data.
The export to which the other stream of data is written. The port must be connected to an analysis port that will provide such data.
The comparator sends out pairs of transactions across this analysis port. Both matched and unmatched pairs are published via a pair_type objects. Any connected analysis export(s) will receive these transaction pairs.
This class uses the ovm_built_in_* comparison, converter, and pair classes. Use this class for built-in types (int, bit, string, etc.)
|This class uses the ovm_built_in_* comparison, converter, and pair classes.|
This class uses the ovm_class_* comparison, converter, and pair classes. Use this class for comparing user-defined objects of type T, which must provide implementations of comp and convert2string.
This method sets m_matches and m_mismatches back to zero.
virtual function void flush()
Removes all entries from the FIFO, after which used returns 0 and is_empty returns 1.
virtual function void flush()
This class uses the ovm_built_in_* comparison, converter, and pair classes.
class ovm_in_order_built_in_comparator #( type T = int ) extends ovm_in_order_comparator #(T)