掌握基本概念和操作
● 懂得如何编译 UVM 代码
● 理解 SV 和 UVM 之间的关系
● 了解 UVM 验证顶层盒子与 SV 验证顶层盒子之间的联系
● 掌握启动 UVM 验证的必要步骤。
SV 和 UVM 之间的关系
sv_class_inst.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中定义了一个类不继承于uvm的任何一个类。
vsim -novopt work.sv_class_inst -classdebug使用此命令
uvm顶层与SV顶层对比
uvm_test_inst
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类