返回介绍

17.13.4 在过程化代码外部使用并发断言语句

发布于 2020-09-09 22:55:54 字数 1358 浏览 914 评论 0 收藏 0

A concurrent assertion statement can be used outside of a procedural context. It can be used within a module, an interface, or a program. A concurrent assertion statement is an assert, an assume, or a cover statement.Such a concurrent assertion statement uses the always semantics.

The following two forms are equivalent:

assert property ( property_spec ) action_block
always assert property ( property_spec ) action_block ;

Similarly, the following two forms are equivalent:

cover property ( property_spec ) statement_or_null
always cover property ( property_spec ) statement_or_null

For example:

module top(input bit clk);
    logic a,b,c;

    property rule3;
        @(posedge clk) a |-> b ##1 c;
    endproperty

    a1: assert property (rule3);

    ...
endmodule

rule3 is a property declared in module top. The assert statement a1 starts checking the property from the beginning to the end of simulation. The property is always checked. Similarly,

module top(input bit clk);
    logic a,b,c;

    sequence seq3;
        @(posedge clk) b ##1 c;
    endsequence

    c1: cover property (seq3);

    ...
endmodule

The cover statement c1 starts coverage of the sequence seq3 from beginning to the end of simulation. The sequence is always monitored for coverage.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文