why we take a two arguement in new function what it means in and uvm object we take a one arguement
what uvm_component parent means
function new(string name, uvm_component parent);
super.new(name,parent);
In reply to taufeeq_khan:
Hi,
The first argument specifies the name of the component which acts like an identifier for that component. The second argument represents the parent component, in which, the this component is getting created. This information is useful for the simulator to generate the hierarchical path for every component and to print the topology if needed.
Hope this helps
Putta Satish
In reply to puttasatish:
Thanks for reply
why we take one arguement in uvm_sequence_item and uvm_sequence
this component is created means the parent component
In reply to taufeeq_khan:
The parent argument is required for uvm_components. uvm_sequence and uvm_sequence_item are derived from uvm_object.
In reply to tfitz:
thanks for reply
but why parent arguement required for uvm_component not in uvm_sequence_item and uvm_sequence
In reply to taufeeq_khan:
uvm_components are used to create a UVM testbench. This testsbench has different levels of hierachy and has to be maintained. For this reason we need the parent/child relationship. This is supported by the 2nd argument.
Extension of uvm_object are transient objects. They do not belong to th etestbench hierarchy.
Transient objects are created at any time and disappear after they have been completed. We do not have a hierarchy here. For this reason a 2nd argument would be useless.
In reply to taufeeq_khan:
The use of the term parent has two different meanings here.
As a data structure, the UVM testbench constructs a hierarchy of uvm_components with parent/child relationships. That happens in the build phase as each component calls its constructor and is effectively static for the rest of the test.
UVM sequences are transient objects that get procedurally called during the run_phase using the start() method. The construction of sequences is a separate step to calling the sequences. When calling a sequence, we pass a parent sequence to the start() method to create a dynamic calling stack of sequences.