`include "uvm_macros.svh"
import uvm_pkg::*;
package pkg;
import uvm_pkg::*;
class env extends uvm_env;
`uvm_component_utils(env)
int m_delay;
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
if (!uvm_config_db#(int)::get(this, "", "delay", m_delay))
`uvm_fatal("", "Delay missing from config db")
endfunction
task run_phase(uvm_phase phase);
`uvm_info(get_full_name(), "run_phase called", UVM_MEDIUM)
phase.raise_objection(this);
repeat(5) #(m_delay);
phase.drop_objection(this);
`uvm_info(get_full_name(), "run_phase returning", UVM_HIGH)
endtask
function void extract_phase(uvm_phase phase);
`uvm_info(get_full_name(),"this is extract phase",UVM_LOW)
endfunction
function void check_phase(uvm_phase phase);
`uvm_info(get_full_name(),"this is check phase",UVM_LOW)
endfunction
function void report_phase(uvm_phase phase);
`uvm_info(get_full_name(),"this is report phase",UVM_LOW)
endfunction
function void final_phase(uvm_phase phase);
`uvm_info(get_full_name(),"this is final phase",UVM_LOW)
endfunction
endclass
class test extends uvm_test;
`uvm_component_utils(test)
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction
env m_env1;
uvm_domain domain1;
function void build_phase(uvm_phase phase);
uvm_config_db#(int)::set(this, "m_env1", "delay", 100);
m_env1 = env::type_id::create("m_env1", this);
domain1 = new("domain1");
m_env1.set_domain(domain1);
endfunction
task run_phase(uvm_phase phase);
phase.raise_objection(this);
#5;
// this is for domain1 to jump to respective phase phase
if(!$test$plusargs("JMP_FINAL_PH")) begin // TRUE
`uvm_info(get_type_name(),"Jumping to extract phase now...",UVM_LOW)
domain1.jump(uvm_extract_phase::get());
//phase.jump(uvm_extract_phase::get());
end
else begin
`uvm_info(get_type_name(),"Jumping to final phase now...",UVM_LOW)
domain1.jump(uvm_final_phase::get()); // This calls final phase once. Under any circumstance
end
phase.drop_objection(this);
endtask
endclass
endpackage
module top;
import uvm_pkg::*;
import pkg::*;
initial
begin
run_test("test");
end
endmodule
Query :-
While using
domain1.jump(uvm_extract_phase::get()); // extract phase executed twice
phase.jump(uvm_extract_phase::get()); // extract phase executed once
Why does extract phase gets called twice while using domain ?
Thanks In Adv