Sampled edge functions inspect the expression’s least significant bit.
A
Two known samples
bit 2 rises; bit 0 stays 0
The vector changes from 0010 to 0110.
B
$rose(bus)
false
$rose checks the least significant bit only.
C
$changed(bus)
true
This helper compares the complete sampled expression.
D
Any rising bit
true
For these known binary samples: |(bus & ~$past(bus)).
Compare each case under the stated assumptions; these are not sequential steps.
Work it through
Write the intended event
For a vector-wide transition, compare whole sampled vectors or write a bitwise predicate. Do not use $rose(bus) as shorthand for any bit rising.
The same trace yields false for $rose and true for $changed and the explicit any-rise test.
Watch for this
The any-rise expression shown assumes known 0/1 samples and valid history. $rose itself also treats X/Z-to-1 on bit 0 as a rise; it is not a general knownness check.
Check your reasoning
Test an upper-bit-only rise, a bit-0 rise, and a no-change sample separately. Add !$isunknown when the protocol requires known controls.
The language bench / assertions
Give the response a deadline.
assert property (@(posedge clk) disable iff (!rst_n)
$rose(req) |-> ##[1:3] ack);
// ACK must be sampled 1, 2, or 3 cycles after REQ rises.
Question directory
Questions for Fundamentals
Open a question at its supporting explanation. The complete property reference stays directly above each answer set.
This is the shortest path from an English requirement to reviewable SVA. If one decision is missing, the property is probably underspecified.
Sampling grid
Sample one coherent snapshot at every positive clock edge.
Each numbered sample is one posedge of clk. Temporal delays count these sampling events, not simulator time and not arbitrary signal transitions between edges.
Selected clause@(posedge clk)
sample
t0t1t2t3t4t5t6t7
posedge clk
rst_n
req
ack
outcome
cover hit
Each row is one sampled positive clock edge. Highlighted rows belong to the selected obligation.
Sample
rst_n
req
ack
outcome
cover hit
t0
0
0
0
0
0
t1
1
0
0
0
0
t2
1
1
0
0
0
t3
1
0
0
0
0
t4
1
0
0
0
0
t5
1
0
1
1
1
t6
1
0
0
0
0
t7
1
0
0
0
0
All eight numbered samples are sampling events. One ##1 delay advances exactly one sample.
Separate simulation updates from assertion sampling, then explain exactly when a concurrent property observes, evaluates, and reports a result.
Concept modelOne clock tick crosses three assertion regions
01SamplePreponed
Capture values before Active and NBA updates.
02EvaluateObserved
Run the property using the sampled values.
03ReportReactive
Execute the concurrent pass or fail action.
disable iff observes current values and can abort between sampled clock events.
Concurrent properties sample design values in Preponed, evaluate those samples in Observed, and schedule pass or fail action blocks in Reactive.Reference, examples and proof details
Always-visible reference
Learn the mechanism before testing the interview answer.
These notes, tables, examples, and design limits contain the working knowledge for this chapter. The interview questions below are a checkpoint, not the primary explanation.
Why assertions
Use SVA as an executable contract, not as decorative checking.
A useful assertion turns one requirement into an observable, reusable rule. It catches the failure close to its source, documents the intended behavior, and can run in both simulation and formal analysis.
Specification
Capture intent precisely
Name the clock, reset policy, trigger, deadline, and required outcome. The property is only as correct as that translation.
Observability
Fail near the cause
Internal invariants can expose a corrupt state before the bug propagates to a scoreboard-visible output.
Reuse
Carry checks with the IP
Interface and block contracts can run in unit simulation, subsystem regression, emulation where supported, and formal harnesses.
Evidence
Measure exercise separately
Assertion coverage and cover properties show whether attempts and important scenarios occurred. They do not replace data-oriented covergroups.
Two execution models
Choose the assertion form that matches the requirement.
Immediate assertions are procedural checks at one execution point. Concurrent assertions create clocked attempts that can span many samples.
Form
When it evaluates
Best use
Important caution
Formassert (expr)
When it evaluatesWhen procedural control reaches it
Best useLocal combinational or algorithmic invariant
Important cautionSimple form can observe transient delta-cycle values
Formassert #0 / assert final
When it evaluatesDeferred within the current time slot
Best useSettled combinational result
Important cautionStill procedural, not a multi-cycle temporal property
Formassert property
When it evaluatesOn the declared or inherited sampling event
Best useLatency, ordering, stability, pulse, and protocol rules
Important cautionUses sampled values and can create overlapping attempts
Procedural invariant and temporal contractSystemVerilog
always_combbegin a_grant_shape: assertfinal ($onehot0(grant))else$error("grant is not one-hot-or-zero");enda_req_ack: assertproperty ( @(posedge clk) disableiff (!rst_n)$rose(req) |->##[1:3] ack);
Scheduler model
The sampled value can differ from the waveform value you see later.
At a concurrent assertion clock event, design values are sampled before Active and NBA updates. The property evaluates those samples later in the same time slot, and its action block runs after the result is known.
Preponed
Sample
Capture the values used by the property before ordinary Active-region logic and nonblocking assignment updates.
Observed
Evaluate
Evaluate sequence matches and property truth using the Preponed samples.
Reactive
Report
Run pass or fail action blocks. Use $sampled(signal) when the message must show the value that the property evaluated.
Asynchronous control
Abort
disable iff observes its current expression and can terminate an active attempt between sampling events.
Use the sampled-value and four-state helpers deliberately.
Every history function is interpreted on the property's sampling event. Vector edge functions inspect the least significant bit, so write an explicit vector comparison when the requirement is broader.
Function
Meaning at this sample
Typical contract
Function$rose(x)
Meaning at this sampleLSB changed from 0/X/Z to 1
Typical contractOne attempt per rising event
Function$fell(x)
Meaning at this sampleLSB changed from 1/X/Z to 0
Typical contractRelease or completion edge
Function$stable(x)
Meaning at this sampleWhole expression equals its prior sample
Typical contractPayload held under stall
Function$changed(x)
Meaning at this sampleWhole expression differs from its prior sample
Typical contractState or ownership transition
Function$past(x, n)
Meaning at this sampleValue sampled n clock events earlier
Typical contractHistory and causality
Function$sampled(x)
Meaning at this sampleValue captured for this assertion evaluation
Typical contractAccurate failure message
Function$onehot(x)
Meaning at this sampleExactly one bit is 1
Typical contractExactly one owner
Function$onehot0(x)
Meaning at this sampleZero or one bit is 1
Typical contractIdle-capable one-hot grant
Function$isunknown(x)
Meaning at this sampleAt least one bit is X or Z
Typical contractFour-state control integrity
Function$countones(x)
Meaning at this sampleNumber of bits equal to 1
Typical contractPopulation limit
Deployment
Place each checker where its inputs and ownership are clear.
White-box checks belong near internal state and datapath invariants. Black-box protocol checks belong at interfaces or in bound checkers. System-level ordering may require state outside a pure temporal property.
Location
Sees
Best for
Ownership risk
LocationRTL module
SeesInternal state and datapath
Best forWhite-box invariants
Ownership riskTight implementation coupling
Locationinterface
SeesProtocol signals
Best forReusable interface contract
Ownership riskClock and modport conventions
Locationchecker + bind
SeesExplicit checker ports
Best forNon-invasive integration
Ownership riskAccidental bind to every module instance
Locationformal harness
SeesBoundary inputs and state
Best forAssumptions, assertions, covers
Ownership riskOverconstraint
Locationscoreboard/model
SeesTransactions and history
Best forIdentity, ordering, one-to-one accounting
Ownership riskNot a replacement for local assertions
Interview checkpoint
Explain the rule, then defend its edge cases.
Open a prompt after studying the reference above. A strong answer should name the sampled edge, match endpoint, failure mode, and proof evidence.
Strong answer
SVA stands for SystemVerilog Assertions. It adds executable Boolean and temporal properties that can check design behavior in simulation and formal analysis, and can record that meaningful scenarios occurred.
Why it works
Immediate assertions check a condition at a procedural execution point. Concurrent assertions describe sampled behavior across one or more clock events.
Assertions work best as compact contracts near an interface, block, or bound checker, not as a replacement for scoreboards and end-to-end data models.
A useful assertion names the requirement, states its clock and reset policy, and reports enough sampled context to reproduce a failure.
What the interviewer is testing
Whether you can describe assertions as executable specifications and choose them for temporal control behavior without claiming they replace every verification technique.
Common trap
Do not define SVA as only a simulator feature. The same property language is also central to formal verification and assertion coverage.
SVA
assertions
simulation
formal
Strong answer
A simple immediate assertion executes like a procedural if statement when control reaches it. A concurrent assertion starts attempts on a declared clocking event and evaluates sampled behavior over time.
Why it works
Use an immediate assertion for a local procedural invariant whose meaning is tied to that execution point.
Use a concurrent property for clocked protocols, latency, stability, ordering, pulse width, and other temporal contracts.
A deferred immediate form such as assert final can avoid reporting a transient combinational delta-cycle value.
What the interviewer is testing
Whether you connect assertion type to scheduling semantics instead of treating assert and assert property as interchangeable syntax.
Common trap
A simple immediate assertion does not automatically sample in Preponed or wait for a clock edge.
Procedural and clocked checksSystemVerilog
always_combbegin a_onehot_grant: assertfinal ($onehot0(grant))else$error("grant is not one-hot-or-zero");enda_req_ack: assertproperty ( @(posedge clk) disableiff (!rst_n)$rose(req) |->##[1:3] ack);
immediate assertion
concurrent assertion
assert final
Strong answer
At its clocking event, a concurrent assertion samples referenced design values in Preponed, evaluates the property in Observed, and schedules its pass or fail action block in Reactive.
Why it works
This region separation prevents the property from racing ordinary Active and NBA updates on the same clock edge.
The disable iff expression is different: it uses current values and can asynchronously abort an active attempt.
Inside a Reactive failure action, use $sampled(signal) when the message must report the value that the property actually evaluated.
Choose $fatal, $error, $warning, or $info in an action block according to the regression policy; the property semantics do not change with the message severity.
What the interviewer is testing
Whether you can explain why a waveform's post-NBA value may differ from the value seen by the concurrent property on that same edge.
Common trap
Printing a raw signal from the action block and calling it the sampled failure value can produce a misleading diagnostic.
Report the sampled failure contextSystemVerilog
a_known_state: assertproperty ( @(posedge clk) disableiff (!rst_n) !$isunknown(state)) else$error("sampled state was %b",$sampled(state));
Preponed
Observed
Reactive
$sampled
Strong answer
They compare values sampled on the property clock. $rose and $fell detect a 0/X/Z-to-1 or 1/X/Z-to-0 transition of the expression's least significant bit, $stable checks that the sampled expression did not change, and $past(expr, n) returns its sampled value n clocking events earlier.
Why it works
For a vector transition, write the comparison you actually mean instead of assuming $rose(vector) detects any rising bit.
$stable(payload) is especially useful in a one-step invariant that is retriggered on every stalled ready-valid edge.
Guard uses of $past near time zero or reset release until enough sampled history exists; otherwise the default historical value can create a misleading pass or failure.
What the interviewer is testing
Whether you connect sampled-value functions to the property clock and can explain their vector and startup edge cases.
Common trap
$past is not a free-running history database, and $rose on a bus does not mean any bit rose.
Function
Question answered
Common use
Function$rose(x)
Question answeredDid sampled bit 0 change to 1?
Common useOne attempt per rising edge
Function$fell(x)
Question answeredDid sampled bit 0 change to 0?
Common useRelease or completion edge
Function$stable(x)
Question answeredIs x unchanged from the prior sample?
Common usePayload under backpressure
Function$past(x, n)
Question answeredWhat was x n samples ago?
Common useBounded history and causality
$rose
$fell
$stable
$past
sampling
Strong answer
$onehot(expr) requires exactly one asserted bit, $onehot0(expr) permits zero or one, $isunknown(expr) detects any X or Z, and $countones(expr) returns the number of one bits. They turn common structural invariants into readable checks.
Why it works
Use $onehot0 for an idle-capable grant vector and $onehot when one owner must always be selected.
Check control and state vectors with !$isunknown(...) when X or Z must be a failure rather than an optimistic don't-care.
$countones(mask) supports bounded-population rules, but state the legal count range explicitly so the intent is visible.
What the interviewer is testing
Whether you know the four-state and population-count helpers well enough to avoid hand-written, error-prone Boolean trees.
Common trap
$onehot0 does not require any bit to be asserted; confusing it with $onehot weakens the contract.
Assertion anatomyBuild the temporal sentence in layers.
Start with Boolean expressions, compose sequences across sampled clocks, turn them into properties, and finally choose assert, assume, or cover.
Concept modelSVA grows from values into verification intent
01Booleanreq && readyValue now
02Sequencereq ##[1:3] ackMatch across clocks
03Propertyreq |-> responseConditional obligation
04Directiveassert property (...)Verification job
Delay##n · ##[m:n]
Repeat[*] · [=] · [->]
Matchand · or · intersect
Spanthroughout · within
Outcome|-> · |=>
Each layer adds one kind of meaning. A directive gives a property a job; it does not change the property's timing semantics.Reference, examples and proof details
Always-visible reference
Learn the mechanism before testing the interview answer.
These notes, tables, examples, and design limits contain the working knowledge for this chapter. The interview questions below are a checkpoint, not the primary explanation.
Language model
Identify the language layer before explaining an operator.
The same-looking words can have different semantics at the Boolean, sequence, property, and directive layers. Build the rule from the bottom up.
Name sequences and properties when the timing deserves a name.
A named sequence may have formal arguments, local variables, and an explicit or inherited clock. A property adds implication, reset, and truth-valued composition. Keep the trigger and outcome visible at the call site.
Sequence, property, checker, and bindSystemVerilog
Use this table to translate English timing into SVA.
Parenthesize mixed temporal operators even when you know precedence. It makes the intended start point, span, and endpoint reviewable.
Family
Syntax
Core meaning
Typical mistake
FamilyDelay
Syntax##0, ##n, ##[m:n]
Core meaningConcatenate sequence elements by sampled clocks
Typical mistakeCounting simulator time instead of samples
FamilyConsecutive repeat
Syntax[*n], [*m:n]
Core meaningRepeat a Boolean or sequence on consecutive samples
Typical mistakeForgetting the implicit ##1 between repeats
FamilyNonconsecutive repeat
Syntax[=n], [=m:n]
Core meaningCount Boolean hits with gaps and optional trailing slack
Typical mistakeExpecting the match to end on the last hit
FamilyGoto repeat
Syntax[->n], [->m:n]
Core meaningCount Boolean hits with gaps and end on the final hit
Typical mistakeApplying it to an arbitrary sequence
FamilySequence choice
Syntaxor
Core meaningEither sequence match is sufficient
Typical mistakeAssuming only one candidate endpoint exists
FamilySequence conjunction
Syntaxand
Core meaningBoth start in one compound attempt; later endpoint wins
Typical mistakeTreating it like Boolean &&
FamilyEndpoint conjunction
Syntaxintersect
Core meaningBoth sequence matches must share an endpoint
Typical mistakeUsing it when different endpoints are legal
FamilySpan
Syntaxexpr throughout seq
Core meaningExpression holds over every sample of the selected match
Typical mistakeForgetting the endpoint is included
FamilyContainment
Syntaxinner within outer
Core meaningA complete inner match fits inside outer
Typical mistakeConfusing containment with implication
FamilyImplication
Syntax|->, |=>
Core meaningCreate a conditional property obligation
Typical mistakeClaiming |=> serializes attempts
FamilyEndpoint selection
Syntaxfirst_match(seq), seq.ended
Core meaningSelect earliest match or observe a named endpoint
Typical mistakeConfusing endpoint selection with transaction ownership
FamilyOutcome control
Syntaxdisable iff, accept_on, reject_on
Core meaningAbort or force an attempt outcome
Typical mistakeTreating all three as reset
Per-attempt state
A property-local variable belongs to one attempt.
Capture a sampled value in a sequence match item. Every overlapping attempt receives its own copy, which makes local variables useful for correlation but not for global event consumption.
The comma introduces a sequence match item and captures the value when the trigger matches.
Do not use a standalone assignment as if it were a sequence expression.
One response can still satisfy multiple overlapping attempts. Use outstanding-ID state or a scoreboard for one-to-one accounting.
Functions called from assertion expressions should be side-effect-free. Verify tool support for complex dynamic, class, handle, or real-valued constructs.
Open a prompt after studying the reference above. A strong answer should name the sampled edge, match endpoint, failure mode, and proof evidence.
Strong answer
A sequence describes a temporal match. A property turns that match into a Boolean obligation, often with implication, reset, or logical composition. A directive such as assert, assume, or cover tells a tool what to do with the property.
Why it works
Named sequences improve reuse, but a bare sequence used as a property fails whenever it does not match from a sampled start point.
Implication is the usual way to say that a consequent matters only after an antecedent match.
The same property can be asserted in one context, assumed at a formal boundary, or covered to measure reachability.
What the interviewer is testing
Whether you understand the semantic layers and avoid writing a bare temporal sequence when the intended requirement is conditional.
Common trap
The expression err[*2] ##1 alert alone is not a conditional checker. It fails on every start cycle where that complete sequence does not match.
The ## operator concatenates sampled sequence elements by clock ticks, not simulator time units. ##n selects an exact sampled delay, while ##[m:n] permits a match at any sampled delay in the inclusive range.
Why it works
##0 starts the next sequence element at the current sequence endpoint. ##1 advances one sampling event.
A range can create several possible match endpoints. Draw those endpoints before composing it with and, intersect, throughout, or implication.
Use a finite range when the specification has a deadline. An unbounded upper limit may need strong semantics or a separate fairness assumption in formal analysis.
What the interviewer is testing
Whether you count sampled clock events from the antecedent endpoint instead of counting visual spaces or simulation time.
Common trap
Do not read ##2 as two nanoseconds unless the property clock itself advances every nanosecond.
Form
Meaning
Typical use
Form##0
MeaningSame sampled endpoint
Typical useSequence composition
Form##1
MeaningNext sampling event
Typical useNext-cycle response
Form##[1:3]
MeaningAny of the next one to three samples
Typical useBounded latency
Form##[1:$]
MeaningSome later sample
Typical useUnbounded eventual response
##
cycle delay
range
clocking event
Strong answer
or accepts a match from either operand. Sequence and starts both operands together and may finish when the later one ends. intersect also requires both operands to start together, but it requires the same endpoint. throughout and within constrain one sequence across another sequence's span.
Why it works
Use intersect when identical endpoints are part of the requirement, not merely because two conditions must both happen.
expr throughout seq requires expr on every sampled tick occupied by a selected match of seq.
inner within outer requires a complete inner match to fit inside an outer match.
What the interviewer is testing
Whether you reason about start and end points rather than treating temporal and as ordinary Boolean conjunction.
Common trap
Two sequences can both match and still fail intersect because their endpoints differ.
and
or
intersect
throughout
within
Strong answer
Sequence operators such as and, or, and intersect combine temporal matches and therefore have start and endpoint semantics. Property-level not, and, or, and if...else combine truth-valued property expressions. The spelling can look similar, but the object being combined is different.
Why it works
Sequence and permits different endpoints, while sequence intersect requires a common endpoint; property and simply requires both property expressions to succeed.
A property if...else selects one property branch from a sampled Boolean condition, which is useful when operating modes have different legal behavior.
Named properties can be reused and may be recursive, but recursive properties are an advanced feature with progress and operator restrictions; use a positive time advance and verify tool support.
What the interviewer is testing
Whether you can identify the language layer before explaining an operator and avoid applying Boolean intuition to temporal endpoints.
Common trap
Do not assume that sequence and, property and, and Boolean && have identical timing or completion semantics.
Layer
Examples
Primary concern
LayerBoolean
Examples&&, ||, !
Primary concernValue on one sampled edge
LayerSequence
Examplesand, or, intersect
Primary concernTemporal match and endpoint
LayerProperty
Examplesnot, and, or, if...else
Primary concernTruth of an obligation
property logic
if...else
recursive property
sequence
Strong answer
Sequences and properties can be declared in modules, interfaces, programs, clocking blocks, packages, or compilation-unit scope where the language permits them. A bound checker attaches verification logic to a module type or instance without editing the RTL, which keeps reusable interface contracts separate from implementation code.
Why it works
Place white-box assertions near internal invariants when design ownership allows it; place black-box protocol assertions at interfaces or in reusable checker modules.
Binding a module type applies the checker to every matching instance, while an instance-specific bind targets one hierarchy location.
Pass signals through explicit checker ports when possible. Uncontrolled hierarchical references make reuse and integration fragile.
What the interviewer is testing
Whether you can choose an ownership and deployment model for assertions instead of treating their file location as an afterthought.
Common trap
bind changes where the checker is instantiated, not the timing semantics of its properties.