A common function of testbenches is to compare streams of transactions for equivalence. For example, a testbench may compare a stream of transactions from a DUT with expected results.
The OVM library provides a base class called ovm_in_order_comparator and two derived classes: ovm_in_order_built_in_comparator for comparing streams of built-in types and ovm_in_order_class_comparator for comparing streams of class objects.
The ovm_algorithmic_comparator also compares two streams of transactions, but the transaction streams might be of different type objects. Thus, this comparator will employ a user-defined transformation function to convert one type to another before performing a comparison.