Probably, this is a silly question …
It seems that uvm_components and uvm_objects derivatives pass name of the components/objects as arg. to constructor.
For example,
function new(string name = "my_component", uvm_component parent = null);
super.new(name, parent);
endfunction
Similar code applies for uvm_object also.
The name string seems to be used to keep track of testbench component hierarchy etc.
My question is, why should users pass this information as this is additional work?
The names of the object is already present when the object is crated by the parent.
Also, what are the implications if the string value to name is different from actual component name?
For example:
class my_component extends uvm_component;
function new(string name = "not_my_component", uvm_component parent = null);
super.new(name, parent);
endfunction