In reply to saritr:
The UVM factory provides a mechanism used for specifying type overrides that can also be used to check the type.
The static method
axi_agent_config::type_id::get_type() returns a handle to a proxy singleton object that represents the type of
axi_agent_config. You can call the virtual
uvm_object method
get_cobject_type() that returns a handle to a proxy singleton object that represents the type of the actual object passed to cfg. So you can write
if (axi_agent_config::type_id::get_type() == cfg.get_object_type() )
// then you have a matching base class object
else if (axi_extended_agent_cdg::type_id::get_type() == cfg.get_object_type() )
// then you have a matching extended object