irun和vcs工具,检测TB环境零延时无限循环以及zero-delay组合逻辑


前言

在写TB代码时,如果循环退出条件没注意,可能使循环一直不能退出,而且该循环又是没有延时的,因此就出现了zero-delay(零延时)的无限循环。

编写RTL,如果不注意,可能会写出zero-delay(零延时)的组合逻辑,也就是组合逻辑的输出,直接反馈到组合逻辑的输入上,导致零延时的组合逻辑。


一、irun工具

方法一:

irun提供了 +linedebug 编译选项,可以实现代码的调试。

irun -64 –sv +access+wrc +linedebug  testbench.v 

方法二:

使用simvision工具,进行调试,命令如下:

irun  -64 –sv +access+wrc   -gateloopwarn   zero_dut.v testbench.v -gui

在console界面中,输入run,开始仿真。
输入 driver -active,会打印出,工具认为的零延时组合逻辑的RTL代码位置。

三、vcs工具

方法一:

Compile/simv中加上这个option: +vcs+loopreport+number

在这里插入图片描述

方法二:
在compile用-debug_all,然后手动找。
方法如下:

Run the simulation using the following command:

  ./simv -ucli

## create the following procedure to run the simulation for "nsteps" 
 
ucli%proc mstep {nsteps} {
  global now
  for {set a1 0} {$a1 < $nsteps} {incr a1} {
    echo [step] 
    echo $now 
    echo [senv activeScope]
    }
}

  Ucli% run  

##Once you think that the simulation is already in infinite loop, 
##you can hit "CTRL C"

  Ucli% mstep 1000

## The above step will generate simulation step log for next 1000 steps. 
## You can then analyze the log file to see if there is any repetition of 
## the logic. If you do not see the repetition then run for another 1000 
## steps and so on.


总结

本文主要介绍irun和vcs如何利用工具去检测TB环境零延时无限循环以及zero-delay组合逻辑。

  • 6
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值