qinhailiang Posted December 10, 2014 Report Share Posted December 10, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.