Connecting module ports by explicitly writing out every .port_name(signal_name) pair gets repetitive fast, especially once a design has dozens of ports that already share names with the signals feeding them. SystemVerilog adds two shorthands, .name and .*, that let a module instantiation connect ports automatically whenever the port name and the local signal name match.
7 min read | Intermediate Level
What You'll Learn
- How the
.nameshorthand connects a single port to an identically named signal - How
.*connects every remaining port at once, and when to mix it with explicit connections - The one rule that trips up most people:
.nameand.*behave differently when no matching signal exists - Where these shortcuts matter most in design versus verification code
Why Port Connections Get Repetitive
A typical module instantiation lists every port explicitly:
module alu (
output [7:0] alu_out,
output zero,
input [7:0] ain,
input [7:0] bin,
input [2:0] opcode
);
// ...
endmodule
module top;
wire [7:0] alu_out, ain, bin;
wire zero;
wire [2:0] opcode;
alu alu_inst (
.alu_out (alu_out),
.zero (zero),
.ain (ain),
.bin (bin),
.opcode (opcode)
);
endmodule
Every connection here repeats the same identifier twice: once as the port name, once as the local signal name. When a designer deliberately names local signals after the ports they connect to - a very common RTL convention - that repetition is pure boilerplate. SystemVerilog lets you drop it.
The .name Shorthand
.port_name on its own is shorthand for .port_name(port_name). It connects the port to a signal of the exact same name declared in the instantiating scope:
alu alu_inst (
.alu_out, // same as .alu_out(alu_out)
.zero, // same as .zero(zero)
.ain, // same as .ain(ain)
.bin, // same as .bin(bin)
.opcode // same as .opcode(opcode)
);
Two conditions have to hold for .name to work: a signal with that exact name has to exist in the instantiating module, and its data type has to be equivalent to the port's. If either condition fails, elaboration reports an error - .name never silently falls back to leaving the port unconnected, even if the port has a default value.
To genuinely leave a port unconnected while still documenting it, use empty parentheses instead: .zero(). That is different from .zero, and the distinction matters - see the mistakes section below.
The .* Wildcard
.* extends the same idea to every port in one go. It connects every port that is not explicitly listed elsewhere in the same instantiation, as long as a same-named, same-type signal exists locally:
alu alu_inst (.*); // connects alu_out, zero, ain, bin and opcode automatically
.* can appear at most once per instantiation, but it can be mixed with explicit connections to call out exceptions - either a port that needs a different signal, or one you want to leave deliberately unconnected:
alu alu_inst (
.zero (), // leave this one unconnected
.ain (ain_reg), // connect to a differently named signal
.* // everything else (alu_out, bin, opcode) connects by name
);
.name vs. .*: The Default-Value Difference
Both shortcuts connect ports by matching names, but they disagree on what happens when a port has a default value and no matching local signal exists. This is the single most useful distinction to remember:
.name | .* | |
|---|---|---|
| Matching signal found | Connects it | Connects it |
| No matching signal, port has a default value | Error - the default value is ignored | Default value is used |
| No matching signal, no default value | Error | Port is left unconnected |
| Appears more than once per instantiation | Allowed (one per port) | Illegal |
The reasoning is intent. Writing .rst_n by name is a deliberate statement that you want to connect that exact port, so a missing signal is treated as a mistake worth flagging. .* is a broad, catch-all shortcut, so a port it cannot match quietly falls back to whatever the module author intended by giving it a default in the first place.
Quick Check
Q: A module has input logic rst_n = 1'b1. The instantiating scope has no signal called rst_n. What happens with .rst_n versus with .*?
Show Answer
.rst_n is an elaboration error, because an implicit named connection never uses the default value. .* instead uses the default value 1'b1, since the port is left for the wildcard to resolve and no matching signal was found.
Using These Shortcuts in Design and Verification
In RTL design, .* is most valuable at the top level of a block where a wrapper module's ports are already named to match the sub-block underneath it one-for-one - common when a module is a thin reset, clock-gating, or pin-muxing wrapper around a larger core. Explicit connections then call out only the handful of signals that genuinely differ.
In verification, .* is even more common. A testbench module typically declares its signals with exactly the DUT's port names on purpose, so the entire DUT instantiation collapses to dut (.*);. Any signal the testbench deliberately drives through a different net - for example, a force/release wire used only for fault injection - is still called out explicitly alongside the wildcard.
What It Synthesizes Into
Implicit port connections are resolved when the design is elaborated, before synthesis builds any logic, so they cannot change the hardware. The example below instantiates an 8-bit adder with .*.
module add8 (input logic [7:0] a, b, output logic [8:0] y);
assign y = a + b;
endmodule
module top (input logic [7:0] a, b, output logic [8:0] y);
add8 u_add (.*);
endmodule
The second version of top spells every connection out:
module top (input logic [7:0] a, b, output logic [8:0] y);
add8 u_add (.a(a), .b(b), .y(y));
endmodule
Synthesis result: With the default synthesis flow of ChipVerify Lab (Yosys with the SkyWater 130 nm high-density cell library), both versions build the same 25 cells for the adder. The shorthand only changes how much you type, and the risk it brings is the one described below: a port that connects to a signal you did not intend, or not at all.
Common Beginner Mistakes
Mistake #1: Confusing .port with .port()
.rst_n (no parentheses) asks for an implicit connection to a signal called rst_n. .rst_n() (empty parentheses) explicitly leaves the port unconnected. Typing the parentheses by habit, out of muscle memory from explicit connections, silently changes the meaning from "connect it" to "don't connect it."
Mistake #2: Relying on .* when names are similar but not identical
Wrong: wire [7:0] aluOut; with a port named alu_out, expecting .* to connect them.
Right: match the exact spelling and capitalization, or connect that one port explicitly.
SystemVerilog is case-sensitive and does not infer connections from similar names - .* only matches an exact, identical identifier. A near-miss name is simply left unconnected or defaulted, with no warning that points directly at the typo.
Mistake #3: Expecting .* to adapt port widths
An explicit named connection can slice a wider bus down to size, such as .dataout(dataout[7:0]). .name and .* cannot - they require the local signal's type to already be equivalent to the port's. A width mismatch simply fails to connect implicitly; it has to be connected explicitly instead.
Practice Exercise
Challenge: Spot the Unconnected Port
Given a module fifo with ports clk, rst_n, wr_en, full, and an instantiating scope that declares local signals clk, rst_n, wr_en but not full, what does fifo fifo_inst (.*); do with the full port, if full is an output with no default value?
Hint
Outputs don't take default values the way inputs do - think about what "no matching signal, no default value" means for .* from the comparison table above.
Solution
full is left unconnected, exactly as if you had written .full() explicitly. No elaboration error occurs, because .* never errors on an unmatched port - it either uses a default value or leaves the port unconnected. The design still elaborates, but any logic that was supposed to read full from this instance now reads a floating signal, which is worth a lint check.
Summary
In this tutorial, you learned:
.nameis shorthand for.name(name)- it requires an exact, equivalent-type signal match or it is an error.*connects every remaining port by the same name-matching rule, but falls back to a default value or leaves the port unconnected instead of erroring.*can appear only once per instantiation, and can be mixed with explicit connections to call out exceptions- Neither shortcut can adapt bus widths or dissimilar names - that still requires an explicit named connection
.*is especially common in verification, where testbench signals are deliberately named to match the DUT
fork...join family of constructs is how you create, coordinate, and tear down that concurrency deliberately, instead of fighting against it.Every initial and always block is already its own process, running concurrently with every other one the moment simulation starts — no fork required. What fork...join adds is the ability to spawn additional concurrent processes from within a single block, and this chapter covers the different flavors of that construct, along with the statements used to wait for or terminate the processes it spawns.
6 min read | Intermediate Level
What You'll Learn
- What a process is in SystemVerilog, and why every
initial/alwaysblock already runs concurrently - Why testbenches specifically need to spawn additional concurrency from within a single block of code
- The three
fork...joinvariants, and how they differ in when the parent process resumes - How to wait for or terminate processes spawned by a
fork...join
What Is a Process?
Once simulation starts, every initial block and every always block is already an independent process, running concurrently with every other process in the design and testbench — this happens automatically, with no special syntax needed. "Process" and "thread" are used more or less interchangeably in this context.
Why Do Testbenches Need Explicit Concurrency?
A single initial block executes sequentially, one statement after another, in program order. Plenty of verification tasks genuinely need to happen at the same time within that one block's logical flow, though — driving a signal while simultaneously watching for a response, or racing a timeout against an event you're waiting for. fork...join spawns multiple concurrent child processes from within a single block, instead of requiring a separate module-level initial/always block for every concurrent task.
The fork...join Family
All three variants spawn the same kind of child processes — they differ only in when the parent process (the one that executed the fork) is allowed to resume:
- fork...join — the parent waits for every forked child to finish before continuing. See SystemVerilog fork join.
- fork...join_any — the parent continues as soon as any single forked child finishes. See SystemVerilog fork join_any.
- fork...join_none — the parent continues immediately, without waiting for any forked child at all. See SystemVerilog fork join_none.
Quick Check
Q: You want to implement a timeout: wait for a specific event, but give up and move on if a fixed delay elapses first, whichever happens first. Which fork...join variant fits this?
Show Answer
fork...join_any. Spawn the event-wait as one child process and the timeout delay as another; the parent resumes as soon as whichever one finishes first completes, without waiting for the other.
Controlling Spawned Processes
Once a fork...join_any or fork...join_none lets the parent continue while child processes are still running, you sometimes need to explicitly wait for or clean up whatever's left:
- wait fork — blocks until every child process spawned by the current process has finished. See SystemVerilog wait fork.
- disable fork — immediately terminates every descendant process spawned, directly or indirectly, by the current process that's still running — reaching further than just its immediate children. See SystemVerilog disable fork join.
Repeating Work Concurrently: the forever Loop
A forever loop is commonly used inside a forked child process to create a persistent background task — a monitor that continuously watches a signal for the entire duration of a test, for example. SystemVerilog forever loop covers this construct in depth.
Where Does This Show Up in a Real Testbench?
Driving stimulus into a DUT while a separate forked process continuously monitors its outputs is one of the most common patterns in verification — as is a timeout watchdog, implemented with fork...join_any, that races a fixed delay against a wait statement so a hung condition doesn't stall an entire regression indefinitely.
Common Beginner Mistakes
Mistake #1: Assuming a forked block always returns immediately
Only fork...join_none returns immediately. Why? Plain fork...join blocks until every child finishes, and fork...join_any blocks until at least one does — assuming either behaves like join_none leads to code that silently waits far longer than expected.
Mistake #2: Leaving spawned processes running at the end of a test
A process spawned by fork...join_any or fork...join_none keeps running in the background even after the parent moves on. Why? If a test finishes without explicitly waiting for or disabling those leftover processes, they can keep executing (or leave dangling activity) right up to $finish, which is rarely the intended behavior.
Mistake #3: Sharing a variable between concurrent processes with no synchronization
Two processes spawned by the same fork...join run concurrently, so if both read and write the same variable with no coordination, the result depends on simulator scheduling order. Why? This is a classic race condition — the Interprocess Communication chapter covers events, semaphores, and mailboxes, which exist specifically to coordinate concurrent processes safely.
Practice Exercise
Challenge: Match the Scenario to the Right Construct
For each scenario below, name the fork...join variant (or process-control statement) that fits best:
- Drive three independent stimulus sequences in parallel, and don't move on to the next test step until all three have completed.
- Kick off a background monitor that should keep running for the rest of the test, without the parent process waiting for it at all.
- A parent process spawned several background tasks earlier with
fork...join_none; now, right before the test ends, it needs to make sure every one of them has actually finished.
Hint
Match each scenario against how long the parent process needs to wait: forever (until everything finishes), not at all, or a later explicit checkpoint.
Solution
fork...join— the parent needs all three sequences to finish before continuing.fork...join_none— the parent continues immediately, and the monitor keeps running independently in the background.wait fork— this blocks until every child process spawned by the current process (including the earlierjoin_noneones) has completed.
Summary
In this tutorial, you learned:
- Every
initial/alwaysblock is already its own process, running concurrently with every other one, automatically fork...joinspawns additional concurrent child processes from within a single block of code- The three variants —
join,join_any, andjoin_none— differ only in when the parent process is allowed to resume wait forkblocks until all of the current process's immediate children finish;disable forkreaches further, terminating every descendant — children, grandchildren, and so on — immediately- Sharing a variable between concurrently running processes without synchronization is a common source of race conditions
Continuing the Threads & Processes Chapter
Continue with SystemVerilog fork join, SystemVerilog Threads, SystemVerilog forever loop, fork join_none, fork join_any, disable fork join, and wait fork.
disable fork terminates every process spawned by the calling process, and the process class lets you target one specific process handle. The plain disable statement is a third option: it terminates a currently-executing block or task by name — but it works on a completely different kind of scope than either of those, which makes it easy to misuse without realizing it.
7 min read | Intermediate Level
What You'll Learn
- What
disabledoes, and the two things it can target: a named block or a task - How
disable's scope differs fundamentally fromdisable fork's scope - Why disabling a named block or task can affect completely unrelated processes that happen to share the same name
- How
disablecan be used as an early exit from within a task
What Does disable Do?
disable terminates a currently-executing named block or task. If that block or task isn't currently running, disable simply has no effect — it isn't an error, it's a no-op.
Syntax
disable block_name;
disable task_name;
Parameters:
block_name— the label given to abegin/end(orfork/join) block, written asbegin : block_nametask_name— the name of a task
A Basic Example: Disabling One Named Block
Here, three threads run in parallel: a timeout, a background monitor, and a thread that reacts to an early event. When the event fires, it cancels only the timeout by name — the monitor keeps running, completely unaffected:
module tb;
initial begin
fork
begin : timeout_blk
#100 $display ("[%0t] Timeout reached", $time);
end
begin : monitor_blk
forever #10 $display ("[%0t] Monitoring...", $time);
end
begin
#30 $display ("[%0t] Event occurred", $time);
disable timeout_blk; // cancel only the timeout, leave monitor_blk running
end
join_none
#60 $finish;
end
endmodule
timeout_blk is disabled at 30ns, well before it ever reaches its 100ns delay, so its message never prints. monitor_blk keeps running, printing every 10ns right up until the test ends at 60ns — it's never touched, because disable only targets the block named in the statement.
Quick Check
Q: If disable fork; had been used instead of disable timeout_blk; in the example above, what would happen to monitor_blk?
Show Answer
It would be terminated too. disable fork kills every process spawned by the calling process, with no way to spare just one of them — that's exactly the distinction a named disable is for.
Why the Scope Is Different From disable fork
disable fork works on a dynamic scope: it only terminates processes that were actually forked by the calling process, based on the runtime parent-child relationship between them. Named disable works on a completely different, static (lexical) scope instead: it terminates every currently-active execution of that name, anywhere in the design, regardless of which process spawned it or how the two are related at runtime.
This makes named disable genuinely dangerous if the same block label or task name is reused — for example, inside a class method that multiple object instances run concurrently. If two unrelated instances both happen to be executing a block called proc_blk at the same time, calling disable proc_blk; from either one terminates both instances' executions, not just the one that called it. The relationship that matters here is "same name," not "same object" or "same process tree."
Where Is Named disable Used?
Named disable is the right tool when you need to cancel one specific piece of background work — like a single timeout — without disturbing other unrelated monitors or checkers running in the same process, exactly as in the timeout example above. disable fork would be the wrong choice there, since it can't spare anything.
disable as an Early Exit From a Task
A task can also call disable on its own name to exit early:
task check_value (int val);
if (val < 0) begin
$display ("Invalid value, exiting early");
disable check_value;
end
$display ("Processing value: %0d", val);
endtask
This isn't quite the same as a return statement, even though both exit a task early. In everyday use, prefer return for exiting a task from within itself — it's the more idiomatic choice. Named disable is generally reserved for terminating a task or block from outside it, which a plain return can't do at all.
Common Beginner Mistakes
Mistake #1: Assuming disable only affects the instance you're thinking of
As the warning above explains, named disable terminates every currently-active execution of that name, not just the one specific instance or process you had in mind. Why? This is especially dangerous with class methods or module code that gets reused across multiple concurrently-running instances — the same block name in each instance is still just one name as far as disable is concerned.
Mistake #2: Confusing disable with disable fork
One works on a static, name-based scope; the other works on a dynamic, parent-child scope. Why? Picking the wrong one either terminates far more than intended (an unrelated process that happens to share a name) or far less (leaving unrelated background threads spawned by the same process still running when you meant to clear all of them).
Mistake #3: Assuming disable errors out on a block that isn't running
disable on a block or task that isn't currently executing simply does nothing — no error, no warning. Why? This can mask a real bug: if you expect a specific block to be disabled and it silently wasn't (because it had already finished, or never started), nothing in the simulation will tell you that on its own.
Practice Exercise
Challenge: Cancel Only One of Two Named Blocks
Extend the timeout/monitor example from earlier with a second independent named block, backup_blk, that prints a message after 50ns. At 30ns, cancel only timeout_blk — both monitor_blk and backup_blk should keep running untouched.
Hint
Give the new block its own distinct label, and fork it alongside the others — disabling one name by itself has no effect on differently-named blocks.
Solution
module tb;
initial begin
fork
begin : timeout_blk
#100 $display ("[%0t] Timeout reached", $time);
end
begin : monitor_blk
forever #10 $display ("[%0t] Monitoring...", $time);
end
begin : backup_blk
#50 $display ("[%0t] Backup check complete", $time);
end
begin
#30 $display ("[%0t] Event occurred", $time);
disable timeout_blk;
end
join_none
#60 $finish;
end
endmodule
Only timeout_blk is named in the disable statement, so it's the only one affected — backup_blk still prints at 50ns, and monitor_blk keeps ticking every 10ns for the rest of the test, exactly as before.
Summary
In this tutorial, you learned:
disableterminates a currently-executing named block or task; it does nothing if that name isn't currently active- Its scope is static (lexical): it affects every currently-active execution of that name, anywhere, not just one specific process or instance
- This is fundamentally different from
disable fork's scope, which is dynamic and limited to the calling process's own descendants - Reusing a block label or task name across multiple concurrently-running instances makes named
disablerisky, since it can terminate unrelated executions that happen to share the same name - A task can call
disableon itself as an early exit, thoughreturnis the more idiomatic choice for that specific case
Beyond chaining sequences with ##, SystemVerilog provides five operators for combining two sequences into a single, more expressive check: and, or, intersect, within, and throughout. Two of these — and and intersect — look similar but behave differently in a way that's easy to get wrong.
13 min read | Intermediate Level
What You'll Learn
- How
andcombines two sequences that may finish at different times - Why
intersectrequires both sequences to end at the exact same cycle, unlikeand - How
ormatches as soon as either sequence succeeds, without waiting for the other - The difference between
within(one sequence contained inside another) andthroughout(a boolean holding true for a sequence's entire span)
and: Both Must Match, Different Lengths Allowed
seq1 and seq2 requires both operand sequences to match, starting from the same clock tick — but they don't need to be the same length. The overall match completes at whichever of the two finishes later:
sequence seq_a;
x ##1 y; // 2-cycle sequence
endsequence
sequence seq_b;
p ##2 q; // 3-cycle sequence
endsequence
sequence s_and;
seq_a and seq_b;
endsequence
Both sequences start together, at cycle 1: x=1 and p=1. seq_a matches at cycle 2 (y=1). seq_b matches at cycle 3 (q=1). Since and only requires both to eventually succeed, and takes the later of the two end times, seq_a and seq_b matches at cycle 3 — even though the two operands finished at different times.
intersect: Both Must Match, and End at the Same Time
intersect looks almost identical to and, with one added requirement: both operand sequences must end at exactly the same cycle:
sequence s_intersect;
seq_a intersect seq_b;
endsequence
Using the exact same seq_a and seq_b from above — matching at cycle 2 and cycle 3 respectively — seq_a intersect seq_b fails. Both sequences did genuinely match, but their end times don't coincide (2 ≠ 3), and intersect requires them to.
This is the entire practical difference between the two operators: and tolerates sequences of different lengths, taking the later finish; intersect demands they finish together. The exact same pair of underlying sequences can pass under and and fail under intersect, as shown above.
Quick Check
Q: If seq_b were changed to p ##1 q (a 2-cycle sequence instead of 3), so both operands now match at cycle 2, would seq_a intersect seq_b pass?
Show Answer
Yes. With both sequences now ending at the same cycle (2), intersect's requirement is satisfied — it would pass under both and and intersect in that case, since there's no longer any mismatch in end times to distinguish them.
or: Matches as Soon as Either One Does
seq1 or seq2 matches the moment either operand succeeds — it doesn't wait around for the other one to resolve first:
sequence s_or;
seq_a or seq_b;
endsequence
Suppose seq_b's q never actually appears (seq_b is doomed to eventually fail). seq_a still matches normally at cycle 2 (x=1 at cycle 1, y=1 at cycle 2). Since or only needs one operand to succeed, seq_a or seq_b matches at cycle 2 — it doesn't need to wait until cycle 3 to find out that seq_b would have failed anyway.
Quick Check
Q: If both seq_a and seq_b succeed (as in the and/intersect examples above), at which cycle does seq_a or seq_b match?
Show Answer
Cycle 2 — as soon as the first of the two (seq_a) succeeds. or doesn't wait for the later one to finish the way and does; it's satisfied the instant either side matches.
within: One Sequence Fully Contained in Another
seq1 within seq2 requires seq1's entire occurrence — from its own start to its own end — to fall completely inside the span during which seq2 is occurring:
sequence s_within;
(req ##1 ack) within busy[*5];
endsequence
Say busy stays high for cycles 1 through 5 (matching busy[*5], a span from cycle 1 to cycle 5). If req is 1 at cycle 2 and ack is 1 at cycle 3, the inner sequence's own span (cycles 2–3) sits entirely inside busy's span (cycles 1–5) — within passes.
If ack were instead delayed until cycle 6, the inner sequence's span would become cycles 4–6 — extending one cycle past where busy's own span ends at cycle 5. Since the inner sequence is no longer fully contained, within would fail, even though req and ack both still occurred while busy happened to be nearby.
throughout: A Boolean That Must Hold for the Whole Span
bool_expr throughout seq checks that a plain boolean expression — not another full sequence — stays true for every single cycle of seq's entire duration:
sequence s_throughout;
!reset throughout (req ##1 gnt ##1 valid);
endsequence
Here, req ##1 gnt ##1 valid spans 3 cycles (say req at cycle 1, gnt at cycle 2, valid at cycle 3). If reset stays low across all three of those cycles, throughout passes.
If reset instead glitched high for just one cycle in the middle — say, at cycle 2 — throughout would fail, even though req, gnt, and valid each still occurred exactly on schedule. Catching that kind of mid-sequence glitch, which a plain chained sequence would never notice on its own, is exactly what throughout is for.
Quick Check
Q: Could throughout's left-hand side be a full sequence, like (a ##1 b), instead of a plain boolean?
Show Answer
No. The left-hand side of throughout must be a simple boolean expression, checked fresh at every single cycle of the right-hand sequence's span — it isn't itself a temporal sequence with its own multi-cycle extent.
Where Are These Used?
intersect is the standard way to check that no new request of the same kind arrives while an earlier one of unknown, variable duration is still being serviced — both events must span exactly the same window. throughout is the standard way to check that reset, or some other invalidating condition, never glitches partway through a multi-cycle transaction that's otherwise behaving correctly.
Common Beginner Mistakes
Mistake #1: Using and when intersect was actually intended
As the contrasting example shows, and happily accepts two sequences that finish at different times — if the intent was specifically to check that both events span the exact same window, and silently allows a mismatch that intersect would correctly reject.
Mistake #2: Assuming or waits for both operands to resolve
or matches the instant either operand succeeds, without waiting to see what the other one eventually does. Why? If the two sequences have different lengths, the match time can end up being much earlier than either operand's own natural resolution point, which can be surprising if you expected both sides to be evaluated symmetrically.
Mistake #3: Confusing within with throughout
within checks that one entire sequence's span fits inside another's; throughout checks that a single boolean condition holds continuously across a sequence's span. Why? They solve genuinely different problems — containment of one temporal event inside another, versus a simple condition never glitching during an event — and reaching for the wrong one won't express the intended check at all.
Mistake #4: Using a full sequence on the left of throughout
Only a plain boolean expression belongs on the left-hand side of throughout. Why? The whole point of throughout is checking a simple condition at every cycle across another sequence's span — the left-hand side isn't meant to have its own independent temporal behavior.
Practice Exercise
Challenge: Predict and vs intersect on a New Pair
Given seq_c: m ##1 n (matching at cycle 2, same as seq_a above) and seq_d: r ##1 s (also matching at cycle 2), predict the result of both seq_c and seq_d and seq_c intersect seq_d.
Hint
Both sequences here have the same length. Does that change anything about which operator behaves differently from the other?
Solution
Both pass, matching at cycle 2. Since seq_c and seq_d both happen to end at the same cycle, there's no mismatch for intersect to catch — and and intersect only produce different results when the two operand sequences' end times actually differ, as in this article's main example.
Summary
In this tutorial, you learned:
andrequires both sequences to match, starting together, and completes at whichever finishes later — different lengths are fineintersectadds the extra requirement that both sequences finish at exactly the same cycleormatches as soon as either operand succeeds, without waiting for the other to resolvewithinchecks that one sequence's entire span is fully contained inside another'sthroughoutchecks that a plain boolean condition holds true for every cycle of another sequence's span, catching mid-sequence glitches a plain chained sequence would miss
The vast majority of real assertions follow the same shape: whenever something happens, then something else must follow. SystemVerilog expresses this with two implication operators, |-> and |=> — and choosing the wrong one is one of the most common mistakes in SVA, since it can produce an assertion that fails constantly even though the design is behaving exactly as intended.
12 min read | Intermediate Level
What You'll Learn
- What "vacuous success" means, and why the consequent is never even checked when the antecedent is false
- The difference between
|->(overlapping) and|=>(non-overlapping), and the automatic 1-cycle gap the latter inserts - Why the exact same signals can be reported as constantly failing under one operator and correctly passing under the other
- Why the "overlap" point for a multi-cycle antecedent is its last cycle, not its first
Vacuous Success: What Happens When the Antecedent Is False?
An implication has the form antecedent |-> consequent (or |=>). If the antecedent doesn't hold on a given cycle, the whole implication is considered true automatically — the consequent is never even evaluated. This is called vacuous success, and it's completely normal: req |-> gnt only has anything to check on cycles where req is actually high; every other cycle passes trivially, with nothing meaningful having been verified.
Overlapping Implication: |->
antecedent |-> consequent requires the consequent to hold starting on the same cycle the antecedent's own match completes — the two overlap at that shared cycle:
assert property (@(posedge clk) req |-> gnt);
This checks: whenever req is high, gnt must also be high on that exact same cycle, with no delay at all.
Non-Overlapping Implication: |=>
antecedent |=> consequent checks the exact same relationship, but with one difference: it automatically inserts a 1-cycle gap, requiring the consequent to hold starting the cycle after the antecedent completes:
assert property (@(posedge clk) req |=> gnt);
This checks: whenever req is high, gnt must be high on the following cycle instead.
Comparing Both on the Same Trace
Here's where the difference actually matters. Take a signal trace where gnt genuinely follows req by exactly one cycle — a completely correct, common design pattern:
| Cycle | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| req | 1 | 0 | 1 | 0 | 1 | 0 |
| gnt | 0 | 1 | 0 | 1 | 0 | 1 |
Checked with req |-> gnt (same cycle), every single assertion of req fails — gnt is never high on the same cycle as req in this trace:
- Cycle 1:
req=1,gnt=0→ FAIL - Cycle 3:
req=1,gnt=0→ FAIL - Cycle 5:
req=1,gnt=0→ FAIL
Checked with req |=> gnt (next cycle) on the exact same trace, every single one passes:
- Cycle 1:
req=1, checksgntat cycle 2 (=1) → PASS - Cycle 3:
req=1, checksgntat cycle 4 (=1) → PASS - Cycle 5:
req=1, checksgntat cycle 6 (=1) → PASS
The design here is perfectly correct — it's the choice of implication operator that determines whether the assertion recognizes that or not.
Quick Check
Q: If someone wrote req |-> gnt against this exact design and saw it fail on every single cycle where req was asserted, what would that suggest?
Show Answer
Most likely, the wrong implication operator was used — not necessarily a real design bug. A property that fails every single time its antecedent fires, with no exceptions, is a strong signal to double-check whether |=> (or an explicit cycle delay) is what was actually intended.
The Overlap Point for a Multi-Cycle Antecedent
When the antecedent itself spans multiple cycles, the "overlap" in |-> is with the antecedent's last cycle — not its first:
assert property (@(posedge clk) (req ##1 mid) |-> gnt);
Say req is high at cycle 1, and mid is high at cycle 2 — the antecedent req ##1 mid completes its own match at cycle 2, not cycle 1. So gnt needs to be high at cycle 2 (matching mid's cycle) for the overlapping implication to hold — cycle 1, where req happened, is irrelevant to where the overlap actually occurs.
Quick Check
Q: For the same (req ##1 mid) |-> gnt property, at which cycle would |=> instead require gnt to be checked?
Show Answer
Cycle 3 — one cycle after the antecedent's own completion point (cycle 2, where mid occurred), not one cycle after req. The non-overlapping gap is always measured from where the antecedent's match actually ends.
A Useful Equivalence
a |=> b is exactly equivalent to a |-> ##1 b — non-overlapping implication is just overlapping implication with an explicit one-cycle delay already built in. This is worth knowing, because it generalizes: a |-> ##2 b checks a two-cycle gap, a |-> ##[1:4] b checks a flexible window, and so on — |=> is really just the single most common special case of this same pattern.
Where Is This Used?
Essentially every protocol assertion follows this shape — "whenever a request happens, an acknowledge must follow within some number of cycles." Getting the implication operator (or the explicit delay) right is what separates an assertion that actually verifies the protocol from one that either fails constantly on a correct design, or passes vacuously without ever really checking anything meaningful.
Common Beginner Mistakes
Mistake #1: Using |-> when the design's timing actually needs |=>
As the comparison trace shows, this produces an assertion that fails on every single occurrence of the antecedent, even against a correctly-behaving design. Why? If a property fails constantly with no exceptions, check the implication operator (and any needed cycle delay) before assuming the design itself is broken.
Mistake #2: Treating vacuous success as suspicious
A cycle where the antecedent never fires, and the implication passes trivially, is completely normal — not a red flag. Why? That said, if the antecedent never fires across an entire test, the assertion has never actually been exercised at all — that's worth catching with coverage, separately from the assertion's own pass/fail result.
Mistake #3: Assuming |-> overlaps with the antecedent's first cycle
For a multi-cycle antecedent, the overlap point is the antecedent's last cycle — where its own match actually completes. Why? Assuming the overlap happens at the antecedent's starting point instead leads to checking the consequent at the wrong cycle entirely, especially once the antecedent itself takes more than one cycle to resolve.
Mistake #4: Forgetting a |=> b is just a |-> ##1 b
These aren't two unrelated constructs — |=> is a specific, common case of |-> plus an explicit one-cycle delay. Why? Recognizing this makes it much easier to generalize to other fixed or ranged delays (##2, ##[1:4]) using the same |-> foundation, instead of treating each delay amount as its own separate concept.
Practice Exercise
Challenge: Find the Right Delay
Given a trace where gnt follows req by exactly 2 cycles (req at cycles 1 and 4; gnt at cycles 3 and 6), determine whether req |-> gnt, req |=> gnt, or neither correctly captures this relationship — and if neither does, write the property that does.
Hint
Work out exactly which cycle each operator checks gnt on, for both occurrences of req, and compare against where gnt actually is.
Solution
Neither works. req |-> gnt checks the same cycle as req (cycles 1 and 4), where gnt is 0 both times — fails. req |=> gnt checks one cycle later (cycles 2 and 5), where gnt is also 0 both times — also fails. The correct property needs an explicit 2-cycle delay:
assert property (@(posedge clk) req |-> ##2 gnt);
This checks gnt exactly 2 cycles after each req — cycle 3 and cycle 6 — where gnt is genuinely 1 both times, correctly passing.
Summary
In this tutorial, you learned:
- An implication's consequent is only evaluated when its antecedent holds; otherwise the implication passes vacuously
|->(overlapping) checks the consequent on the same cycle the antecedent's match completes|=>(non-overlapping) checks the consequent one cycle later, automatically- The exact same signal trace can fail constantly under one operator and pass correctly under the other — a property failing on every occurrence is a strong signal to check which one was used
- For a multi-cycle antecedent, both operators measure from the antecedent's last cycle, not its first — and
a |=> bis just shorthand fora |-> ##1 b
Quiz
No quiz questions available for this article.