Should we never call _phase methods directly?

In the uvm_component.svh base class, for each phase method there is a comment included that “This method should never be called directly”.

// Function: connect_phase
//
// The <uvm_connect_phase> phase implementation method.
//
// This method should never be called directly.

extern virtual function void connect_phase(uvm_phase phase);

I was just wondering, whether these methods should not be called in environment(driver, monitor, test, etc) directly ? Any Comments ?!

Absolutely NOT!!! Do not ever call these methods directly!
The UVM system will call these methods for each component in the hierarchy automatically. If you call them, you’ll just screw things up.
When a component is created, it gets added to a list of components maintained internally by the UVM. The test is the first thing that gets created (via run_test()). Since that’s the only component, UVM automatically calls its build_phase() method.
During the test’s build_phase(), it will instantiate the uvm_env component(s), which will be added to the list. Once the test’s build_phase() completes, UVM looks at the list and sees that it now includes the uvm_env(s), so it then calls their build_phase() methods (one at a time). Each of the uvm_envs will create more components which get added to the list, so after uvm_env.build_phase() exits, UVM looks at the list and calls build_phase() on the components. Once the last component’s build_phase() completes, UVM goes through the list and calls connect_phase() for each of the components, and so on.
Please see the UVM Cookbook for more details.

In reply to tfitz:

Thanks !!!