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 comment
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 comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...