踏出UVM世界的第一步,从而掌握下面的基本概念和仿真操作:
懂得如何编译UVM代码
module uvm_compile;
// NOTE:: it is necessary to import uvm package and macros
import uvm_pkg::*;
`include "uvm_macros.svh"
initial begin
`uvm_info("UVM", "Hello, welcome to RKV UVM training!", UVM_LOW)
#1us;
`uvm_info("UVM", "Bye, and more gifts waiting for you!", UVM_LOW)
end
endmodule
QUESTA软件编译运行后的截图如下:
理解SV和UVM之间的关系
了解UVM验证顶层盒子与SV验证顶层盒子之间的联系
module sv_class_inst;
import uvm_pkg::*;
`include "uvm_macros.svh"
class top;
function new();
`uvm_info("SV_TOP", "SV TOP creating", UVM_LOW)
endfunction
endclass
initial begin
top t;
`uvm_info("SV_TOP", "test started", UVM_LOW)
t = new();
`uvm_info("SV_TOP", "test finished", UVM_LOW)
end
endmodule
sv_class_inst运行后的层级关系:
module uvm_class_inst;
import uvm_pkg::*;
`include "uvm_macros.svh"
class top extends uvm_component;
`uvm_component_utils(top)
function new(string name = "top", uvm_component parent = null);
super.new(name, parent);
`uvm_info("UVM_TOP", "SV TOP creating", UVM_LOW)
endfunction
endclass
initial begin
top t;
`uvm_info("UVM_TOP", "test started", UVM_LOW)
t = new("t", null);
`uvm_info("UVM_TOP", "test finished", UVM_LOW)
end
endmodule
uvm_class_inst运行后的层级关系:
掌握启动UVM验证的必要步骤
package test_pkg;
import uvm_pkg::*;
`include "uvm_macros.svh"
class top extends uvm_test;
`uvm_component_utils(top)
function new(string name = "top", uvm_component parent = null);
super.new(name, parent);
`uvm_info("UVM_TOP", "SV TOP creating", UVM_LOW)
endfunction
task run_phase(uvm_phase phase);
phase.raise_objection(this);
`uvm_info("UVM_TOP", "test is running", UVM_LOW)
phase.drop_objection(this);
endtask
endclass
endpackage
module uvm_test_inst;
import uvm_pkg::*;
`include "uvm_macros.svh"
import test_pkg::*;
initial begin
`uvm_info("UVM_TOP", "test started", UVM_LOW)
run_test("top");
`uvm_info("UVM_TOP", "test finished", UVM_LOW)
end
endmodule
uvm_test_inst运行后的层级关系: