Why do we use uvm_component parent in function new()?

Dear All,

When you make data modeling with uvm,
data constructor with string instance name argument and default value be used in function new(),
such as

function new (string name = "yapp_packet");
  super.new(name);
endfunction

but I’m confused that some example be used with one more argument such as

function new (string name,uvm_component parent);
  super.new(name, parent);
endfunction


What is the difference between them? Would you please let me know which case what type of function should be used?

In reply to verified:

In the UVM we are differentiating between transient and non-transient objects. Transient objects are all objects used to construct the UVM environment (testbench). They are created at runtime 0 and stay unchanged during the whole simulation. Each component has certain relationship to each other (parent/child relationship). With the second argument in the constructor we are taking care for this.
Transient objects have a limited life-time they are used as seq_items or sequences. These objects do not have a specil parent/chid realtionship. For this reason they hav in the constructor only 1 argument.

In reply to verified:

While creating a UVM component that are non transients that are part of UVM hierarchy, both the arguments string(name of the object to be created) and parent argument which stores ‘this’ pointer that points to the parent object which contains the object which is getting created are passed. And this hierarchy remains same for entire simulation.While creating components both the arguments are needed because UVM internally create a linked list that stores the hierarchy of test bench which is used in messaging and reporting mechanism.

But for uvm objects that are transients that are not the part of UVM test bench hierarchy , only name argument is passed.