SVA Temporal Operators

The real power of SVA is in concisely describing timing constraints. This guide covers the essential Delay, Repetition, and Goto operators.

Operator Overview

Operator Name Description
term [*N] Consecutive Repeat Happens N times in a row.
term [->N] Goto Repeat Happens N times (gaps allowed), sequence ends EXACTLY on Nth occurrence.
term [=N] Non-consecutive Happens N times (gaps allowed), sequence can end anytime after.

Detailed Examples

Consecutive Repetition [*]

// "Start signal must be high for exactly 3 clocks"
start [*3]
// Equivalent to: start ##1 start ##1 start

Goto Operator [->]

// "Wait for 'done' to go high. Gaps allowed."
// As soon as 'done' goes high, matched.
req |=> ##1 done[->1]; 

// Often used in handshakes:
req |-> ##1 ack[->1];

Delay Ranges

Variable delays allow flexible checking.

// Grant must come within 1 to 5 cycles
req |-> ##[1:5] grant;

// Unbounded wait (Eventuality)
req |-> ##[1:$] done;
Warning: Use unbounded ranges ($) carefully in simulation as they can hurt performance if never satisfied.

Common Interview Questions

Q: Difference between [=1] and [->1]?
a[->1] (Goto) means the sequence ends *at the very cycle* 'a' occurs. a[=1] (Non-consecutive) means the sequence matches *at or after* 'a' occurs (non-greedy). Use [->1] if you want to trigger the next step immediately.