收藏了!1个让零基础小白也能看懂AI的GitHub开源课程,太全了
2026/7/15 0:18:33
10-1 phase:basic UVM测试平台层次结构与Phase执行顺序解析
这个案例和上一篇10-1基本类似,可以跳过,区别是这个案例少了上篇很奇怪的AA类的中间层
module top;import uvm_pkg::*;//Create a topology// top// | |// u1(A) u2(A)// | | | |// b1(B) d1(D) b1(B) d1(D)//No run phaseclassDextends uvm_component;functionnew(string name,uvm_component parent);super.new(name,parent);endfunction functionvoidbuild_phase(uvm_phase phase);$display("%0t: %0s: build",$time,get_full_name());endfunction functionvoidend_of_elaboration_phase(uvm_phase phase);$display("%0t: %0s: end_of_elaboration",$time,get_full_name());endfunction functionvoidstart_of_simulation_phase(uvm_phase phase);$display("%0t: %0s: start_of_simulation",$time,get_full_name());endfunction functionvoidextract_phase(uvm_phase phase);$display("%0t: %0s: extract",$time,get_full_name());endfunction functionvoidcheck_phase(uvm_phase phase);$display("%0t: %0s: check",$time,get_full_name());endfunction functionvoidreport_phase(uvm_phase phase);$display("%0t: %0s: report",$time,get_full_name());endfunction endclass//Has run phaseclassBextends uvm_component;rand logic[7:0]delay;functionnew(string name,uvm_component parent);super.new(name,parent);endfunction functionvoidbuild_phase(uvm_phase phase);$display("%0t: %0s: build",$time,get_full_name());endfunction functionvoidend_of_elaboration_phase(uvm_phase phase);$display("%0t: %0s: end_of_elaboration",$time,get_full_name());endfunction functionvoidstart_of_simulation_phase(uvm_phase phase);$display("%0t: %0s: start_of_simulation",$time,get_full_name());endfunction functionvoidextract_phase(uvm_phase phase);$display("%0t: %0s: extract",$time,get_full_name());endfunction functionvoidcheck_phase(uvm_phase phase);$display("%0t: %0s: check",