Esempio n. 1
0
void uvm_phase_controller::do_run(void) 
{

    sc_process_handle run_handle;
    sc_spawn_options o;
    
    MARK_THREAD_INVISIBLE(o);

    // spawn thread that will wait for m_global_timeout to expire
    sc_spawn(sc_bind(&uvm_phase_controller::wait_for_global_timeout, this),
            "uvm_wait_for_global_timeout",
            &o
    );

    // spawn UVM runtime schedules
    for (unsigned int i = 0; i < m_schedules.size(); i++)
    {
        run_handle = sc_spawn(sc_bind(&uvm_schedule::do_run, m_schedules[i]));
        m_join_run.add_process(run_handle);
    }

    // spawn thread that will wait for active runtime schedules to complete
    sc_spawn(sc_bind(&uvm_phase_controller::wait_for_run_phases, this),
            "uvm_wait_for_run_phases",
            &o
    );

    // TODO - spawn check for runtime fatal errors here (try/catch?)
    //        Note:  Needs to work in ML as well...
}
Esempio n. 2
0
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;
  }
}