Parametrized classes

Hi All,

I am trying to learn the parametrized class overriding/selection at run time but while printing using uvm_factory::get.print() i am seeing both requested type and override type is same.
please throw some inputs

EDA link:https://edaplayground.com/x/riu6

Thanks in advance

If you use the correct param_utils to register your extended classes, things work fine. Why are you not using those?

When you use the param_utils, you won’t get type names, but that’s usually not an issue as you are overriding by type and not name.

Yes, if i use the above-mentioned component registry also override is Woking fine. But i was exploring the factory concept and get stuck at why factory. Print is not giving the override type and requested type names differently. is there anything do i need to take care?

To get the type names in the factory.print for overriding i am experimenting these.

You need to add these two additional functions when not using the `uvm_object_utils macro

// for type overrides
static function type_id get_type();
   return type_id::get();
endfunction
// for string type name overrides
virtual function string get_type_name ();
   return name;
endfunction   

Also, I would use type_name instead of just name to distinguish it from the uvm_object’s name.

Thank you for the quick response, Dave