uvm_phase_controller::uvm_phase_controller() 
{
    sc_time max_time; // the time at which sc_start() returns
    sc_time smallest_time = sc_get_time_resolution();


    m_stop_mode  = UVM_SC_STOP;
    m_stop_reason= UVM_STOP_REASON_DURATION_COMPLETE;


    max_time = SC_MAX_TIME;

    // TODO - Do we need to reduce the time here?  Post run is run after sc_stop anyway...
    // Original comment:
    // make the UVM timeouts be slightly less than when sc_start() returns
    // such that UVM is able to end the run phase
    m_global_timeout = max_time - smallest_time;
    m_duration = SC_MAX_TIME; 


    // Setup default common & uvm schedules (always present)
    m_pcommon_schedule = get_uvm_common_schedule();
    m_schedules.push_back(m_pcommon_schedule);

    m_puvm_schedule    = get_uvm_schedule();
    m_schedules.push_back(m_puvm_schedule);

}
uvm_component::uvm_component(sc_module_name nm) : sc_module(nm) { 

  uvm_common_schedule* pcommon_schedule = get_uvm_common_schedule();
  pcommon_schedule->register_callback(this);

  // TODO: should all component default to be part of UVM schedule?
  uvm_common_schedule* puvm_schedule = get_uvm_schedule();
  puvm_schedule->register_callback(this);

  if (!global_timeout_spawned_) {
    // spawn thread that will wait for m_global_timeout to expire
    sc_spawn_options o;

    MARK_THREAD_INVISIBLE(o);
    sc_spawn(sc_bind(&uvm_manager::wait_for_global_timeout, get_uvm_manager()),
             "uvm_wait_for_global_timeout",
             &o
    );
    global_timeout_spawned_ = true;
  }
}