Getting an object from parent class to child class


I am using UVM1.1 and in this I have a parent env class which sets an object(Ex:

set_config_object("*", "reg_cfg", rif_cfg_h)

). I have a child env class which extends this parent class and tries to get the config object(Ex:

get_config_object("reg_cfg", tmp)

) but I am getting a Fatal error saying that I cannot get the object. In this case is the object only visible to agents and envs under the parent class and cannot be obtained by a child class? or am I doing something wrong here?


In reply to sj1992:

Your use of the terms ‘parent’ and ‘child’ are not correct within UVM. In UVM, a ‘parent’ class will create a distinct ‘child’ class. This will create the UVM hierarchy in which you can utilize the uvm_config_db to pass configuration object handles.

When you extend a class, the correct terms are ‘base’ class and ‘extended’ class. When you extend a base class, the extended class inherits all of the objects and methods of the base class. Therefor there is no need to utilize the uvm_config_db to pass objects.