Who Calls build_phase method of Environment or child components of the Environment?

In reply to vishalghama:

The build_phase() method is called top-down by the UVM infrastructure [actually from uvm_root]. Here’s what happens:
When you call run_test(), an instance of your top-level uvm_test is created from the factory and added to a component list. Then build_phase() is called automatically (it really doesn’t matter from where) on all components in the list, which initially is just your uvm_test. In uvm_test.build_phase(), you create your uvm_env, which gets added to the list. When uvm_test.build_phase() is complete, the system looks at the component list and sees that there’s now a uvm_env whose build_phase() hasn’t been called yet, so it calls uvm_env.build_phase(). This happens all the way down until all created classes have their build_phase() method called and there are no longer any components in the list whose build_phase() hasn’t been called.

which forces me to conclude that when build method of environment is getting called, then the object of environment class is already present, but objects of other components which are at lower level of hierarchy are not create yet.

You are correct. In order to call uvm_env.build_phase(), the uvm_env object must exist or you wouldn’t be able to call uvm_env.build_phase(). The uvm_env was created during uvm_test.build_phase(). When uvm_env.build_phase() is called, no subcomponents exist, because they get created during the execution of uvm_env.build_phase().