SVA Examples Part 2: $stable, $past, disable iff, [*N], [->N], [=N] with Timing Diagrams (Tested)
In short: $stable(x) is true when x has the same value as on the previous clock edge, and $past(x, N) gives the value x had N edges ago. disable iff (rst) cancels any check in progress while reset is high. The repetition operators count: [*3] is 3 edges in a row, [->2] is the 2nd occurrence with the next step right after it, and [=2] is exactly 2 occurrences with idle edges allowed after.
Part 1 covered the basics: ##, |->, |=>, $rose and $fell. This part covers the operators you reach for next: history, stability, reset and counting.
Every operator below has a timing diagram from a real Synopsys VCS run, a passing case and a failing case. Each failure shows the exact VCS line and the reason, edge by edge.
Start here: the simplest example
One handshake rule. While valid waits for ready, data must not change.
// tav_sva2_simple.sv : $stable in one handshake rule (UVM 1.2 reporting only)
// The Art of Verification | theartofverification.com
// Run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 (EDA Playground), 2 Dec 2026.
// EDA Playground: Synopsys VCS, UVM 1.2, top module "tav_top".
`timescale 1ns/1ns
`include "uvm_macros.svh"
module tav_top;
import uvm_pkg::*;
logic clk = 0, valid = 0, ready = 0;
logic [7:0] data = 0;
always #5 clk = ~clk; // rising edges at 5, 15, 25, ...
// While valid waits for ready, data must not change
a_hold: assert property (@(posedge clk) (valid && !ready) |=> $stable(data))
else `uvm_info("TAV_SVA2", $sformatf("a_hold FAILED at %0t: data went %0h -> %0h while waiting",
$time, $past(data), data), UVM_NONE)
initial begin
@(negedge clk) begin valid = 1; data = 8'h10; end // seen at 15: waiting
@(negedge clk); // seen at 25: waiting, data held
@(negedge clk) ready = 1; // seen at 35: handshake
@(negedge clk) begin valid = 0; ready = 0; end // seen at 45: idle
@(negedge clk) begin valid = 1; data = 8'h20; end // seen at 55: waiting
@(negedge clk) data = 8'h21; // seen at 65: data changed while waiting
@(negedge clk) ready = 1; // seen at 75: handshake
@(negedge clk) begin valid = 0; ready = 0; end
@(negedge clk) $finish;
end
endmodule
Here is what VCS printed:
"testbench.sv", 16: tav_top.a_hold: started at 55ns failed at 65ns
Offending '$stable(data)'
UVM_INFO testbench.sv(17) @ 65: reporter [TAV_SVA2] a_hold FAILED at 65: data went 20 -> 21 while waiting
$finish called from file "testbench.sv", line 29.
$finish at simulation time 90
- Why it failed: at 55 ns
validwas 1 andreadywas 0, so|=>promised that data at 65 ns would equal data at 55 ns. - What happened: data went from 20 to 21 at 65 ns.
$stablecompared the two sampled values, saw a change, and VCS printed “started at 55ns failed at 65ns”.
What you will learn
- How
$stableand$pastcompare values across clock edges. - What
disable iffdoes to a check that is already running when reset hits. - The difference between
[*N],[->N]and[=N], shown with one waveform where only one of them fails. - Why each one fails, using six planted bugs and the VCS messages they caused.
Cheat sheet: the six operators
| Operator | Meaning | Fails when | Failed in this post by |
|---|---|---|---|
$stable(x) | x is the same as on the previous edge | x changed since the last edge | +BUG=1 |
$past(x, N) | the value x had N edges ago | (used in a check) x was not what you expected N edges back | +BUG=2 |
disable iff (rst) | cancel the attempt while rst is 1 | missing: checks keep running through reset | +BUG=3 |
b[*3] | b on 3 edges in a row | b is 0 on any of those edges | +BUG=4 |
b[->2] ##1 c | 2nd b (gaps allowed), then c on the very next edge | c is not there right after the 2nd b | +BUG=5, +BUG=6 |
b[=2] ##1 c | exactly 2 b (gaps allowed), idle edges allowed, then c | a 3rd b arrives before c | +BUG=6 |
How to read the diagrams: assertions sample signals on the rising clock edge, marked by the dashed lines. A gold circle is the edge where the trigger is true, a green tick is a pass and a red cross is a fail. Rows in red are the planted-bug versions of a signal.
The bench: one controller, six operators, 7 checks
tav_ctlruns one transaction after eachgo, step by step:validandbusyfor 3 steps,readyon step 3,doneon step 4,beaton steps 2 and 4,laston step 5.tav_ctl_svaholds one assertion and one cover per operator.- Three transactions start at 35, 135 and 235 ns. The test resets in the middle of the second one, at 160 ns.
- Six planted bugs,
+BUG=1to+BUG=6, each break one operator for a real design reason.
Run it yourself: both files are on GitHub, with the expected output for all eight runs.
// tav_sva2_uvm.sv : $stable, $past, disable iff and repetition [*N] [->N] [=N], 7 self-checks (UVM 1.2)
// The Art of Verification | theartofverification.com
// Run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 (EDA Playground), 2 Dec 2026.
// EDA Playground: Synopsys VCS, UVM 1.2, top module "tav_top".
// Paste this whole file into testbench.sv and leave design.sv empty.
//
// The design (tav_ctl): after a go pulse it runs one transaction, step by step (st = 1, 2, 3 ...):
// valid st 1-3, ready st 3, data a5 while valid busy st 1-3, done st 4
// beat st 2 and 4, last st 5
// The test sends 3 transactions (go seen at 35, 135, 235 ns) and resets in the middle of the second.
//
// Run options (each +BUG breaks one operator, for a real design reason):
// (none) all 7 checks pass, 0 errors
// +BUG=1 data changes while valid waits for ready $stable fails (check 1)
// +BUG=2 ready comes one step early $past fails (check 2)
// +BUG=3 a_done loses its disable iff (reset ignored) fails in reset (check 3)
// +BUG=4 busy drops after 2 steps instead of 3 [*3] fails (check 4)
// +BUG=5 last comes 2 steps late [->2] fails, [=2] still passes (check 5)
// +BUG=6 a third beat before last [->2] and [=2] fail (checks 5, 6)
`timescale 1ns/1ns
`include "uvm_macros.svh"
package tav_sva2_pkg;
int tav_fail[string] = '{"hold":0, "past":0, "done":0, "busy":0, "goto":0, "nonc":0};
int tav_hit[string] = '{"hold":0, "past":0, "done":0, "busy":0, "goto":0, "nonc":0};
int tav_go, tav_last;
bit tav_stim_done;
endpackage
// The design
module tav_ctl (input logic clk, rst, go,
output logic valid, ready, busy, done, beat, last, output logic [7:0] data);
int tav_bug, st;
initial void'($value$plusargs("BUG=%d", tav_bug));
always @(posedge clk) begin
if (rst) st <= 0;
else if (go) st <= 1;
else if (st != 0) st <= (st == 8) ? 0 : st + 1;
end
always_comb begin
valid = (st >= 1) && (st <= ((tav_bug == 2) ? 2 : 3)); // BUG=2: ready one step early
ready = (st == ((tav_bug == 2) ? 2 : 3));
data = !valid ? 8'h00 : (tav_bug == 1 && st >= 2) ? 8'ha6 : 8'ha5; // BUG=1: data changes at st 2
busy = (tav_bug == 4) ? (st == 1 || st == 2) : (st >= 1 && st <= 3); // BUG=4: busy too short
done = (st == 4);
beat = (st == 2) || (st == 4) || (tav_bug == 6 && st == 5); // BUG=6: a third beat
last = (tav_bug == 5) ? (st == 7) : (tav_bug == 6) ? (st == 6) : (st == 5); // BUG=5: last late
end
endmodule
// The checker
module tav_ctl_sva (input logic clk, rst, go, valid, ready, busy, done, beat, last, input logic [7:0] data);
import uvm_pkg::*;
import tav_sva2_pkg::*;
int tav_bug;
logic rst_g;
initial void'($value$plusargs("BUG=%d", tav_bug));
assign rst_g = (tav_bug == 3) ? 1'b0 : rst; // BUG=3: a_done no longer sees reset
// 1. $stable: data holds while valid waits for ready
a_hold: assert property (@(posedge clk) disable iff (rst) (valid && !ready) |=> $stable(data))
else begin tav_fail["hold"]++; `uvm_info("TAV_SVA2", $sformatf("a_hold FAILED at %0t: data %0h -> %0h", $time, $past(data), data), UVM_LOW) end
c_hold: cover property (@(posedge clk) disable iff (rst) (valid && !ready) ##1 $stable(data)) tav_hit["hold"]++;
// 2. $past: ready only 3 steps after a go
a_past: assert property (@(posedge clk) disable iff (rst) ready |-> $past(go, 3))
else begin tav_fail["past"]++; `uvm_info("TAV_SVA2", $sformatf("a_past FAILED at %0t: no go 3 edges earlier", $time), UVM_LOW) end
c_past: cover property (@(posedge clk) disable iff (rst) ready && $past(go, 3)) tav_hit["past"]++;
// 3. disable iff: done 4 edges after go, but not while reset is high
a_done: assert property (@(posedge clk) disable iff (rst_g) go |-> ##4 done)
else begin tav_fail["done"]++; `uvm_info("TAV_SVA2", $sformatf("a_done FAILED at %0t", $time), UVM_LOW) end
c_done: cover property (@(posedge clk) disable iff (rst) go ##4 done) tav_hit["done"]++;
// 4. [*3]: busy for 3 edges in a row, then done
a_busy: assert property (@(posedge clk) disable iff (rst) go |=> busy[*3] ##1 done)
else begin tav_fail["busy"]++; `uvm_info("TAV_SVA2", $sformatf("a_busy FAILED at %0t", $time), UVM_LOW) end
c_busy: cover property (@(posedge clk) disable iff (rst) go ##1 busy[*3] ##1 done) tav_hit["busy"]++;
// 5. [->2]: last on the edge right after the 2nd beat
a_goto: assert property (@(posedge clk) disable iff (rst) go |=> beat[->2] ##1 last)
else begin tav_fail["goto"]++; `uvm_info("TAV_SVA2", $sformatf("a_goto FAILED at %0t", $time), UVM_LOW) end
c_goto: cover property (@(posedge clk) disable iff (rst) go ##1 beat[->2] ##1 last) tav_hit["goto"]++;
// 6. [=2]: exactly 2 beats, then last, idle edges allowed in between
a_nonc: assert property (@(posedge clk) disable iff (rst) go |=> beat[=2] ##1 last)
else begin tav_fail["nonc"]++; `uvm_info("TAV_SVA2", $sformatf("a_nonc FAILED at %0t", $time), UVM_LOW) end
c_nonc: cover property (@(posedge clk) disable iff (rst) go ##1 beat[=2] ##1 last) tav_hit["nonc"]++;
// 7. transactions started / completed
always @(posedge clk) if (!rst) begin
if (go) tav_go++;
if (last) tav_last++;
end
endmodule
class tav_sva2_test extends uvm_test;
`uvm_component_utils(tav_sva2_test)
int tav_pass, tav_fail_n;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
task run_phase(uvm_phase phase);
phase.raise_objection(this);
wait (tav_sva2_pkg::tav_stim_done);
phase.drop_objection(this);
endtask
function void tav_check(string what, string got, string exp);
if (got == exp) begin
tav_pass++;
`uvm_info("TAV_SVA2", $sformatf("PASS %s: %s", what, got), UVM_LOW)
end
else begin
tav_fail_n++;
`uvm_error("TAV_SVA2", $sformatf("FAIL %s: got %s, expected %s", what, got, exp))
end
endfunction
function void report_phase(uvm_phase phase);
tav_check("1 $stable (valid && !ready) |=> $stable(data): failures", $sformatf("%0d", tav_sva2_pkg::tav_fail["hold"]), "0");
tav_check("2 $past ready |-> $past(go, 3): failures", $sformatf("%0d", tav_sva2_pkg::tav_fail["past"]), "0");
tav_check("3 disable iff go |-> ##4 done: failures", $sformatf("%0d", tav_sva2_pkg::tav_fail["done"]), "0");
tav_check("4 [*3] go |=> busy[*3] ##1 done: failures", $sformatf("%0d", tav_sva2_pkg::tav_fail["busy"]), "0");
tav_check("5 [->2] go |=> beat[->2] ##1 last: failures", $sformatf("%0d", tav_sva2_pkg::tav_fail["goto"]), "0");
tav_check("6 [=2] go |=> beat[=2] ##1 last: failures", $sformatf("%0d", tav_sva2_pkg::tav_fail["nonc"]), "0");
tav_check("7 transactions started / completed (one cut by reset)",
$sformatf("%0d / %0d", tav_sva2_pkg::tav_go, tav_sva2_pkg::tav_last), "3 / 2");
`uvm_info("TAV_SVA2", $sformatf("cover hits: hold %0d, past %0d, done %0d, busy %0d, goto %0d, nonc %0d",
tav_sva2_pkg::tav_hit["hold"], tav_sva2_pkg::tav_hit["past"], tav_sva2_pkg::tav_hit["done"], tav_sva2_pkg::tav_hit["busy"], tav_sva2_pkg::tav_hit["goto"], tav_sva2_pkg::tav_hit["nonc"]), UVM_NONE)
`uvm_info("TAV_SVA2", $sformatf("Checks: %0d pass, %0d fail", tav_pass, tav_fail_n), UVM_NONE)
endfunction
endclass
module tav_top;
import uvm_pkg::*;
logic clk = 0, rst = 1, go = 0;
logic valid, ready, busy, done, beat, last;
logic [7:0] data;
always #5 clk = ~clk; // rising edges at 5, 15, 25, ...
tav_ctl u_dut (.*);
tav_ctl_sva u_sva (.*);
task tav_go_at(int t); // go seen on the rising edge at t ns
#((t - 5) - $time) go = 1;
#10 go = 0;
endtask
initial begin
#20 rst = 0; // reset for the edges at 5 and 15
tav_go_at(35); // transaction 1
tav_go_at(135); // transaction 2 ...
#20 rst = 1; // ... reset seen at 165 and 175 ns, in the middle of it
#20 rst = 0;
tav_go_at(235); // transaction 3
#100 tav_sva2_pkg::tav_stim_done = 1;
end
initial run_test("tav_sva2_test");
endmodule
How to run it
- Open EDA Playground and pick Synopsys VCS with UVM 1.2.
- Paste the file into
testbench.sv, leavedesign.svempty, and set the top module totav_top. - Run it with no option, then with each of
+BUG=1to+BUG=6.
What VCS returned on the clean run
| # | Operator | Assertion | Failures |
|---|---|---|---|
| 1 | $stable | (valid && !ready) |=> $stable(data) | 0 |
| 2 | $past | ready |-> $past(go, 3) | 0 |
| 3 | disable iff | go |-> ##4 done | 0 |
| 4 | [*3] | go |=> busy[*3] ##1 done | 0 |
| 5 | [->2] | go |=> beat[->2] ##1 last | 0 |
| 6 | [=2] | go |=> beat[=2] ##1 last | 0 |
| 7 | count | transactions started / completed | 3 / 2 |
Result: 7 pass, 0 fail. The covers hit 2 times each (5 for $stable, which has two waiting edges per transaction), because the reset cut transaction 2 short.
UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 1 $stable (valid && !ready) |=> $stable(data): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 2 $past ready |-> $past(go, 3): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 3 disable iff go |-> ##4 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 4 [*3] go |=> busy[*3] ##1 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 5 [->2] go |=> beat[->2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 6 [=2] go |=> beat[=2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 5, past 2, done 2, busy 2, goto 2, nonc 2
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 7 pass, 0 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 12
UVM_WARNING : 0
UVM_ERROR : 0
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 9
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 2 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 5 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 2 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 2 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 2 match
1. $stable: the value did not change
$stable(data) is true when the sampled value of data equals its sampled value on the previous edge. Combined with |=>, it says “on the next edge, data must still be what it is now”.

UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
"testbench.sv", 62: tav_top.u_sva.a_hold: started at 45ns failed at 55ns
Offending '$stable(data)'
UVM_INFO testbench.sv(63) @ 55: reporter [TAV_SVA2] a_hold FAILED at 55: data a5 -> a6
"testbench.sv", 62: tav_top.u_sva.a_hold: started at 145ns failed at 155ns
Offending '$stable(data)'
UVM_INFO testbench.sv(63) @ 155: reporter [TAV_SVA2] a_hold FAILED at 155: data a5 -> a6
"testbench.sv", 62: tav_top.u_sva.a_hold: started at 245ns failed at 255ns
Offending '$stable(data)'
UVM_INFO testbench.sv(63) @ 255: reporter [TAV_SVA2] a_hold FAILED at 255: data a5 -> a6
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 1 $stable (valid && !ready) |=> $stable(data): failures: got 3, expected 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 2 $past ready |-> $past(go, 3): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 3 disable iff go |-> ##4 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 4 [*3] go |=> busy[*3] ##1 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 5 [->2] go |=> beat[->2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 6 [=2] go |=> beat[=2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 2, past 2, done 2, busy 2, goto 2, nonc 2
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 6 pass, 1 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 14
UVM_WARNING : 0
UVM_ERROR : 1
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 12
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 2 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 2 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 2 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 2 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 2 match
- Why it failed: at 45 ns the sender was waiting, so data at 55 ns had to equal data at 45 ns.
+BUG=1switched it from a5 to a6. - Every transaction: 3 failures, at 55, 155 and 255 ns. Transaction 2 failed too, because the reset only came at 160 ns.
2. $past: looking back N edges
$past(go, 3) returns the value go had 3 sampling edges before the current one. Here it checks that ready only comes 3 edges after a go.

UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
"testbench.sv", 67: tav_top.u_sva.a_past: started at 55ns failed at 55ns
Offending '$past(go, 3)'
UVM_INFO testbench.sv(68) @ 55: reporter [TAV_SVA2] a_past FAILED at 55: no go 3 edges earlier
"testbench.sv", 67: tav_top.u_sva.a_past: started at 155ns failed at 155ns
Offending '$past(go, 3)'
UVM_INFO testbench.sv(68) @ 155: reporter [TAV_SVA2] a_past FAILED at 155: no go 3 edges earlier
"testbench.sv", 67: tav_top.u_sva.a_past: started at 255ns failed at 255ns
Offending '$past(go, 3)'
UVM_INFO testbench.sv(68) @ 255: reporter [TAV_SVA2] a_past FAILED at 255: no go 3 edges earlier
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 1 $stable (valid && !ready) |=> $stable(data): failures: 0
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 2 $past ready |-> $past(go, 3): failures: got 3, expected 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 3 disable iff go |-> ##4 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 4 [*3] go |=> busy[*3] ##1 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 5 [->2] go |=> beat[->2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 6 [=2] go |=> beat[=2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 3, past 0, done 2, busy 2, goto 2, nonc 2
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 6 pass, 1 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 14
UVM_WARNING : 0
UVM_ERROR : 1
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 12
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 0 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 3 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 2 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 2 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 2 match
- Why it failed: with
+BUG=2,readycame at 55 ns. Three edges back is 25 ns, wheregowas 0. - How to spot it: “started at 55ns failed at 55ns” means the check failed on its trigger edge.
$pastlooks backwards, so it needs no future edges.
3. disable iff: reset cancels the check
disable iff (rst) means: while rst is 1, cancel every attempt in progress. A cancelled attempt neither passes nor fails.

UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
"testbench.sv", 72: tav_top.u_sva.a_done: started at 135ns failed at 175ns
Offending 'done'
UVM_INFO testbench.sv(73) @ 175: reporter [TAV_SVA2] a_done FAILED at 175
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 1 $stable (valid && !ready) |=> $stable(data): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 2 $past ready |-> $past(go, 3): failures: 0
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 3 disable iff go |-> ##4 done: failures: got 1, expected 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 4 [*3] go |=> busy[*3] ##1 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 5 [->2] go |=> beat[->2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 6 [=2] go |=> beat[=2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 5, past 2, done 2, busy 2, goto 2, nonc 2
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 6 pass, 1 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 12
UVM_WARNING : 0
UVM_ERROR : 1
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 10
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 2 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 5 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 2 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 2 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 2 match
- Why it failed: the attempt at 135 ns expected
doneat 175 ns. The reset at 160 ns cleared the design, sodonenever came. - What disable iff did in the clean run: it cancelled that attempt when
rstrose, so the run had 0 failures.+BUG=3cut that link, and the check failed inside the reset. - Real-world version: a check with no
disable ifffails every time a test resets mid-traffic, which buries real failures under false ones.
4. [*N]: true on N edges in a row
busy[*3] needs busy to be 1 on 3 consecutive edges. Any 0 in that run fails the sequence right away.
![Timing diagram for go |=> busy[*3] ##1 done. go is high at 35 ns. The clean busy is high at 45, 55 and 65 ns and done at 75 ns, so it passes. With +BUG=4 busy is 0 at 65 ns, so the assertion fails at 65 ns. A box explains the failure with the VCS line started at 35ns failed at 65ns](https://theartofverification.com/wp-content/uploads/2026/12/sva2-consecutive-tav.webp)
UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
"testbench.sv", 77: tav_top.u_sva.a_busy: started at 35ns failed at 65ns
Offending 'busy'
UVM_INFO testbench.sv(78) @ 65: reporter [TAV_SVA2] a_busy FAILED at 65
"testbench.sv", 77: tav_top.u_sva.a_busy: started at 235ns failed at 265ns
Offending 'busy'
UVM_INFO testbench.sv(78) @ 265: reporter [TAV_SVA2] a_busy FAILED at 265
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 1 $stable (valid && !ready) |=> $stable(data): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 2 $past ready |-> $past(go, 3): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 3 disable iff go |-> ##4 done: failures: 0
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 4 [*3] go |=> busy[*3] ##1 done: failures: got 2, expected 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 5 [->2] go |=> beat[->2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 6 [=2] go |=> beat[=2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 5, past 2, done 2, busy 0, goto 2, nonc 2
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 6 pass, 1 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 13
UVM_WARNING : 0
UVM_ERROR : 1
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 11
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 2 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 5 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 0 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 2 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 2 match
- Why it failed:
+BUG=4droppedbusyat 65 ns, the third edge of the run, so the check failed there without waiting fordone. - Why 2, not 3: transaction 2 would have failed at 165 ns, but the reset had already cancelled it at 160 ns.
5. [->N] vs [=N]: what may happen after the last occurrence
Both count occurrences with gaps allowed between them. The difference is what comes after the Nth one: [->2] ##1 last needs last on the very next edge, while [=2] ##1 last allows idle edges before last.
![Timing diagram for beat[->2] and beat[=2] followed by last. beat is high at 55 and 75 ns. The clean last at 85 ns passes both. With +BUG=5 last comes at 105 ns: the [->2] check fails at 85 ns, while the [=2] check passes at 105 ns. A box explains why with the VCS line started at 35ns failed at 85ns](https://theartofverification.com/wp-content/uploads/2026/12/sva2-goto-vs-nonc-tav.webp)
UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
"testbench.sv", 82: tav_top.u_sva.a_goto: started at 35ns failed at 85ns
Offending 'last'
UVM_INFO testbench.sv(83) @ 85: reporter [TAV_SVA2] a_goto FAILED at 85
"testbench.sv", 82: tav_top.u_sva.a_goto: started at 235ns failed at 285ns
Offending 'last'
UVM_INFO testbench.sv(83) @ 285: reporter [TAV_SVA2] a_goto FAILED at 285
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 1 $stable (valid && !ready) |=> $stable(data): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 2 $past ready |-> $past(go, 3): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 3 disable iff go |-> ##4 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 4 [*3] go |=> busy[*3] ##1 done: failures: 0
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 5 [->2] go |=> beat[->2] ##1 last: failures: got 2, expected 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 6 [=2] go |=> beat[=2] ##1 last: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 5, past 2, done 2, busy 2, goto 0, nonc 2
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 6 pass, 1 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 13
UVM_WARNING : 0
UVM_ERROR : 1
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 11
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 2 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 5 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 2 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 0 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 2 match
- Why a_goto failed:
[->2]ends exactly on the 2nd beat at 75 ns, solasthad to be there at 85 ns. With+BUG=5it came at 105 ns. - Why a_nonc passed:
[=2]allows idle edges after the 2nd beat. Edges 85 and 95 had no beat, solastat 105 ns still matched, with 0 failures. - Which to use:
[->N]when the next step must follow at once, and[=N]when it only has to come before anything else counts.
6. [=N] fails: exactly N means not N+1
[=2] counts exactly 2. A third occurrence before last makes a match impossible.
![Timing diagram for +BUG=6. beat is high at 55, 75 and 85 ns and last at 95 ns. At 85 ns a third beat arrives while last is still 0, so both the [->2] and [=2] checks fail at 85 ns. A box explains why with the VCS line started at 35ns failed at 85ns](https://theartofverification.com/wp-content/uploads/2026/12/sva2-nonc-fail-tav.webp)
UVM_INFO @ 0: reporter [RNTST] Running test tav_sva2_test...
"testbench.sv", 82: tav_top.u_sva.a_goto: started at 35ns failed at 85ns
Offending 'last'
UVM_INFO testbench.sv(83) @ 85: reporter [TAV_SVA2] a_goto FAILED at 85
"testbench.sv", 87: tav_top.u_sva.a_nonc: started at 35ns failed at 85ns
Offending 'last'
UVM_INFO testbench.sv(88) @ 85: reporter [TAV_SVA2] a_nonc FAILED at 85
"testbench.sv", 82: tav_top.u_sva.a_goto: started at 235ns failed at 285ns
Offending 'last'
UVM_INFO testbench.sv(83) @ 285: reporter [TAV_SVA2] a_goto FAILED at 285
"testbench.sv", 87: tav_top.u_sva.a_nonc: started at 235ns failed at 285ns
Offending 'last'
UVM_INFO testbench.sv(88) @ 285: reporter [TAV_SVA2] a_nonc FAILED at 285
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_objection.svh(1276) @ 340: reporter [TEST_DONE] 'run' phase is ready to proceed to the 'extract' phase
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 1 $stable (valid && !ready) |=> $stable(data): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 2 $past ready |-> $past(go, 3): failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 3 disable iff go |-> ##4 done: failures: 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 4 [*3] go |=> busy[*3] ##1 done: failures: 0
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 5 [->2] go |=> beat[->2] ##1 last: failures: got 2, expected 0
UVM_ERROR testbench.sv(118) @ 340: uvm_test_top [TAV_SVA2] FAIL 6 [=2] go |=> beat[=2] ##1 last: failures: got 2, expected 0
UVM_INFO testbench.sv(114) @ 340: uvm_test_top [TAV_SVA2] PASS 7 transactions started / completed (one cut by reset): 3 / 2
UVM_INFO testbench.sv(131) @ 340: uvm_test_top [TAV_SVA2] cover hits: hold 5, past 2, done 2, busy 2, goto 0, nonc 0
UVM_INFO testbench.sv(133) @ 340: uvm_test_top [TAV_SVA2] Checks: 5 pass, 2 fail
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_report_server.svh(904) @ 340: reporter [UVM/REPORT/SERVER]
--- UVM Report Summary ---
** Report counts by severity
UVM_INFO : 14
UVM_WARNING : 0
UVM_ERROR : 2
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[TAV_SVA2] 13
[TEST_DONE] 1
[UVM/RELNOTES] 1
$finish called from file "/apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_root.svh", line 532.
$finish at simulation time 340
"testbench.sv", 69: tav_top.u_sva.c_past, 34 attempts, 2 match
"testbench.sv", 64: tav_top.u_sva.c_hold, 34 attempts, 5 match
"testbench.sv", 74: tav_top.u_sva.c_done, 34 attempts, 2 match
"testbench.sv", 79: tav_top.u_sva.c_busy, 34 attempts, 2 match
"testbench.sv", 84: tav_top.u_sva.c_goto, 34 attempts, 0 match
"testbench.sv", 89: tav_top.u_sva.c_nonc, 34 attempts, 0 match
- Why a_nonc failed: at 85 ns a 3rd beat arrived while
lastwas still 0. From that edge, “exactly 2 beats, then last” could no longer match. - Why a_goto failed too:
lastwas not there on the edge right after the 2nd beat. - Reading the message: VCS named
'last'as the offending term for both, becauselastwas what each sequence was waiting for when it failed.
All six failing runs at a glance
| Option | Design bug | Failed | VCS line | Reason |
|---|---|---|---|---|
+BUG=1 | data changes while waiting | $stable | started at 45ns failed at 55ns | a5 became a6 before ready |
+BUG=2 | ready one step early | $past | started at 55ns failed at 55ns | go was 0 three edges back |
+BUG=3 | no disable iff | go |-> ##4 done | started at 135ns failed at 175ns | check ran through the reset |
+BUG=4 | busy 2 steps, not 3 | [*3] | started at 35ns failed at 65ns | busy 0 on the 3rd edge |
+BUG=5 | last 2 steps late | [->2] only | started at 35ns failed at 85ns | last not right after the 2nd beat |
+BUG=6 | extra beat | [->2], [=2] | started at 35ns failed at 85ns | a 3rd beat before last |
The lesson: pick the operator that matches the spec sentence exactly. “Must follow at once” is [->N], “exactly N, before the end” is [=N], and any check that spans a reset needs disable iff.
Common mistakes to avoid
| Mistake | What you see | Fix |
|---|---|---|
No disable iff on a check that spans reset | False failures in every reset test (+BUG=3) | Add disable iff (rst) |
[->N] where the spec allows a pause | Fails on legal idle edges (+BUG=5) | Use [=N] |
[=N] where the next step must follow at once | Misses a late response | Use [->N] |
Off-by-one in $past(x, N) | Fails on every transaction (+BUG=2) | Count edges from the checked edge back |
$past in the first N edges | Reads the initial value, not real history | Guard with reset or a start-up delay |
$stable on the trigger edge with |-> | Compares the wrong pair of edges | Use |=> to check the next edge |
How AI helps you master this
- Translate the spec: paste the sentence (“data must hold until ready”) and ask which operator and implication it needs.
- Explain a failure: paste a VCS “started at … failed at …” line with your property and ask which edges were compared.
- Check counting: describe a beat pattern and ask whether
[->N]and[=N]would pass, then confirm on a simulator.
Warning: a convincing AI answer is not the same as a correct engineering result. +BUG=5 shows two very similar operators giving opposite results on one waveform, so run it.
Interview questions on these operators
- What does $stable(x) check? That x has the same sampled value as on the previous clock edge.
- What does $past(x, 3) return? The value x had 3 sampling edges before the current one.
- What happens to a running check when disable iff becomes true? It is cancelled: it neither passes nor fails.
- Difference between [->2] and [=2]? Both allow gaps between occurrences.
[->2]ends on the 2nd occurrence, so the next step must follow at once;[=2]allows idle edges after it. - What does b[*3] mean? b is true on 3 consecutive sampling edges.
More practice: verification interview questions.
Practice challenge
- Run the simple example and match the VCS line to the red cross in its diagram.
- Run the bench with
+BUG=5. Why does only one of the two counting checks fail? - Remove
disable iff (rst)froma_busyand rerun the clean bench. What fails, and when? - Bonus: change
a_pastto$past(go, 2). Which runs fail now?
FAQ
What is the difference between $stable and $past? $stable(x) compares x now with x one edge ago. $past(x, N) just returns the old value, so you can compare it with anything.
Does disable iff make an assertion pass during reset? No: it cancels the attempt, so it is neither a pass nor a fail. In this bench the attempt that spanned the reset simply disappeared.
What is the difference between [*N], [->N] and [=N]? [*N] is N edges in a row, and [->N] is the Nth occurrence with gaps allowed, ending on it. [=N] is exactly N occurrences with gaps allowed, and idle edges allowed after the last one.
Why did VCS name ‘last’ when a third beat arrived? The sequence was waiting for last when it became impossible to match, so that is the term VCS reported.
Can $past look forward? No. To check a future edge, use |=> or ##N from part 1.
References
- IEEE 1800-2023, SystemVerilog standard: clause 16, assertions (sampled value functions, repetition,
disable iff). - Synopsys VCS assertion failure reports, as printed in the runs above.
Keep learning
- The first set of operators: SVA examples, part 1.
- Why assertions pay off: SystemVerilog assertions and their advantages.
- Two kinds of assertion: immediate vs concurrent assertions.
- Attaching checkers to RTL: SVA bind.
- Beyond simulation: formal vs functional verification.
- Coverage that pairs with assertions: functional coverage options.
Part of the learning path Assertions (SVA)
