【问题标题】:Does a Verilog event control block execution of a procedure?Verilog 事件控制是否会阻止程序的执行?
【发布时间】:2019-06-23 19:48:25
【问题描述】:

在事件发生之前,Verilog 事件控制是否阻止程序的执行?考虑下面的例子。

module test;
  reg a;
  initial begin
    @(a) $display("%b", a);
    $display("the_message");
  end
endmodule

如果我运行上面的程序,模拟结束时不会打印the_message。为什么?

这是否意味着@(a) 会阻塞直到a 发生变化?如果是这样,为什么模拟不会永远挂起而不是在不打印the_message 的情况下终止?

谢谢

【问题讨论】:

  • 只是一点点,但在(系统)-Verilog 中,我们不谈论程序。有任务[可以消耗时间,不返回值,有零个或多个参数]和函数[不能消耗时间,必须返回一个值,有一个或多个参数]。

标签: verilog system-verilog system-verilog-assertions


【解决方案1】:

事件驱动的模拟器一直运行,直到没有更多活动事件被安排或明确终止 ($finish)。

【讨论】:

  • 谢谢@dave_59,能否请您推荐一个详细讨论调度和事件处理的 URL?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-19
  • 1970-01-01
  • 2014-06-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多