Goto Repetition, Boolean ( ( - N), ( - N:M) )
Goto Repetition, Boolean ( ( - N), ( - N:M) )
Goto Repetition, Boolean ( ( - N), ( - N:M) )
Guideline:
1) Do not use a first_match function in a sequence that is an antecedent that has a goto
repetition operator unless that sequence has other expressions that are multi-ranged (with a
delay or a repeat). Thus,
a ##1 b[->1] |-> c; // first_match is
not needed here
first_match(a ##1 b[->1]) |-> c; // // first_match not needed
first_match(a[*1:2] ##1 b[->1]) |-> c; // first_match needed
2) Avoid using the goto repetition operator on a first term of an antecedent. That creates
unnecessary computations because every false value of the first term starts a new attempt,
instead of making the assertion vacuous.
a[->1] |-> b; // is equivalent to
!a[*0:$] ##1 a | -> b; // Successful attempt at every clocking event
$rose(a) |-> b; // (Need to evaluate the applicability of the $rose)
3) Avoid consequents that can never fail, and consider rewriting in a style where it can fail.
For example, in the following property statement specification, if a occurs and then b is not
followed by c, then another search for a successful consequent is initiated.
Understanding Sequences 37
4) Qualify consequents with the strong operator if they may never reach success. This may
occur if not enough test cases were exercised. Thus,
$rose(a) |-> strong(b[->1] ##1 c); // will fail if b==1'b0 during the simulation
That property states that if a then, starting from next cycle, there should be two occurrences of b
either consecutive or non-consecutive, and then some time later (i.e., next cycle or later) c occurs.
The following examples satisfy the above property.
cycle 1 2 3 4 5 6 7 8 9 A (a) |=> (b[=2] ##1 c));
a 0 1 - - - - - - -
b - - 0 1 0 0 1 0 0 - path of length k==10 has n==2 repetitions
c - - - - - - - 0 0 1
Note: if after the second occurrence of b a new b occurs (and NO c), the property fails.
However, if after the second occurrence of b, c occurs anytime before a new b, or at the same
time as the last b, then the property succeeds.
Guideline:
1) In an antecedent, DO USE a first_match function in a sequence with a sequence non-
consecutive repetition operator. This guideline is because this operator can cause multiple
threads. For example:
a ##1 b[=1] ##1 c |-> d; // is equivalent
a ##1 !b[*0:$] ##1 b ##1 !b[*0:$] ##1 c |-> d ;
// The (!b[*0:$] ##1 c) can cause multiple threads
first_match($rose(a) ##1 b[=1] ##1 c) |-> d; // (evaluate applicability of $rose)
38 SystemVerilog Assertions Handbook, 4th Edition