In reply to sj1992:
We do not recommend using the main_phase for the very reason you are asking this question. Since there is no standard way of defining what goes in each phase, it becomes difficult to manage. This is especially a problem for the task based phases that execute in parallel with the run_phase. The other function based phases become just a convenience to execute code in a particular ordering at time 0 or at the end of simulation.