はじめに
uvm_phaseの種類と、各フェーズがトップダウン(Test階層→Env階層→Agent階層)で実行されるかボトムアップ(Agent階層→Env階層→Test階層)で実行されるかを調べました。
uvm_phase
uvm_phaseの各フェーズは表の上から順に実行されていきます。
uvm_phase | 実行順序 |
---|---|
build_phase | トップダウン |
connect_phase | ボトムアップ |
end_of_elaboration_phase | ボトムアップ |
start_of_simulation_phase | ボトムアップ |
pre_reset_phase | トップダウン |
reset_phase | トップダウン |
post_reset_phase | トップダウン |
pre_configure_phase | トップダウン |
configure_phase | トップダウン |
post_configure_phase | トップダウン |
pre_main_phase | トップダウン |
main_phase | トップダウン |
post_main_phase | トップダウン |
pre_shutdown_phase | トップダウン |
shutdown_phase | トップダウン |
post_shutdown_phase | トップダウン |
extract_phase | ボトムアップ |
check_phase | ボトムアップ |
report_phase | ボトムアップ |
final_phase | トップダウン |
サンプルコード
module top();
import uvm_pkg::*;
`include "uvm_macros.svh"
class sample_env extends uvm_env;
`uvm_component_utils(sample_env)
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
`uvm_info(this.get_name(), "build_phase", UVM_NONE)
endfunction
function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
`uvm_info(this.get_name(), "connect_phase", UVM_NONE)
endfunction
function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
`uvm_info(this.get_name(), "end_of_elaboration_phase", UVM_NONE)
endfunction
function void start_of_simulation_phase(uvm_phase phase);
super.start_of_simulation_phase(phase);
`uvm_info(this.get_name(), "start_of_simulation_phase", UVM_NONE)
endfunction
task run_pahse(uvm_phase phase);
super.run_phase(phase);
`uvm_info(this.get_name(), "run_phase", UVM_NONE)
endtask
task pre_reset_phase(uvm_phase phase);
super.pre_reset_phase(phase);
`uvm_info(this.get_name(), "pre_reset_phase", UVM_NONE)
endtask
task reset_phase(uvm_phase phase);
super.reset_phase(phase);
`uvm_info(this.get_name(), "reset_phase", UVM_NONE)
endtask
task post_reset_phase(uvm_phase phase);
super.post_reset_phase(phase);
`uvm_info(this.get_name(), "post_reset_phase", UVM_NONE)
endtask
task pre_configure_phase(uvm_phase phase);
super.pre_configure_phase(phase);
`uvm_info(this.get_name(), "pre_configure_phase", UVM_NONE)
endtask
task configure_phase(uvm_phase phase);
super.configure_phase(phase);
`uvm_info(this.get_name(), "configure_phase", UVM_NONE)
endtask
task post_configure_phase(uvm_phase phase);
super.post_configure_phase(phase);
`uvm_info(this.get_name(), "post_configure_phase", UVM_NONE)
endtask
task pre_main_phase(uvm_phase phase);
super.pre_main_phase(phase);
`uvm_info(this.get_name(), "pre_main_phase", UVM_NONE)
endtask
task main_phase(uvm_phase phase);
super.main_phase(phase);
`uvm_info(this.get_name(), "main_phase", UVM_NONE)
endtask
task post_main_phase(uvm_phase phase);
super.post_main_phase(phase);
`uvm_info(this.get_name(), "post_main_phase", UVM_NONE)
endtask
task pre_shutdown_phase(uvm_phase phase);
super.pre_shutdown_phase(phase);
`uvm_info(this.get_name(), "pre_shutdown_phase", UVM_NONE)
endtask
task shutdown_phase(uvm_phase phase);
super.shutdown_phase(phase);
`uvm_info(this.get_name(), "shutdown_phase", UVM_NONE)
endtask
task post_shutdown_phase(uvm_phase phase);
super.post_shutdown_phase(phase);
`uvm_info(this.get_name(), "post_shutdown_phase", UVM_NONE)
endtask
function void extract_phase(uvm_phase phase);
super.extract_phase(phase);
`uvm_info(this.get_name(), "extract_phase", UVM_NONE)
endfunction
function void check_phase(uvm_phase phase);
super.check_phase(phase);
`uvm_info(this.get_name(), "check_phase", UVM_NONE)
endfunction
function void report_phase(uvm_phase phase);
super.report_phase(phase);
`uvm_info(this.get_name(), "report_phase", UVM_NONE)
endfunction
function void final_phase(uvm_phase phase);
super.final_phase(phase);
`uvm_info(this.get_name(), "final_phase", UVM_NONE)
endfunction
endclass
class sample_test extends uvm_test;
`uvm_component_utils(sample_test)
sample_env env;
function new(string name="sample_test", uvm_component parent=null);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
env = sample_env::type_id::create("env", this);
`uvm_info(this.get_name(), "build_phase", UVM_NONE)
endfunction
function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
`uvm_info(this.get_name(), "connect_phase", UVM_NONE)
endfunction
function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
`uvm_info(this.get_name(), "end_of_elaboration_phase", UVM_NONE)
endfunction
function void start_of_simulation_phase(uvm_phase phase);
super.start_of_simulation_phase(phase);
`uvm_info(this.get_name(), "start_of_simulation_phase", UVM_NONE)
endfunction
task run_pahse(uvm_phase phase);
super.run_phase(phase);
`uvm_info(this.get_name(), "run_phase", UVM_NONE)
endtask
task pre_reset_phase(uvm_phase phase);
super.pre_reset_phase(phase);
`uvm_info(this.get_name(), "pre_reset_phase", UVM_NONE)
endtask
task reset_phase(uvm_phase phase);
super.reset_phase(phase);
`uvm_info(this.get_name(), "reset_phase", UVM_NONE)
endtask
task post_reset_phase(uvm_phase phase);
super.post_reset_phase(phase);
`uvm_info(this.get_name(), "post_reset_phase", UVM_NONE)
endtask
task pre_configure_phase(uvm_phase phase);
super.pre_configure_phase(phase);
`uvm_info(this.get_name(), "pre_configure_phase", UVM_NONE)
endtask
task configure_phase(uvm_phase phase);
super.configure_phase(phase);
`uvm_info(this.get_name(), "configure_phase", UVM_NONE)
endtask
task post_configure_phase(uvm_phase phase);
super.post_configure_phase(phase);
`uvm_info(this.get_name(), "post_configure_phase", UVM_NONE)
endtask
task pre_main_phase(uvm_phase phase);
super.pre_main_phase(phase);
`uvm_info(this.get_name(), "pre_main_phase", UVM_NONE)
endtask
task main_phase(uvm_phase phase);
super.main_phase(phase);
`uvm_info(this.get_name(), "main_phase", UVM_NONE)
endtask
task post_main_phase(uvm_phase phase);
super.post_main_phase(phase);
`uvm_info(this.get_name(), "post_main_phase", UVM_NONE)
endtask
task pre_shutdown_phase(uvm_phase phase);
super.pre_shutdown_phase(phase);
`uvm_info(this.get_name(), "pre_shutdown_phase", UVM_NONE)
endtask
task shutdown_phase(uvm_phase phase);
super.shutdown_phase(phase);
`uvm_info(this.get_name(), "shutdown_phase", UVM_NONE)
endtask
task post_shutdown_phase(uvm_phase phase);
super.post_shutdown_phase(phase);
`uvm_info(this.get_name(), "post_shutdown_phase", UVM_NONE)
endtask
function void extract_phase(uvm_phase phase);
super.extract_phase(phase);
`uvm_info(this.get_name(), "extract_phase", UVM_NONE)
endfunction
function void check_phase(uvm_phase phase);
super.check_phase(phase);
`uvm_info(this.get_name(), "check_phase", UVM_NONE)
endfunction
function void report_phase(uvm_phase phase);
super.report_phase(phase);
`uvm_info(this.get_name(), "report_phase", UVM_NONE)
endfunction
function void final_phase(uvm_phase phase);
super.final_phase(phase);
`uvm_info(this.get_name(), "final_phase", UVM_NONE)
endfunction
endclass
initial begin
run_test("sample_test");
end
endmodule
まとめ
uvm_phaseの種類と実行順序についてまとめました。
コメント