Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

Could the m_uvm_sched be given up?

$
0
0

Hi, all

 

     When i read the uvm source code, I had a puzzle as follow:

 

     Why are the twelve runtime phases added into m_uvm_schedule phase instead of being added directly m_uvm_domain domain in file uvm_domain.svh?

 

  static function void add_uvm_phases(uvm_phase schedule);

    schedule.add(uvm_pre_reset_phase::get());
    schedule.add(uvm_reset_phase::get());
    schedule.add(uvm_post_reset_phase::get());
    schedule.add(uvm_pre_configure_phase::get());
    schedule.add(uvm_configure_phase::get());
    schedule.add(uvm_post_configure_phase::get());
    schedule.add(uvm_pre_main_phase::get());
    schedule.add(uvm_main_phase::get());
    schedule.add(uvm_post_main_phase::get());
    schedule.add(uvm_pre_shutdown_phase::get());
    schedule.add(uvm_shutdown_phase::get());
    schedule.add(uvm_post_shutdown_phase::get());

  endfunction

 

 

  static function uvm_domain get_uvm_domain();
 
    if (m_uvm_domain == null) begin
      m_uvm_domain = new("uvm");
      m_uvm_schedule = new("uvm_sched", UVM_PHASE_SCHEDULE);
      add_uvm_phases(m_uvm_schedule);
      m_uvm_domain.add(m_uvm_schedule);
    end
    return m_uvm_domain;
  endfunction

 

 

Could the two functions be mergered one function as follow?

 

 

  static function uvm_domain get_uvm_domain();
 
    if (m_uvm_domain == null) begin
      m_uvm_domain = new("uvm");
      m_uvm_domain.add(uvm_pre_reset_phase::get());
      m_uvm_domain.add(uvm_reset_phase::get());
      m_uvm_domain.add(uvm_post_reset_phase::get());
      m_uvm_domain.add(uvm_pre_configure_phase::get());
      m_uvm_domain.add(uvm_configure_phase::get());
      m_uvm_domain.add(uvm_post_configure_phase::get());
      m_uvm_domain.add(uvm_pre_main_phase::get());
      m_uvm_domain.add(uvm_main_phase::get());
      m_uvm_domain.add(uvm_post_main_phase::get());
      m_uvm_domain.add(uvm_pre_shutdown_phase::get());
      m_uvm_domain.add(uvm_shutdown_phase::get());
      m_uvm_domain.add(uvm_post_shutdown_phase::get());
    end
    return m_uvm_domain;
  endfunction

 

 

 


Viewing all articles
Browse latest Browse all 756

Trending Articles