UVM入门和进阶实验0
入门 进阶 实验 UVM
2023-09-11 14:20:39 时间
一. 概述
UVM学习流程仍然按照SV时候的核心流程,即:
- 如何搭建验证框架
- 验证组件之间的连接和通信
- 如何编写测试用例,继而完成复用和覆盖率的收敛
我们UVM入门和进阶实验0还是同之前SV验证实验0思想一样,让大家通过简单的实验要求,从而掌握下面的基本概念和仿真操作:
- 懂得如何编译UVM代码。
- 理解SV和UVM之间的关系。
- 了解UVM验证顶层盒子与SV验证顶层盒子之间的联系。
- 掌握启动UVM验证的必要步骤。
二. 编译UVM代码
(1)导入uvm_dass_inst.sv,sv_class_inst.sv,uvm_test_inst.sv,uvm_compile.sv并且compile select
(2)编译文件uvm_compile.sv,选项为:simulate without optimization,待正常编译结束。
module uvm_compile;
// NOTE:: it is necessary to import uvm package and macros
import uvm_pkg::*; //预编译的uvm的库
`include "uvm_macros.svh"//预编译的uvm的库
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
uvm_pkg可以在mtiUvm中找到。
(3)在命令窗口中敲入"run-all",可以观察到仿真输出语句:
三. SV和UVM之间的关系
(1)编译sv_class_inst
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
编译结果:
反映在sim中的结构图:
其实在0时刻的时候创建了t,并且结束了仿真,但是在instance中没有显示。获得显示的过程为:
首先transcipt中输入restart
然后点击sv_class_inst,将断点设置在17行,
再者transcipt中输入run -all,
点击view-local,
选中initial过程块,local中会显示t变量。
run -all的仿真结果:
(2)编译uvm_class_inst
module uvm_compile;
// NOTE:: it is necessary to import uvm package and macros
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
`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
编译结果:
run -all仿真结果:
四. UVM验证顶层盒子与SV验证顶层盒子之间的联系。
编译并仿真uvm_test_inst.sv
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
仿真结果:
相关文章
- Web APi入门之移除XML格式(一)
- 软件测试工作3年了,谈谈我是如何从刚入门进阶到自动化测试的?
- Postman 从入门到进阶教程(万字长文)
- 5分钟入门MP4文件格式
- Node.js进阶:5分钟入门非对称加密方法
- php之快速入门学习-11(数组排序)
- 零基础入门学Python,不出8周你就可以月薪15k了!(教程分享)
- 不要再走弯路了,最全的黑客入门学习路线在这[通俗易懂]
- Hadoop入门程序WordCount的执行过程
- 算法入门到进阶(三)——搜索技术(DFS和递归)
- 算法入门到进阶(三)——搜索技术(八数码问题和状态图搜索)
- 算法入门到进阶(三)——搜索技术(递归和排列)
- 算法入门到进阶(二)——STL和基本数据结构(队列和链表)
- 从零入门激光SLAM(三)——什么是ROS
- Flet教程之 15 GridView 基础入门(教程含源码)
- vue实战入门进阶篇十:vue+elementui实现网站后台-代码重构及发布
- 第一周python入门
- Java开发框架Play框架快速入门
- 《C#零基础入门之百识百例》(四)输入输出 -- 模拟登陆
- Hadoop入门进阶步步高(一)-环境准备
- VS2010/MFC编程入门之十一(对话框:模态对话框及其弹出过程)
- Java小白入门200例01之基本打印输出
- 学好Java入门的几个阶段,这样走你会学的更好