I am trying to jump some of the phases in my TB in order to skip certain unnecessary checks and save some time. But I see some discrepancies.
There are two environments and two separate domains assigned to them as shown below. When domain1 is in shutdown phase, domain2 enters in main phase, this suggests that both the domains run independently of each other (as expected).
// Displays are there in every phase of environment
class test extends uvm_test;
`uvm_component_utils(test)
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction
env m_env1;
env m_env2;
uvm_domain domain1;
uvm_domain domain2;
function void build_phase(uvm_phase phase);
// This part domain1 and domain2 are running independently
// uvm_config_db#(int)::set(this, "m_env1", "delay", 10);
// Use different delays to see that domain1 and domain2 run independently
uvm_config_db#(int)::set(this, "m_env1", "delay", 100);
uvm_config_db#(int)::set(this, "m_env2", "delay", 100);
m_env1 = env::type_id::create("m_env1", this);
m_env2 = env::type_id::create("m_env2", this);
domain1 = new("domain1");
m_env1.set_domain(domain1);
domain2 = new("domain2");
m_env2.set_domain(domain2);
//domain1.sync(domain2);
endfunction
function void start_of_simulation_phase(uvm_phase phase);
this.set_report_verbosity_level_hier(UVM_FULL);
endfunction
task run_phase(uvm_phase phase);
#250;
`ifdef EXTRACT_PH_JUMP // USE THIS SWITCH TO JUMP TO EXTRACT PHASE
// Both domain1 and domain2 jumps to extract phase unexpectedly.
// this is for domain2 to jump to extract phase
domain2.jump(uvm_extract_phase::get());
`else
// Both domain1 and domain2 jumps to repective phases other than extract phase. I would expect only domain2 to jump and wait and domain1 to continue phase execution.
// domain2 should wait till domain1 completes other phases
// this is for domain2 to jump to final phase
domain2.jump(uvm_final_phase::get());
`endif
endtask
endclass
// Output when jumping to extract phase. Extract phase display comes twice.
UVM_INFO /apps/vcsmx/etc/uvm-1.2/src/base/uvm_phase.svh(1552) @ 250: reporter [PH_JUMP] phase main (schedule uvm_sched, domain domain2) is jumping to phase extract
UVM_WARNING @ 250: main_objection [OBJTN_CLEAR] Object 'uvm_top' cleared objection counts for main_objection
UVM_INFO testbench.sv(78) @ 1040: uvm_test_top.m_env1 [uvm_test_top.m_env1] this is extract phase
UVM_INFO testbench.sv(78) @ 1040: uvm_test_top.m_env2 [uvm_test_top.m_env2] this is extract phase
UVM_INFO testbench.sv(78) @ 1040: uvm_test_top.m_env1 [uvm_test_top.m_env1] this is extract phase
UVM_INFO testbench.sv(78) @ 1040: uvm_test_top.m_env2 [uvm_test_top.m_env2] this is extract phase
1. When I jump from run phase to any phase, both the domain1 and domain2 skips the remaining phases and jumps to the intended phase. I would expect domain2 only to skip the phases and jump forward and wait (domain1 jumps unexpectedly). Is there any way to skip phases for domain2 only?
2. But when a jump happens from "run_phase" (or any other task phase) to "extract_phase", then the "extract_phase" is getting called twice. This is certainly not expected. Is there any workaround for this?
Sample code: http://www.edaplayground.com/x/4jqT
Referral code from Duolos.
Please provide some inputs regarding the two issues. Let me know where my understanding is lagging.
EDIT: MODIFIED THE CODE. USE "+define+EXTRACT_PH_JUMP" TO JUMP TO EXTRACT PHASE AND SEE THAT IT IS GETTING CALLED TWICE (SCENARIO-2). IF YOU DON'T USE THIS MACRO, THEN IT WILL JUMP TO FINAL PHASE (SCENARIO-1).