[source]

Class uvm_in_order_comparator

uvm_pkg::uvm_in_order_comparator <T, comp_type, convert, pair_type> + after_export : uvm_analysis_export #(T) + before_export : uvm_analysis_export #(T) + m_matches : int + m_mismatches : int + pair_ap : uvm_analysis_port #(pair_type) + type_name : string + connect_phase(): void + flush(): void + get_object_type(): uvm_object_wrapper + get_type(): type_id + get_type_name(): string + run_phase() uvm_pkg::uvm_in_order_built_in_comparator <T> uvm_pkg::uvm_in_order_class_comparator <T> <T : T, comp_type : uvm_built_in_comp, convert : uvm_built_in_converter, pair_type : uvm_built_in_pair> <T : T, comp_type : uvm_class_comp, convert : uvm_class_converter, pair_type : uvm_class_pair>

Inheritance Diagram of uvm_in_order_comparator

uvm_pkg::uvm_in_order_comparator <T, comp_type, convert, pair_type> + after_export : uvm_analysis_export #(T) + before_export : uvm_analysis_export #(T) + m_matches : int + m_mismatches : int + pair_ap : uvm_analysis_port #(pair_type) + type_name : string + connect_phase(): void + flush(): void + get_object_type(): uvm_object_wrapper + get_type(): type_id + get_type_name(): string + run_phase() uvm_pkg::uvm_analysis_export <T> uvm_pkg::uvm_analysis_port <T> before_export after_export pair_ap

Collaboration Diagram of uvm_in_order_comparator

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.

Parameters

Name

Default value

Description

T

int

comp_type

uvm_built_in_comp

convert

uvm_built_in_converter

pair_type

uvm_built_in_pair

Variables

Name

Type

Description

type_name

string

before_export

uvm_analysis_export#(int)

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

uvm_analysis_export#(int)

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

uvm_analysis_port#(uvm_built_in_pair#(int, int))

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.

Typedefs

Name

Actual Type

Description

this_type

uvm_in_order_comparator#(T, comp_type, convert, pair_type)

Constructors

function new ( string name, uvm_component parent ) [source]

Functions

virtual function string get_type_name ( ) [source]
virtual function void connect_phase ( uvm_phase phase ) [source]
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.