mrforever Posted November 7, 2012 Report Share Posted November 7, 2012 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. Quote Link to comment Share on other sites More sharing options...
petermonsson Posted December 13, 2012 Report Share Posted December 13, 2012 Hi, The uvm_in_order_comparator is pretty old and inflexible. I am afraid that there is no easy way for you to do what you want. I create a predictor (uvm_subscriber) on one or both sides of the in order comparator and "zero out" the fields that I don't want to be compared. Best Regards Peter Quote Link to comment Share on other sites More sharing options...
sri.cvcblr Posted July 19, 2016 Report Share Posted July 19, 2016 Is there any update on this comparator class? Is it still considered bad/old/inflexible and let users write their own using tlm_analysis_fifo? Thanks Srini Quote Link to comment Share on other sites More sharing options...
bhunter1972 Posted July 30, 2016 Report Share Posted July 30, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.