1

可以说有一个信号a。当信号变高时,它必须至少在三个正时钟沿保持高电平。

我们可以将属性写为

property p;
@(posedge clk) $rose(a) -> a[*3];
endproperty

对于以下情况,该属性失败。

时钟_ _ _ | = = = | _ _ _ | = = = | _ _ _ | = = = | _ _ _ | = = = |

一个_ _ | = = = | _ _ | = = = = = = = = = = = = = = = = = =

这不符合规范,其中 a 在中间变低,但会被下一个姿势拉高,因此上述断言不会抓住这一点。

谁能告诉是否有任何方法可以编写断言来捕获这个错误?

谢谢

4

2 回答 2

0

你在这里混淆了东西。通过在信号上编写时钟断言,a您正在验证它是具有特定行为的同步信号。

同步信号可以在时钟边沿之间产生所有它们想要的毛刺,因为它们永远不会在那里被采样。这正是我们现在使用同步信号的原因,即让信号有机会在我们对其进行采样之前稳定到它的值。

如果您的信号a不应该由于某种原因出现故障(我不是设计师,所以我不知道这会在哪里有用),据我所知,您会使用某种 linting 工具来发现这一点(例如 Spyglass)对 HDL 代码进行结构分析。

于 2015-02-08T09:00:53.110 回答
0

Tudor 是的,在大多数情况下,时钟边沿之间发生的事情并不重要。但在 CDC 或异步设计中,我们必须验证设计是否无故障。有一种由内而外的方法可以做到这一点。(我在http://www.verificationguild.com/modules.php?name=Forums&file=viewtopic&p=20045找到了这个解决方案)

property detect_glitch;
    time leading;                  // declare the last edge occurence variable
    @(glitch)                      // At every change of glitch signal
        //The following line saves the current time and check
        // the delay from the previous edge.
        (1, leading = $time) |=> (($time - leading) >= duration);
endproperty : detect_glitch

DETECT_GLITCH : assert property (detect_glitch)
else
    $display ("ERROR"); 
于 2015-10-27T19:48:33.677 回答