I found people always use the phrase “Factory Registration” to refer to uvm_component_utils and
uvm_object_utils, however when unwrapping the macro, it’s just some static variables and functions like below, it’s not interacting with factory,
typedef uvm_component_registry #(my_component, “my_component”) type_id;
static function type_id get_type();
return type_id::get();
endfunction
…
I understand type_id is a proxy class containing create() function talking with factory for class override stuffs, also inside type_id::create() it will call type_id::get() which will register this type_id to the factory hash m_type_names and I suppose this is the only time registration happens.
However someone must trigger type_id::create to do the factory registration as we always do in the UVM testbench right? Why I’m seeing no one is triggering type_id::create() but still that class type is registered into factory, like below example:
uvm factory registration question - EDA Playground
In this example, foo_component is not even newed or created, how come it’s in the factory registered class type list??
Type Name
base_test
foo_component
snps_uvm_reg_bank_group
snps_uvm_reg_map
This question has been in my mind for a long time, really appreciate it if someone can answer it.