So I am trying to add a couple of assertions to my interface.
In the first one, I am checking for a value in the consequent of the assertion.
always @(posedge clk, negedge rst) begin
if(~rst || ~signal_a) count <= 0;
else if(signal_a) <= count = count + 1;
end
property Check_Count;
@(posedge clk)
signal_a |-> ##[1:$] ~signal_a ##0 (count == 5);
endproperty
In the second one, I am using a local variable to perform the check,
property Check_Count;
time t1, t2;
@(posed clk)
(signal_a, t1=$time) |-> ##[1:$] (~signal_a, t2=$time-t1) ##0 (t2 > 6us);
endproperty
Now both the assertions are triggered but the consequent never completes.
Can someone help figure out the problem here?
ben2
May 1, 2019, 6:13am
2
In reply to cool_toad :
With **signal_a |-> ##[1:] ~signal_a ##0 (count == 5);**
If @count==3 signal_a==0, then that tread will fail, but there are other threads to test as a result of the ##[1: ].
However, from your always block, the count gets reset.
What you are trying to specify is most likely the following:
in the consequent, whenever signal_a==0 then in the same cycle count==5 to do that you would need a first_match()
You could also use the goto
property Check_Count;
@(posedge clk)
signal_a |-> first_match(##[1:$] ~signal_a) ##0 (count == 5);
// signal_a |-> ~signal_a[->1] ##0 (count == 5);
endproperty
property Check_Count;
realtime t1, t2; // Use realtime instead of time
@(posed clk)
(signal_a, t1=$realtime) |->
first_match(##[1:$] (~signal_a, t2=$realtime-t1)) ##0 (t2 > 6us);
// ~signal_a[->1] ##0 (1, t2=$realtime-t1) ##0 (t2 > 6us);
endproperty
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr
SVA Alternative for Complex Assertions
Verification Horizons - March 2018 Issue | Verification Academy
SVA: Package for dynamic and range delays and repeats | Verification Academy
SVA in a UVM Class-based Environment
SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy
That worked! Thanks for your help