一.怎样将例化的uvn test包含在verdi的instance中
1.test class在module test中例化(verdi只显示module,class只有包含在module中才会被显示)。注意如果是在module的同一个文件中,但是在module外面去定义class tests会不会也可以追踪呢?不可以写在module外面,写在外面是没法追代码的,代码都是灰白的。
2.注意需要在对应的module tests中将class test进行run(110行)。(testbench.sv(或者说top.sv中)中就不用去使用run_test了)
3.test所在module文件列出来在filelist中。
4.注意module不能包含在pkg中。
5.可能打开verdi也没有显示该test,可以在declaretion窗口找到该case(对应所在的module),双击,然后在instance中就会显示该case。
比如下面这个例子(定义了和test同名的module,test定义在了module中,并按照上面步骤在module中run的test):
1.module and test的定义
filist:
verdi结果(可以看到test已经在instance上显示,并且class test也处于可以通过点击鼠标右键追踪代码的状态):
如果class test在module test外面定义那么class test的代码是不可被追踪的。如下图(class代码是不可被最终状态):
二.怎样将例化的uvn test 的变量加入到dump的波形中:
如上面例子中所示。
0.将class test中的想dump的变量用static来修饰。(因为静态变量是不用实例化类就可以直接使用的)(14和16行)
1.在module test中将定义一个变量,然后使用连续赋值语句assign来接收class test中的static修饰的变量。(105和106行)
2.dump_fsdb_vcs.tcl中加入对module test的信号波形dump。
3.然后在verdi中就可以拉出那个接收class test中static变量值的变量波形来查看了。
缺点:static变量,如果有多个实例化的class,那么这些class都有可能改变这个static变量。其实可以使用verdi的interactive debug mode进行debug。