Is there any way to find parent component of an object?

Hi,

Let us suppose I have a component creating an object of type which extends from uvm_object.

Is there any way I can get the handle of component (which is parent of this object) via the object’s handle?

class my_comp extends uvm_component;
my_object m_obj_hdl;
`uvm…

endclass;

class my_object extends uvm_object;
`uvm…
endclass;

Now I want to get the handle to my_comp via m_obj_hdl.

UVM objects such as sequence_items are designed to be passed around the hierarchy from one component to another using the various transport mechanisms. Due to this use model and the fact that several components might be maintaining a pointer to the same UVM object (a configuration object, for example), there is no concept of a ‘parent’ for an object.

If you want something to exist at a fixed point in the UVM hierarchy, then you should use a UVM component.