SVA Sequences II – Repetition Operators

There are three different kinds of repetition operators available in SVA viz., consecutive, non-consecutive and goto. For all three operators the number of iterations can be either specified by an exact count or by a finite range. If the number of repetitions is specified by an exact count [*n], then ‘n’ has to be a non-negative integer constant expression.

Sequence repetition syntax

Consecutive repetition operator [*const_or_range_expression]

Consecutive repetition specifies finitely, many iterative matches of the operand sequence with a delay of one clock tick from the end of one match to the beginning of the next. The overall repetition sequence matches at the end of the last iterative match of the operand.

A consecutive repetition specifies that the operand sequence shall match a specified number of times. In the above example, consecutive repetition operator [*4] specifies that the operand sequence must match 4 times in succession.

empty sequence

If 0 is used as repetition number, the sequence will be empty. An empty sequence is one that matches over zero clock ticks and does not match over any positive number of clock ticks.

Non-consecutive repetition operator [=const_or_range_expression]

Non-consecutive repetition specifies finitely, many iterative matches of the operand Boolean expression. There is a delay of one or more clock ticks from one match of the operand to the next successive match and no match of the operand strictly in between.

The overall repetition sequence matches at or after the last iterative match of the operand, but before any later match of the operand.

If x is true in the first clock tick and z in the last clock tick, then there are at least 3 and at most 10 non-consecutive clock ticks in between x and z.

Goto repetition operator [->const_or_range_expression]

Goto repetition specifies finitely, many iterative matches of the operand Boolean expression. There is a delay of one or more clock ticks from one match of the operand to the next successive match and no match of the operand strictly in between.

The overall repetition sequence matches at the last iterative match of the operand. The goto repetition takes a Boolean expression rather than a sequence as operand.

Consecutive repetition operator

seq_rep1

Non-consecutive repetition operator

seq_rep2

Goto repetition operator

seq_rep3

Legend
seq_rep4

The non-consecutive repetition is like the goto repetition except that a match does not have to end at the last iterative match of the operand Boolean expression.

Note: [*] is an equivalent representation of [*0:$] and [+] is an equivalent representation of [*1:$].

The consecutive repetition operator can be applied to general sequence expressions, but the goto repetition and non-consecutive repetition operators can be applied only to Boolean expressions.

Other operator types are discussed in the next article in the series.

3 Comments

  1. ab

    sequence seq1
    x ##2 y [=3:10] ##1 z
    endseuquence

    If x is true in the first clock tick and z in the last clock tick, then there are at least 3 and at most 10 non-consecutive clock ticks in between x and z.


    I think above statement is not correct, it should be

    If x is true in the first clock tick and z in the last clock tick, then there are at least 5 and at most 12 non-consecutive clock ticks in between x and z.

Leave a Reply

Your email address will not be published. Required fields are marked *