Immediate vs Concurrent Assertions in SystemVerilog, Tested on One Small Design
In short: An immediate assertion checks a condition the moment procedural code reaches it, with the values signals have right then. A concurrent assertion is clocked: it samples signals just before a clock edge and can check a pattern across several cycles, like “ack within 3 clocks of req”. Use immediate for a single yes/no on current values, deferred immediate (assert final) when combinational glitches would cause false failures, and concurrent for anything about time.
Both kinds of assertion answer a different question. An immediate one asks “is this true right now?” A concurrent one asks “does this pattern hold across clock edges?”
In this guide I put all three kinds on one small design and break it on purpose. You’ll see exactly what Synopsys VCS printed each time, including the glitch that fools a plain immediate assertion and not a deferred one.
What you’ll learn:
- When an immediate assertion is judged, and when a concurrent one is
- Why a plain immediate assertion can fail on a glitch, and how
assert finalfixes it - How a concurrent assertion reports a timing failure, and at which clock
- That a concurrent assertion inside an always block is legal, and what it means
- Which one to reach for, with a side-by-side table
A simple way to picture it
Think of a security guard at a door. An immediate assertion is the guard glancing at your badge the moment you walk up: pass or fail on the spot.
A concurrent assertion is the guard watching a rule that plays out over time, like “after you swipe in, you must swipe out within three checkpoints”. That rule can’t be judged in one glance. The guard has to watch several moments in order.
Immediate assertions
An immediate assertion lives inside procedural code: always_comb, always_ff, initial, a task or a function. It’s judged when execution reaches it, with the values variables have at that moment. There’s no clock and no sampling, so it behaves like an if that reports a failure.
always_comb begin
if (rst_n)
a_onehot: assert ($onehot(state))
else begin
n_onehot++;
$error("a_onehot: state=%b is not one-hot", state);
end
end
From tav_sva_imm_conc.sv, lines 89 to 96.
The label a_onehot shows up in the log, so always name your assertions. The else part is the action block that runs on failure. Bug 1 below shows what VCS prints when the state machine stops being one-hot.
Plain vs deferred immediate assertions
A plain immediate assertion runs every time its block wakes up, even halfway through a time step while combinational values are still settling. So it can fail on a glitch that’s gone a moment later.
Deferred immediate assertions fix that. IEEE 1800 has two forms:
| Form | Written as | When it’s judged |
|---|---|---|
| Observed deferred | assert #0 (expr) |
In the Observed region of the time step, after the design has settled |
| Final deferred | assert final (expr) |
In the Postponed region, at the very end of the time step |
If the block wakes up again in the same time step, a pending deferred check is thrown away and rescheduled. Only the last, settled evaluation can report.
To show the difference, the bench has a signal chain_c that follows chain_a through a nonblocking assignment. Whenever chain_a changes, the two differ for part of that time step, until the nonblocking update lands. The bench checks them three ways:
logic chain_a = 0, chain_c = 0;
always @(chain_a) chain_c <= chain_a;
always_comb begin
if (rst_n)
a_chain_plain: assert (chain_c == chain_a)
else begin
n_plain++;
$error("a_chain_plain: chain_a=%b chain_c=%b (mid-update)", chain_a, chain_c);
end
end
// Observed deferred (#0): judged once values settle. Its action must be a
// single subroutine call, so the counter lives in a function.
function automatic void tav_obs_fail(logic a, logic c);
n_obs++;
$error("a_chain_obs: chain_a=%b chain_c=%b", a, c);
endfunction
always_comb begin
if (rst_n)
a_chain_obs: assert #0 (chain_c == chain_a)
else tav_obs_fail(chain_a, chain_c);
end
// Final deferred: judged at the very end of the time step. Nothing may
// change value there, so its action can only report.
always_comb begin
if (rst_n)
a_chain_final: assert final (chain_c == chain_a)
else $error("a_chain_final: chain_a=%b chain_c=%b", chain_a, chain_c);
end
From tav_sva_imm_conc.sv, lines 101 to 132.
Two rules shape the deferred checks. First, a deferred assertion’s action block must be a single subroutine call, so n_obs++ lives in a function. The slang compiler rejected my first draft for using a begin ... end block there: “deferred assertion action must be a subroutine call”.
Second, assert final is judged in the Postponed region, where nothing may change value any more. My first version of a_chain_final called a function that did a counter ++, and VCS refused to compile it:
Error-[SVAVCF] Value change in final deferred assertion
testbench.sv, 119
"assert final((chain_c == chain_a)) else tav_final_fail(chain_a, chain_c);"
No new value changes are allowed to happen in the current time slot once the
Postponed region is reached.
So a_chain_final only reports with $error, and the observed deferred check a_chain_obs keeps the counter. The +GLITCH run below toggles chain_a three times and shows what each of the three checks reports.
Concurrent assertions
A concurrent assertion is clocked. On each clock edge it samples its signals with the values they had just before the edge (the Preponed region), then evaluates a property that can span many cycles.
a_req_ack: assert property (@(posedge clk) disable iff (!rst_n)
$rose(req) |-> ##[1:3] ack)
else begin
n_req_ack++;
$error("a_req_ack: no ack within 3 clocks of req");
end
From tav_sva_imm_conc.sv, lines 135 to 140.
Read it left to right: on each rising clock edge, if req has just risen, then ack must be high on one of the next 1 to 3 edges. |-> checks the consequent starting on the same edge; |=> would start one edge later. disable iff (!rst_n) switches the check off during reset.
Because it uses sampled values, the assertion can look one step behind your waveform. At an edge where your RTL just changed a signal, the assertion still sees the old value. That’s by design: it’s what makes the result independent of the order processes run in.
A concurrent assertion inside an always block is legal
Many guides say assert property must never go inside an always block. That’s not true. IEEE 1800-2017 section 16.14.6 defines procedural concurrent assertions: the clock is taken from the block’s event control, and the if around it becomes an enabling condition.
always @(posedge clk) begin
if (rst_n && state == 3'b100)
a_done_ack: assert property (ack)
else begin
n_done_ack++;
$error("a_done_ack: state is DONE but ack is low");
end
end
From tav_sva_imm_conc.sv, lines 144 to 151.
This checks “whenever the state is DONE, ack is high”, clocked by posedge clk. Not every tool supports it: Verilator 5.020 refuses it with “Unsupported: Procedural concurrent assertion with clocking event inside always (IEEE 1800-2017 16.14.6)”. VCS ran it, as you’ll see in Bug 3.
Side by side
| Immediate | Deferred immediate | Concurrent | |
|---|---|---|---|
| Written as | assert (expr) |
assert #0 (expr) or assert final (expr) |
assert property (@(posedge clk) ...) |
| Where it lives | Procedural code | Procedural code | Module, interface, program, or procedural code with a clock |
| When it’s judged | The moment it runs | Later in the same time step, once values settle | On a clock edge |
| Values it uses | Current values | Settled values | Values sampled just before the edge |
| Spans cycles? | No | No | Yes |
| Action block | Any statements | One subroutine call (for final, one that changes no value) | Any statements |
| Glitch-safe? | No | Yes | Yes |
| Good for | A one-off check in a function or task | Checks on combinational logic | Protocols, handshakes, timing rules |
Which one to use
Use an immediate assertion for a single yes/no on current values inside a task or function, like a legal enum value or a non-null handle.
Use assert final (or assert #0) for checks on combinational logic, so a glitch in the middle of a time step doesn’t stop your test.
Use a concurrent assertion whenever the rule mentions “next cycle”, “within N cycles”, a handshake, or any order of events over time.
The bench: one file, five runs
The bench is one file, tav_sva_imm_conc.sv (download it as a zip, 2 KB). It’s a small request/acknowledge block with a one-hot state machine, plus the six checks above. No UVM needed.
| Run option | What changes | Check that should catch it |
|---|---|---|
| (none) | Clean design | None, every check passes |
+GLITCH |
chain_a toggles three times after the requests |
a_chain_plain, but not a_chain_obs or a_chain_final |
+BUG=1 |
BUSY is encoded as 011 instead of 010 |
a_onehot |
+BUG=2 |
ack comes 3 clocks later than normal |
a_req_ack |
+BUG=3 |
The DONE state never raises ack |
a_req_ack and a_done_ack |
The full code: tav_sva_imm_conc.sv
This is the exact file that runs on VCS: 188 lines. Paste it into testbench.sv on EDA Playground, leave design.sv empty, choose Synopsys VCS, and add a run option from the table above.
// tav_sva_imm_conc.sv : immediate, deferred and concurrent assertions on one small design.
// The Art of Verification (theartofverification.com)
//
// Paste into testbench.sv on EDA Playground, leave design.sv empty. Top module: tav_top.
// No UVM needed.
//
// Design: a request/acknowledge block with a one-hot state machine.
// IDLE (001) -> BUSY (010) -> DONE (100) -> IDLE. ack is high in DONE.
// A request is acknowledged 2 clocks after it rises.
//
// The checks:
// a_onehot immediate assertion in always_comb: state is always one-hot
// a_chain_plain immediate assertion on a signal that briefly lags its source
// a_chain_obs observed deferred (#0) immediate assertion on the same pair
// a_chain_final final deferred immediate assertion on the same pair
// (it can only report, so it's counted from the log, not the summary)
// a_req_ack concurrent assertion: ack within 1 to 3 clocks of a rising req
// a_done_ack concurrent assertion written inside an always block
//
// Run options:
// (none) clean run, every check passes
// +GLITCH wiggles the chain input: shows the plain immediate check firing
// on a glitch that the two deferred checks ignore
// +BUG=1 BUSY state encoded as 011 for one clock -> a_onehot fails
// +BUG=2 ack comes 3 clocks late -> a_req_ack fails
// +BUG=3 DONE state never raises ack -> a_req_ack and a_done_ack fail
`timescale 1ns/1ps
module tav_hs_dut (
input logic clk,
input logic rst_n,
input logic req,
input int bug,
output logic ack,
output logic [2:0] state
);
localparam logic [2:0] IDLE = 3'b001, BUSY = 3'b010, DONE = 3'b100;
logic req_q;
int unsigned wait_cnt;
always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
state <= IDLE;
req_q <= 1'b0;
wait_cnt <= 0;
end
else begin
req_q <= req;
case (state)
IDLE: if (req && !req_q) begin
state <= (bug == 1) ? 3'b011 : BUSY; // BUG 1: two bits set
wait_cnt <= (bug == 2) ? 3 : 0; // BUG 2: extra wait
end
3'b011,
BUSY: if (wait_cnt != 0) wait_cnt <= wait_cnt - 1;
else state <= DONE;
DONE: state <= IDLE;
default: state <= IDLE;
endcase
end
end
assign ack = (state == DONE) && (bug != 3); // BUG 3: ack never rises
endmodule
module tav_top;
logic clk = 0;
logic rst_n = 0;
logic req = 0;
logic ack;
logic [2:0] state;
int bug;
bit glitch;
int unsigned n_onehot, n_plain, n_obs, n_req_ack, n_done_ack, n_reqs;
always #5 clk = ~clk;
initial begin
if (!$value$plusargs("BUG=%d", bug)) bug = 0;
glitch = $test$plusargs("GLITCH");
end
tav_hs_dut dut (.clk(clk), .rst_n(rst_n), .req(req), .bug(bug), .ack(ack), .state(state));
// ---------------------------------------------------------------- immediate
// Checked every time state changes, with the value it has right now.
always_comb begin
if (rst_n)
a_onehot: assert ($onehot(state))
else begin
n_onehot++;
$error("a_onehot: state=%b is not one-hot", state);
end
end
// ------------------------------------------ plain vs deferred (#0 and final)
// chain_c follows chain_a with a nonblocking assignment, so for part of
// each time step where chain_a changes, the two briefly differ.
logic chain_a = 0, chain_c = 0;
always @(chain_a) chain_c <= chain_a;
always_comb begin
if (rst_n)
a_chain_plain: assert (chain_c == chain_a)
else begin
n_plain++;
$error("a_chain_plain: chain_a=%b chain_c=%b (mid-update)", chain_a, chain_c);
end
end
// Observed deferred (#0): judged once values settle. Its action must be a
// single subroutine call, so the counter lives in a function.
function automatic void tav_obs_fail(logic a, logic c);
n_obs++;
$error("a_chain_obs: chain_a=%b chain_c=%b", a, c);
endfunction
always_comb begin
if (rst_n)
a_chain_obs: assert #0 (chain_c == chain_a)
else tav_obs_fail(chain_a, chain_c);
end
// Final deferred: judged at the very end of the time step. Nothing may
// change value there, so its action can only report.
always_comb begin
if (rst_n)
a_chain_final: assert final (chain_c == chain_a)
else $error("a_chain_final: chain_a=%b chain_c=%b", chain_a, chain_c);
end
// --------------------------------------------------------------- concurrent
a_req_ack: assert property (@(posedge clk) disable iff (!rst_n)
$rose(req) |-> ##[1:3] ack)
else begin
n_req_ack++;
$error("a_req_ack: no ack within 3 clocks of req");
end
// A concurrent assertion inside an always block (legal: the clock and the
// if condition are taken from the block).
always @(posedge clk) begin
if (rst_n && state == 3'b100)
a_done_ack: assert property (ack)
else begin
n_done_ack++;
$error("a_done_ack: state is DONE but ack is low");
end
end
// ----------------------------------------------------------------- stimulus
task automatic send_req();
int unsigned t;
@(posedge clk) req <= 1'b1;
n_reqs++;
t = 0;
while (!ack && t < 8) begin @(posedge clk); t++; end
@(posedge clk) req <= 1'b0;
repeat (2) @(posedge clk);
endtask
initial begin
repeat (2) @(posedge clk);
rst_n <= 1'b1;
repeat (2) @(posedge clk);
repeat (5) send_req();
if (glitch)
repeat (3) begin
@(negedge clk) chain_a = ~chain_a;
end
repeat (6) @(posedge clk);
$display("--- tav_sva_imm_conc summary (BUG=%0d, GLITCH=%0d) ---", bug, glitch);
$display("requests sent : %0d", n_reqs);
$display("a_onehot fails : %0d", n_onehot);
$display("a_chain_plain fails : %0d", n_plain);
$display("a_chain_obs fails : %0d", n_obs);
$display("a_req_ack fails : %0d", n_req_ack);
$display("a_done_ack fails : %0d", n_done_ack);
if (n_onehot + n_plain + n_obs + n_req_ack + n_done_ack == 0)
$display("*** TEST PASSED ***");
else
$display("*** TEST FAILED ***");
$finish;
end
endmodule
What VCS printed
Run on Synopsys VCS on EDA Playground, 27 Nov 2026. Each block is copied from the log; “…” marks lines I cut. Times are in picoseconds (the file uses timescale 1ns/1ps), so 55000ps is 55 ns. For every failure VCS prints its own report first (“started at … failed at …” and the offending expression), then the $error line from the action block.
Clean run:
--- tav_sva_imm_conc summary (BUG=0, GLITCH=0) ---
requests sent : 5
a_onehot fails : 0
a_chain_plain fails : 0
a_chain_obs fails : 0
a_req_ack fails : 0
a_done_ack fails : 0
*** TEST PASSED ***
$finish called from file "testbench.sv", line 186.
Five requests, five acks, every check quiet.
+GLITCH:
"testbench.sv", 106: tav_top.a_chain_plain: started at 390000ps failed at 390000ps
Offending '(chain_c == chain_a)'
Error: "testbench.sv", 106: tav_top.a_chain_plain: at time 390000 ps
a_chain_plain: chain_a=1 chain_c=0 (mid-update)
"testbench.sv", 106: tav_top.a_chain_plain: started at 400000ps failed at 400000ps
Offending '(chain_c == chain_a)'
Error: "testbench.sv", 106: tav_top.a_chain_plain: at time 400000 ps
a_chain_plain: chain_a=0 chain_c=1 (mid-update)
"testbench.sv", 106: tav_top.a_chain_plain: started at 410000ps failed at 410000ps
Offending '(chain_c == chain_a)'
Error: "testbench.sv", 106: tav_top.a_chain_plain: at time 410000 ps
a_chain_plain: chain_a=1 chain_c=0 (mid-update)
--- tav_sva_imm_conc summary (BUG=0, GLITCH=1) ---
requests sent : 5
a_onehot fails : 0
a_chain_plain fails : 3
a_chain_obs fails : 0
a_req_ack fails : 0
a_done_ack fails : 0
*** TEST FAILED ***
The plain check failed three times, at 390, 400 and 410 ns: each the instant chain_a flipped, before chain_c caught up. The two deferred checks said nothing, because by the time they’re judged the values agree. There’s no a_chain_final line anywhere in the log.
Notice “started at 390000ps failed at 390000ps”. An immediate assertion starts and finishes at one point in time; compare that with the concurrent failures below.
+BUG=1, state not one-hot:
"testbench.sv", 91: tav_top.a_onehot: started at 55000ps failed at 55000ps
Offending '$onehot(state)'
Error: "testbench.sv", 91: tav_top.a_onehot: at time 55000 ps
a_onehot: state=011 is not one-hot
... the same failure at 125000, 195000, 265000 and 335000 ps ...
--- tav_sva_imm_conc summary (BUG=1, GLITCH=0) ---
requests sent : 5
a_onehot fails : 5
a_chain_plain fails : 0
a_chain_obs fails : 0
a_req_ack fails : 0
a_done_ack fails : 0
*** TEST FAILED ***
One failure per request, at the moment the machine left IDLE in the bad 011 state. The ack timing was still fine, so the concurrent checks passed: only the immediate check could see this bug.
+BUG=2, ack 3 clocks late:
"testbench.sv", 135: tav_top.a_req_ack: started at 55000ps failed at 85000ps
Offending 'ack'
Error: "testbench.sv", 135: tav_top.a_req_ack: at time 85000 ps
a_req_ack: no ack within 3 clocks of req
... the same failure for the other 4 requests, ending at 485000 ps ...
--- tav_sva_imm_conc summary (BUG=2, GLITCH=0) ---
requests sent : 5
a_onehot fails : 0
a_chain_plain fails : 0
a_chain_obs fails : 0
a_req_ack fails : 5
a_done_ack fails : 0
*** TEST FAILED ***
Here’s the timing difference in one line: “started at 55000ps failed at 85000ps”. The attempt started on the clock where req rose, and failed 30 ns (3 clocks) later, when the ##[1:3] window closed. When you debug a concurrent failure, look at the start time first: that’s the clock where the problem began.
+BUG=3, ack never rises:
"testbench.sv", 146: tav_top.a_done_ack: started at 75000ps failed at 75000ps
Offending 'ack'
Error: "testbench.sv", 146: tav_top.a_done_ack: at time 75000 ps
a_done_ack: state is DONE but ack is low
"testbench.sv", 135: tav_top.a_req_ack: started at 55000ps failed at 85000ps
Offending 'ack'
Error: "testbench.sv", 135: tav_top.a_req_ack: at time 85000 ps
a_req_ack: no ack within 3 clocks of req
... the same pair for the other 4 requests ...
--- tav_sva_imm_conc summary (BUG=3, GLITCH=0) ---
requests sent : 5
a_onehot fails : 0
a_chain_plain fails : 0
a_chain_obs fails : 0
a_req_ack fails : 5
a_done_ack fails : 5
*** TEST FAILED ***
Both concurrent checks caught it, but not at the same time. a_done_ack, the one inside the always block, failed at 75 ns, on the exact clock where the state was DONE and ack was low. a_req_ack only failed at 85 ns, when its window ran out. The more specific check points straight at the cycle; the general one only tells you time ran out.
Common mistakes (and the fix for each)
- A plain immediate assertion on logic that settles during the time step. It can fail mid-update on a value that’s gone a moment later, exactly like
a_chain_plainin the+GLITCHrun. Fix: useassert #0orassert final. - A
begin ... endblock as a deferred assertion’s action. The standard allows only one subroutine call there. Fix: move the statements into a function and call it. - Changing a value from an
assert finalaction. VCS stops at compile time withError-[SVAVCF] Value change in final deferred assertion. Fix: only report fromassert final, or useassert #0when the action must update a counter. - Expecting a concurrent assertion to see the value at the edge. It uses the value sampled just before the edge. Fix: read the waveform one step back, or print
$sampled()when you debug. - Mixing up
|->and|=>.|=>starts checking one clock later, so|=> ##[1:3]really means 2 to 4 clocks. Fix: write the delay you mean with|->and say it out loud. - No
disable iffon reset. The assertion fires while the design is held in reset. Fix: adddisable iff (!rst_n). - Unlabelled assertions. The log shows a file and line, but no name to search for. Fix: label every assertion, like
a_req_ack.
Where AI helps, and where it doesn’t
An AI assistant is good at turning a spec sentence into a first property, like “ack within 3 clocks of req” into $rose(req) |-> ##[1:3] ack. It’s also quick at explaining an unfamiliar operator.
It’s less reliable on the details that decide whether a check is right: an off-by-one between |-> and |=>, or the rule that a deferred assertion’s action must be a single call. Treat its property as a draft. Plant a bug the property should catch, like the five in this bench, and only trust it once you’ve seen it fail.
Practice challenge
Add a sixth check to tav_sva_imm_conc.sv: ack must never be high unless a request came in during the last 3 clocks. Then add +BUG=4, where the design raises ack once with no request, and confirm only your new check fires.
Second part: rewrite a_req_ack with |=> instead of |->, keeping exactly the same meaning. Run +BUG=2 again. Does it still fail at the same clock?
FAQ
What is the difference between immediate and concurrent assertions? An immediate assertion checks a condition at the moment procedural code reaches it, using current values. A concurrent assertion is clocked: it samples signals just before a clock edge and can check a pattern across several cycles.
What does assert final do in SystemVerilog? It’s a final deferred immediate assertion. It waits until the end of the time step, after values have settled, so a glitch in the middle of the time step can’t make it fail. Its action block must be a single subroutine call.
What is the difference between assert #0 and assert final? Both are deferred immediate assertions. assert #0 is judged in the Observed region, assert final in the Postponed region at the very end of the time step.
Can I put assert property inside an always block? Yes. It’s a procedural concurrent assertion (IEEE 1800-2017 section 16.14.6). The clock comes from the always block, and any if around it becomes an enabling condition. Some tools, like Verilator 5.020, don’t support it yet.
Where do I place a concurrent assertion? In a module, an interface, a program, or a checker, or inside an always block with a clock. Many teams put them in a separate checker module and attach it with bind.
Why does my concurrent assertion seem to use an old value? It samples values in the Preponed region, just before the clock edge. A signal that changes at the edge shows its new value in the waveform but its old value to the assertion.
Which should I use, immediate or concurrent? Immediate (or deferred immediate) for a single yes/no on current values. Concurrent for anything that involves time: next cycle, within N cycles, handshakes and sequences.
References
- IEEE 1800-2023: SystemVerilog Unified Hardware Design, Specification, and Verification Language (IEEE Standards Association). Deferred assertions are in section 16.4, procedural concurrent assertions in 16.14.6.
- Accellera Announces IEEE 1800-2023 Standard Available Through IEEE GET Program (Accellera): how to get the standard free.
- Every example ran on Synopsys VCS on EDA Playground, 27 Nov 2026.
Keep learning
Assertions are easiest to learn with lots of small examples: start with basic assertions examples, then the operators in SVA examples: $past, $stable, disable iff and repetition. To keep checks out of your RTL, see SVA bind.
There’s more in the SystemVerilog assertions category, the SystemVerilog category and the interview questions.
Part of the learning path Assertions (SVA)
