How can I implement factory registration without using macros.
In reply to harinathdigital@gmail.com:
class component extends uvm_component;
typedef uvm_component_registry #(component,“component”) type_id;
static function type_id get_type();
return type_id::get();
endfunction
function string get_type_name();
return “component”;
endfunction
endclass : component
Could you please explain why do we use type_id?
What are the static methods inside uvm_component_registry and why is it parameterized with 2 arguments?
The UVM factory has two basic override mechanisms: a type-based override, which undergoes static compilation checks, and a string-based lookup, which can only be checked at runtime. The registry class accepts two arguments, linking the string to a specific class type.
The factory plays a crucial role in the overall functioning of the UVM, and I can’t provide a comprehensive explanation here. For a detailed understanding, I recommend reading the verification horizon article mentioned above, as well as the DVCon paper it references.
Thank you !