Logger Posted July 26, 2012 Report Share Posted July 26, 2012 I have an application where I have two objects, the only thing I know for sure is they are both extensions of uvm_object. However, I can do something useful if I know if one is an extension of the other. It would be nice if uvm_object_wrapper had some kind of is_a() function. class uvm_object_wrapper; virtual function bit is_a_base_of(uvm_object obj); // macro generated extension would implement a $cast() to test the is_a relationship. endfunction endclass That way I could find out if the type of Y is an extension of the type of X. X::type_id.is_a_base_of(Y); Even better would be an is_a method that can be used like: Y::type_id.is_a(X); But I think implementation would be more complicated. -Ryan Quote Link to comment Share on other sites More sharing options...
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.