I am writing an assertion and the idea is that i have a signal called PADDR which needs to be stable (not change) from the moment that it changes until the moment a signal PREADY transitions from 0 to 1. This is some code that i tried but the assertion never passes nor it fails. If anybody has some suggestions I would be very grateful.
I forgot to explain that a master is driving the PADDR line and a slave is driving the PREADY line. When a transition occurs on the PADDR line, this triggers the slave to do some work and after a random number of PCLKs (bigger than 1) the slave gives a PREADY signal that lasts only one PCLK. So I need to check that the PADDR line is stable throughout the interval of time that beggins when a PADDR transition occurs until the PREADY signal becomes one, the whole time.
Here’s a URL to an image which demonstrates a cycle.
So if I understood you well, I have mistakenly written an assertion that just checks if PADDR is stable only when PREADY arrives (becomes 1) but not throughout the whole cycle?
The assertions I rewrote are correc. A couple of comments:
property stable_paddr;
@(posedge PCLK)
disable iff (!PRESETn)
$changed(PADDR) |=>
strong(first_match($stable(PADDR) [*1:$] ##1 $rose(PREADY)) ##0 $stable(PADDR));
endproperty
// The following is of the form
(first_match(a[*1:$] ##1 b) ##0 c).
// In your case, the c"c" is the "a", thus you don't need the first_match() because
// if b==1 and a==0, the assertion will fail at the next cycle because of the a[*1:$]
// However, I like to keep it clean and use the first_match()
// Another observation from the diagram is that you can also write as
property stable_paddr;
@(posedge PCLK)
disable iff (!PRESETn)
$changed(PADDR) |=>
strong($stable(PADDR) [*1:$] ##0 $rose(PREADY));
endproperty
// The following is also OK, though the s_until_with requires some mental
// evaluation as to its meaning
property stable_paddr2; //
@(posedge PCLK)
disable iff (!PRESETn)
$changed(PADDR) |=>
$stable(PADDR) s_until_with $rose(PREADY);
// I was mistaken on the ##0 $stable(PADDR) in my prior answer since the
// s_until_with requires that $stable(PADDR)==1 when $rose(PREADY)==1
endproperty
You stated that the assertion never passes nor it fails. Actually the assertion should fail if PADDR is changed and no Pready. It should also pass since the sequence is in the consequent and the search is for a pass. If $stable(PADDR) is ever equal to 0, there is no need for further searches because of the repeat. stable(PADDR) [*1:] requires no drop in $stable(PADDR). It is not like the range delay.
a |=> ##[1:$] b;
// can never fail because if b==0, there is a search for another ##1 b after b==0.
// Assertion can pass though at the first occurrence of b