$display vs $strobe vs $monitor in verilog? [英] $display vs $strobe vs $monitor in verilog?

查看:51
本文介绍了$display vs $strobe vs $monitor in verilog?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

verilog 中的 $display vs $strobe vs $monitor 有什么区别?当在事件队列中时,每个都适用,语句如何交互?任何声明都可以抑制另一个声明吗?

What is the difference between $display vs $strobe vs $monitor in verilog? When in the event queue does each apply, and how do the statements interact? Can any statement inhibit another?

推荐答案

我会很好地总结LRM(语言参考手册),但您应该阅读它.一切都在IEEE Std 1800-2012 §21.2 显示系统任务(技术上是SystemVerilog,但这些功能是相同的.)

I'll be nice and summarize the LRM (Language Reference Manual), but you should read it. Everything is in IEEE Std 1800-2012 § 21.2 Display system tasks (Technically SystemVerilog, but these functions are identical.)

  • $display : 打印立即数
    • §21.2.1 显示和写入任务
    • $display : print the immediate values
      • § 21.2.1 The display and write tasks
      • §21.2.2 选通监控
      • §21.2.3 持续监控
      • §21.2.1 显示和写入任务

      示例:

      reg [3:0] a,b;
      integer i;
      initial begin
        $monitor("monitor a:%h b:%h @ %0t", a, b, $time);
        for(i=0; i<4; i=i+1) begin
          $strobe("strobe  a:%h b:%h @ %0t", a, b, $time);
          $display("display a:%h b:%h @ %0t", a, b, $time);
          case(i)
            0 : a = 4;
            1 : b = 1;
            2 : begin end // do nothing
            3 : {a,b} = 9;
          endcase
          $display("display a:%h b:%h @ %0t", a, b, $time);
          #1;
        end
      end
      

      输出:(注意打印顺序和那个监视器在时间 2 没有显示)

      Outputs: (notice the print order and that monitor is not displayed at time 2)

      显示 a:x b:x @ 0
      显示 a:4 b:x @ 0
      监视器 a:4 b:x @ 0
      频闪 a:4 b:x @ 0
      显示 a:4 b:x @ 1
      显示 a:4 b:1 @ 1
      监视器 a:4 b:1 @ 1
      频闪 a:4 b:1 @ 1
      显示 a:4 b:1 @ 2
      显示 a:4 b:1 @ 2
      频闪 a:4 b:1 @ 2
      显示 a:4 b:1 @ 3
      显示 a:0 b:9 @ 3
      监视器 a:0 b:9 @ 3
      频闪 a:0 b:9 @ 3

      display a:x b:x @ 0
      display a:4 b:x @ 0
      monitor a:4 b:x @ 0
      strobe a:4 b:x @ 0
      display a:4 b:x @ 1
      display a:4 b:1 @ 1
      monitor a:4 b:1 @ 1
      strobe a:4 b:1 @ 1
      display a:4 b:1 @ 2
      display a:4 b:1 @ 2
      strobe a:4 b:1 @ 2
      display a:4 b:1 @ 3
      display a:0 b:9 @ 3
      monitor a:0 b:9 @ 3
      strobe a:0 b:9 @ 3

      这篇关于$display vs $strobe vs $monitor in verilog?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆