Jump to content

how to use uvm_in_order_comparator

Recommended Posts

hi, experts

If i wish to define a custom comparison for my transaction, i can do it as these two ways.

1) override do_compare in my transaction class, and use the uvm_in_order_comparator .

2) pass in a policy class, which includes a static comp method that returns a bit, to the comparator that defines my custom comparison.

i know how to implement it using the second way. but i don't know how to use uvm_in_order_comparator. i have tried to found it in this forum and uvm class ref, but i couldn't find any piece of examples, would somebody give some examples about using uvm_in_order_comparator. for example, how does uvm_in_order_comparator invoke compare() , which invokes do_compare() in uvm automatically.

Link to post
Share on other sites
  • 1 month later...
  • 3 years later...
  • 2 weeks later...

I find it to be a perfectly reasonable alternative to writing your own comparator. I'm not sure why back in 2012 was considered old. But it does only do one thing. If you need any more advanced comparisons, then it's not that useful.


Implementing do_compare in your class is a pretty simple thing to do. Once done, the do_compare provides the ability to create your own custom comparators that can provide more flexibility.

Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...