walkeranderson Posted November 19, 2015 Report Share Posted November 19, 2015 I'm sure it's simple (if you know what you're doing) but could someone please point me to, or include in a response, a simple and complete example of defining a user-defined phase to be inserted into the schedule between the pre_configure and configure phases? Thanks. Quote Link to comment Share on other sites More sharing options...
walkeranderson Posted November 20, 2015 Author Report Share Posted November 20, 2015 Figured this out myself. In case anyone is interested, here's what I did. My goal was to add a run-time phase that I could use for configuring default sequences on sequencers. /////////////////////////////////////////////////////// Here's the definition of the new phase class uvm_foo_phase extends uvm_task_phase; virtual task exec_task(uvm_component comp, uvm_phase phase); my_uvm_sequencer seqr; if ($cast(seqr, comp)) seqr.foo_phase(phase); endtask local static uvm_foo_phase m_inst; static const string type_name = "uvm_foo_phase"; // Function: get // Returns the singleton phase handle static function uvm_foo_phase get(); if(m_inst == null) m_inst = new; return m_inst; endfunction protected function new(string name="foo"); super.new(name); endfunction virtual function string get_type_name(); return type_name; endfunction endclass /////////////////////////////////////////////////////// Here's what I added to the build phase of my test component to add it to the run time schedule. uvm_phase sched = uvm_domain::get_uvm_schedule(); sched.add(uvm_foo_phase::get(), .after_phase(sched.find_by_name("pre_configure")), .before_phase(sched.find_by_name("configure"))); /////////////////////////////////////////////////////// Here's what I added to my my_uvm_sequencer class virtual function void foo_phase(uvm_phase phase); start_phase_sequence(phase); 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.