在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 3687|回复: 4

[原创] uvm_root学习总结

[复制链接]
发表于 2020-9-28 12:39:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
什么是uvm_root ?
1.  uvm_root 的作用
uvm_root class 是验证平台中所有UVM components的“隐含”的top-level和phase控制器。用户不需要直接实例化uvm_root,UVM会自动创建uvm_root单一实例,用户可以使用全局变量(uvm_pkg范围内)uvm_top来访问uvm_root image.png 2. uvm_top

uvm_top 实例在UVM中扮演几个关键角色。

Implicit top-level :任何指定parent为null的component都是uvm_top 的孩子。因此,仿真中所有的UVM components都是uvm_top 的后代。

Phase control:uvm_top 管理所有components的phase运行。

search:可以使用uvm_top 基于层次结构搜索components,具体参考后面的find和find_all方法。

Report configuration:使用uvm_top 全局配置report verbosity,log files等。


例如:uvm_top.set_report_verbosity_level_hier(UVM_FULL)// 仿真中所有components的verbosity设置为UVM_FULL。

Global reporter:因为uvm_top 是在uvm_pkg范围内全局可以访问,因此UVM的reporting机制在uvm_componet外的其他地方也可以进行访问,例如在module和sequence中。可参考手册中uvm_report_error,uvm_report_warning和其他的全局方法。

uvm_top 实例化会在end_of_elaboration phase中检查目前为止是否会有error产生,如果发现有UVM_FATAL的错误,那么仿真会结束,不会继续进入到start_of_simulation_phase中。

3.  uvm_root  类中的方法和变量get()

static function uvm_root get()// static accessor for uvm_root;uvm_root r;r = uvm_root::get();

get()函数用于返回uvm_root的句柄。

Simulation Control
run_test

virtual task run_test (   string test_name = "" )

如果test_name参数被提供,或者通过命令+UVM_TESTNAME=TEST_NAME,run_test将会执行。当run_test被执行时,components被创建,接着phases将会执行,如果全局变量finish_on_completion被设置为1,那么phase执行完成后,会调用$finish来结束仿真。

die

virtual function void die ()

如果report达到了最大的退出数量或者有UVM_EXIT的行为状态,die函数会被调用来结束仿真。

set_timeout

function void set_timeout (   time  timeout,   bit   overridable = 1 )

定义仿真超时时间,默认值为`UVM_DEFAULT_TIMEOUT。超时是FATAL发生之前的最大仿真时间。例如,timeout设置为20s,仿真必须在20s之前结束,否则会发生一个超时FATAL。因此这个函数提供给用户进行设置timeout,防止测试平台被挂起消耗太多的资源(硬盘、内存、cpu等)。

finish_on_completion

bit finish_on_completion = 1

如果设置,run_test就会在所有phases执行完之后调用$finish来结束仿真。

Topology
find

function uvm_component find (   string comp_match)find_all

function void find_all (   string comp_match,   ref uvm_component comps[$],   input uvm_component comp = null)

通过匹配给定的字符串, find函数可以返回component handle,find_all函数返回components handles列表。

print_topology

function void print_topology (   uvm_printer printer = null)打印验证环境组件的拓扑结构。printer是uvm_printer的object,用来控制拓扑结构打印输出的形式;一个null printer会以默认形式进行打印。
enable_print_topology


bit enable_print_topology = 0如果设置为1,整个testbench的拓扑结构会在end_of_elaboration_phase完成时被打印。
因此想要打印验证环境,有以上两种方法可以使用:

uvm_top.enable_print_topology = 1;或者:uvm_top.print_topology();
Global Variables
uvm_top


const uvm_root uvm_top = uvm_root::get()uvm_top是验证平台的top-level,控制着phases的执行,提供search component的接口。
以上如有不对的地方,欢迎指正,谢谢!!想要了解更多,请参考:
1. Universal Verification Methodology (UVM) 1.2 Class Reference2. IEEE Standard for Universal Verification Methodology Language Reference Manual
欢迎关注微信公众号查看更多分享:IC验证分享圈同时欢迎加入IC验证分享圈微信群,一起学习交流


发表于 2020-9-28 14:38:35 | 显示全部楼层
楼主看你公众号的easier uvm,那个大概会翻译多少个part啊。
 楼主| 发表于 2020-9-28 17:10:30 | 显示全部楼层


年轻的韭菜 发表于 2020-9-28 14:38
楼主看你公众号的easier uvm,那个大概会翻译多少个part啊。


大约10个 part,目前已经更新了一半,后续尽快更新,还会更新验证的其他内容,感谢关注,大家一起学习交流。
发表于 2020-9-28 18:00:21 | 显示全部楼层


ryy0609 发表于 2020-9-28 17:10
大约10个 part,目前已经更新了一半,后续尽快更新,还会更新验证的其他内容,感谢关注,大家一起学习交 ...


期待翻一下
的使用方法。
 楼主| 发表于 2020-9-28 20:19:20 | 显示全部楼层


年轻的韭菜 发表于 2020-9-28 18:00
期待翻一下 Easier UVM Code Generator的使用方法。


没问题,会在编码规则更新完成之后,谢谢关注!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-20 11:18 , Processed in 0.025142 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表