Where are all the function (phases) called in UVM , like build phase , connect phase?

In reply to milin parekh:

The run_test task that you call from an initial block in your top-level testbench calls all the phases. I can show you n extremely simplified model of how it works (removing hierarchy, factory, and objections)

class component;
  static component all_components[$];
  function new;
    all_components.push_back(this);
  endfunction
  virtual function void build_phase();
  endfunction
  virtual function void connect_phase();
  endfunction
  virtual task run_phase;
  endtask
  virtual function void report_phase;
  endfunction
endclass
task automatic run_test;
  foreach(all_components[comp]) all_components[comp].build_phase();
  foreach(all_components[comp]) all_components[comp].connect_phase();
  foreach(all_components[comp]) fork
                                  int I = comp;
                                  all_components[I].run_phase();
                                join_none
   wait fork;
  foreach(all_components[comp]) all_components[comp].report_phase();
endtask : run_test

Every class extended from uvm_component, like a sequencer, driver, monitor, etc. have these virtual phase methods declared in the base class. They are called regardless of whether you have declared overriding methods in your class or not.