Jump to content

Could the m_uvm_sched be given up?


Recommended Posts

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

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...