In reply to Brass:
This is a limitation of the UVM macros; it does not consider package names as part of the type name. You have several options
- As suggested, make the class names unique in each package. Even though SystemVerilog allows classes with the same name, if you have control over both packages, try to make the names of UVM classes unique. This also makes importing with wildcards much easier as well.
- Don’t use string based name lookups, use type base lookups. This is also more efficient and less error prone because the types are checked at compile time. You can either ignore the warnings or use `uvm_object_param_utils which simply does not register a string name with the factory.
- Don’t use the `uvm_object_utils macros and directly use the uvm_object_registry class instead. See this link for more details.
typedef uvm_object_registry#(some_name,"pkg_A::some_name") type_id;
static function type_id get_type();
return type_id::get();
endfunction