SystemVerilog Assertions应用指南 Chapter1.29“ disable iff构造

编程入门 行业动态 更新时间:2024-10-28 22:28:41

SystemVerilog Assertions应用<a href=https://www.elefans.com/category/jswz/34/1769915.html style=指南 Chapter1.29“ disable iff构造"/>

SystemVerilog Assertions应用指南 Chapter1.29“ disable iff构造

        在某些设计情况中,如果一些条件为真,则我们不想执行检验。换句话说,这就像是一个异步的复位,使得检验在当前时刻不工作。SVA提供了关键词“ disable iff来实现这种检验器的异步复位。“ disable iff”的基本语法如下。

disable iff (expression) <property definition>

        属性p34检查在有效开始后,信号“a”重复两次,且1个周期之后,信号“b”重复两次,再过一个时钟周期,信号“ start”为低。在整个序列过程中,如果“ reset”被检测为高,检验器会停止并默认地发出一个空成功的信号。

module disableiff;logic clk, reset, start;
logic a,b,c;initial $vcdpluson();initial
begin
clk=1'b0; reset=1'b0; start = 1'b0;
repeat(2) @(posedge clk);
reset = 1'b1; a=1'b0; b=1'b0; c=1'b0;
repeat(2) @(posedge clk) reset = 1'b0; start = 1'b1; @(posedge clk) a=1'b1;
@(posedge clk) a=1'b0;
repeat(2) @(posedge clk);
@(posedge clk) a=1'b1;
@(posedge clk) a=1'b0;
repeat(2) @(posedge clk);
@(posedge clk) b=1'b1;
@(posedge clk) b=1'b0;
repeat(2) @(posedge clk);
@(posedge clk) b=1'b1;
@(posedge clk) b=1'b0;
repeat(1) @(posedge clk);
start = 1'b0;
repeat(2) @(posedge clk);start = 1'b1;@(posedge clk) a=1'b1;
@(posedge clk) a=1'b0;
repeat(2) @(posedge clk);
@(posedge clk) a=1'b1;
@(posedge clk) a=1'b0;
repeat(2) @(posedge clk);
@(posedge clk) b=1'b1; reset = 1'b1;
@(posedge clk) b=1'b0;
repeat(2) @(posedge clk);
@(posedge clk) b=1'b1;
@(posedge clk) b=1'b0;
repeat(1) @(posedge clk);
start = 1'b0;
repeat(2) @(posedge clk);$finish();
endproperty p34;@(posedge clk) disable iff (reset) $rose(start) |=> a[=2] ##1 b[=2] ##1 !start ;
endpropertya34: assert property(p34);initial forever clk = #25 ~clk;endmodule

        图1-36显示了属性p34在模拟中的响应。标记1标出了一个有效的开始,在有效开始后,信号“a”重复为高两次,接着信号“b”重复为高两次,然后信号“ start”如期望的为低。
        在整个序列的过程中,信号“ reset”如期望的始终不被激活,因此检验在标记1e处成功。第二个有效开始由标记2s标出。在有效开始后,信号“a”重复为高两次,接着复位信号“reet”在信号“b”重复两次之前被激活。这使得检查失效,属性得到一个空成功。

更多推荐

SystemVerilog Assertions应用指南 Chapter1.29“ disable iff构造

本文发布于:2023-12-07 02:52:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1669854.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指南   Assertions   SystemVerilog   iff   disable

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!