码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • irun和vcs工具,检测TB环境零延时无限循环以及zero-delay组合逻辑


    文章目录

    • 前言
    • 一、irun工具
    • 三、vcs工具
    • 总结


    前言

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

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


    一、irun工具

    方法一:

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

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

    方法二:

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

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

    在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.
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27

    总结

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

  • 相关阅读:
    tail -f 、tail -F、tailf的区别
    精通git,没用过git cherry-pick?
    php实战案例记录(7)可变变量$$str
    Compare线刷包与卡刷包
    Java【初识static、代码块、抽象类、接口、内部类】
    MATLAB调用工业相机读取图像数据
    KubeSphere Namespace 数据删除事故分析与解决全记录
    【开源】在线考试系统 JAVA+Vue.js+SpringBoot 新手入门项目
    2023最新CTF入门的正确姿势
    【从零开始学习 SystemVerilog】11.1、SystemVerilog 断言—— Assertions Introduction(断言概述)
  • 原文地址:https://blog.csdn.net/hh199203/article/details/126106202
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号