anming Posted July 23, 2015 Report Posted July 23, 2015 Hi. in UVM, It is legal to have phase jump to any function phases. but it seems in below demonstration code it does not work as I expected. I expected the flag build_agt2 = 1 after the phase.jump(build_phase). class mycomponent extends uvm_component; ....... bit build_agt2; function void build_phase(uvm_phase phase); `create_agt1(); if ( build_agt2) `create_ag2() ; or // `override_agt1_by_agt2(); endfunction task run_phase; // change flag build_agt2 to 1; endtask function void phase_ready_to_end; // if the imp phase is in shutdown_phase // then phase.jump to build_phase endfunction Quote
bhunter1972 Posted July 23, 2015 Report Posted July 23, 2015 I do not believe that it is "legal" to jump back to the function phases. You can jump forward to the check phase, for example, and you can jump back to the reset phase. But you definitely cannot go back and redo the build phase. Quote
anming Posted July 23, 2015 Author Report Posted July 23, 2015 Thank you Bhunter1972 for response. I have created a stright forward testcase. By running it, you will see the build_phase does get called 4 times. I might miss something. `include "uvm_macros.svh"import uvm_pkg ::*; class test extends uvm_test; int count; `uvm_component_utils(test) function new ( string name ="test", uvm_component p = null); super.new(name, p); endfunction virtual function void build_phase(uvm_phase phase); `uvm_info(get_full_name(), "i am in build_phase", UVM_MEDIUM) endfunction virtual function void connect_phase(uvm_phase phase); `uvm_info(get_full_name(), "I am in connect_phase", UVM_MEDIUM) endfunction virtual task pre_reset_phase(uvm_phase phase); `uvm_info(get_full_name(), "i am in test pre_reset_phase", UVM_MEDIUM) endtask virtual task main_phase ( uvm_phase phase); phase.raise_objection(this); `uvm_info(get_full_name(), " i am in test main_phase ", UVM_MEDIUM) phase.drop_objection(this); endtask function void phase_ready_to_end(uvm_phase phase); super.phase_ready_to_end(phase); if ( phase.get_imp() == uvm_shutdown_phase::get() && count < 3) begin phase.jump(uvm_build_phase::get()); count++; end endfunctionendclass module test; initial begin run_test("test"); endendmodule thanks andrwe Quote
bhunter1972 Posted July 24, 2015 Report Posted July 24, 2015 Based on what the developers have told me, phase jumping to a pre-run phase might "kinda-sorta work so don't do it." Put more simply, phase jumping was not intended to go back to a pre-run phase, so even though the functions may get called again this will lead to issues. Probably they should have more clearly made it NOT work, but whatever. Quote
ruchir.bharti Posted August 3, 2015 Report Posted August 3, 2015 There is another drawback of using "phase jump" : in case of Multi language verification env, when user jump phases then there might be synchronization issues with different scheduler. Quote
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.