Class uvm_in_order_comparator
Name |
Default value |
Description |
---|---|---|
T |
int |
|
comp_type |
uvm_built_in_comp |
|
convert |
uvm_built_in_converter |
|
pair_type |
uvm_built_in_pair |
Name |
Type |
Description |
---|---|---|
type_name |
string |
|
before_export |
The export to which one stream of data is written. The port must be connected to an analysis port that will provide such data. |
|
after_export |
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. |
|
pair_ap |
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. |
Name |
Actual Type |
Description |
---|---|---|
this_type |
Constructors
- function new ( string name, uvm_component parent ) [source]
Functions
- virtual function void flush ( ) [source]
This method sets m_matches and m_mismatches back to zero. The uvm_tlm_fifo#(T)::flush takes care of flushing the FIFOs.
Tasks
- virtual function run_phase ( uvm_phase phase ) [source]
Task- run_phase
Internal method.
Takes pairs of before and after transactions and compares them. Status information is updated according to the results of the comparison. Each pair is published to the pair_ap analysis port.
CLASS
uvm_in_order_comparator #(T,comp_type,convert,pair_type)
Compares two streams of data objects of the type parameter, T. 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.
Type parameters
T
Specifies the type of transactions to be compared.
comp_type
A policy class to compare the two transaction streams. It must provide the static method "function bit comp(T a, T b)" which returns TRUE if a and b are the same.
convert
A policy class to convert the transactions being compared to a string. It must provide the static method "function string convert2string(T a)".
pair_type
A policy class to allow pairs of transactions to be handled as a single uvm_object 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, uvm_in_order_built_in_comparator #(T) for built-in types.
When T is a uvm_object, you can use the convenience subtype uvm_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.