Skip to SystemVerilog Assertions questions

SystemVerilog Assertions interview preparation

SystemVerilog Assertions (SVA)Concepts and Interview QuestionsYou Should Master

Use this self-contained SVA reference to learn the sampling model, operator semantics, proof controls, waveform reasoning, and reusable protocol checkers before a design verification interview.

Start with the reading method

Read every property as seven explicit decisions.

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 waveform column 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)
All eight columns are sampling events. One ##1 delay moves exactly one column to the right.
Complete request-to-acknowledgement contractSystemVerilog
a_req_ack: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |-> ##[1:3] (ack && !$isunknown(ack))
) else $error("ack missing or unknown: ack=%b", $sampled(ack));

c_last_slot: cover property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) ##1 !ack[*2] ##1 ack
);

Clock. Sampling grid. All eight columns are sampling events. One ##1 delay moves exactly one column to the right.

RequirementSampled tracePropertyDiagnostic + coverage

01 · Sampling modelReason from the sampled clock edge.

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.

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.
FormWhen it evaluatesBest useImportant caution
assert (expr)When procedural control reaches itLocal combinational or algorithmic invariantSimple form can observe transient delta-cycle values
assert #0 / assert finalDeferred within the current time slotSettled combinational resultStill procedural, not a multi-cycle temporal property
assert propertyOn the declared or inherited sampling eventLatency, ordering, stability, pulse, and protocol rulesUses sampled values and can create overlapping attempts
Procedural invariant and temporal contractSystemVerilog
always_comb begin
  a_grant_shape: assert final ($onehot0(grant))
    else $error("grant is not one-hot-or-zero");
end

a_req_ack: assert property (
  @(posedge clk) disable iff (!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.

Report sampled failure contextSystemVerilog
a_state_known: assert property (
  @(posedge clk) disable iff (!rst_n)
  !$isunknown(state)
) else $error(
  "sampled state=%b current state=%b",
  $sampled(state), state
);

Function handbook

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.
FunctionMeaning at this sampleTypical contract
$rose(x)LSB changed from 0/X/Z to 1One attempt per rising event
$fell(x)LSB changed from 1/X/Z to 0Release or completion edge
$stable(x)Whole expression equals its prior samplePayload held under stall
$changed(x)Whole expression differs from its prior sampleState or ownership transition
$past(x, n)Value sampled n clock events earlierHistory and causality
$sampled(x)Value captured for this assertion evaluationAccurate failure message
$onehot(x)Exactly one bit is 1Exactly one owner
$onehot0(x)Zero or one bit is 1Idle-capable one-hot grant
$isunknown(x)At least one bit is X or ZFour-state control integrity
$countones(x)Number of bits equal to 1Population 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.
LocationSeesBest forOwnership risk
RTL moduleInternal state and datapathWhite-box invariantsTight implementation coupling
interfaceProtocol signalsReusable interface contractClock and modport conventions
checker + bindExplicit checker portsNon-invasive integrationAccidental bind to every module instance
formal harnessBoundary inputs and stateAssumptions, assertions, coversOverconstraint
scoreboard/modelTransactions and historyIdentity, ordering, one-to-one accountingNot 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

02 · 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.

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.
LayerQuestion it answersRepresentative syntax
Boolean expressionWhat is true on this sample?req && ready, !$isunknown(state)
SequenceWhat temporal pattern matched?req ##[1:3] ack, beat[*4]
PropertyWhat obligation is true or false?trigger |-> consequent, disable iff
DirectiveWhat should the tool do?assert, assume, cover, expect

Reusable syntax

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
sequence s_req_to_ack;
  $rose(req) ##[1:3] $rose(ack);
endsequence

property p_req_to_ack;
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |-> ##[1:3] $rose(ack);
endproperty

checker req_ack_checker (
  input logic clk, rst_n, req, ack
);
  a_req_to_ack: assert property (p_req_to_ack);
endchecker

bind request_unit
  req_ack_checker i_req_ack_checker (.*);

Operator atlas

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.
FamilySyntaxCore meaningTypical mistake
Delay##0, ##n, ##[m:n]Concatenate sequence elements by sampled clocksCounting simulator time instead of samples
Consecutive repeat[*n], [*m:n]Repeat a Boolean or sequence on consecutive samplesForgetting the implicit ##1 between repeats
Nonconsecutive repeat[=n], [=m:n]Count Boolean hits with gaps and optional trailing slackExpecting the match to end on the last hit
Goto repeat[->n], [->m:n]Count Boolean hits with gaps and end on the final hitApplying it to an arbitrary sequence
Sequence choiceorEither sequence match is sufficientAssuming only one candidate endpoint exists
Sequence conjunctionandBoth start in one compound attempt; later endpoint winsTreating it like Boolean &&
Endpoint conjunctionintersectBoth sequence matches must share an endpointUsing it when different endpoints are legal
Spanexpr throughout seqExpression holds over every sample of the selected matchForgetting the endpoint is included
Containmentinner within outerA complete inner match fits inside outerConfusing containment with implication
Implication|->, |=>Create a conditional property obligationClaiming |=> serializes attempts
Endpoint selectionfirst_match(seq), seq.endedSelect earliest match or observe a named endpointConfusing endpoint selection with transaction ownership
Outcome controldisable iff, accept_on, reject_onAbort or force an attempt outcomeTreating 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.
Capture an ID legallySystemVerilog
property p_tagged_response;
  logic [ID_W-1:0] saved_id;

  @(posedge clk) disable iff (!rst_n)
    ($rose(req), saved_id = req_id)
      |-> ##[1:8] (rsp && rsp_id == saved_id);
endproperty

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.

03 · Implication and timingPlace the consequent on the intended edge.

Draw the trace first, mark the antecedent endpoint, and only then choose overlapped or nonoverlapped implication and any explicit delay.

Concept modelMove one operator and the obligation moves one clock
a |-> b

Overlapped. b starts at the antecedent endpoint.

a |=> b

Nonoverlapped. b starts one sample later.

The operator changes one attempt's timing. It does not block a new antecedent from starting another attempt.

Use the explorer to compare same-cycle, next-cycle, bounded, reset-aborted, and vacuous outcomes against one sampled waveform.

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.

Conditional property

Implication creates an obligation only after an antecedent match.

For every legal antecedent match, the consequent must succeed. If the antecedent has no match from a sampled start point, no consequent obligation is created and the implication succeeds vacuously.
AntecedentConsequentProperty resultInterpretation
No matchNot evaluatedVacuous successNo obligation was created
MatchSuccessSuccessThe obligation was met
MatchFailureFailureThe obligation was violated
MatchPendingPending or end-of-run dependentA future endpoint is still required

Edge arithmetic

Start counting from the selected antecedent endpoint.

Overlapped implication starts the consequent on the antecedent endpoint. Nonoverlapped implication starts it one sampling event later. An explicit delay then advances from that start.
PropertyFor a one-cycle a at sample tb is checked
a |-> bConsequent starts at tAt t
a |=> bConsequent starts at t+1At t+1
a |-> ##1 bOverlapped start plus one delayAt t+1
a |=> ##1 bNonoverlapped start plus one delayAt t+2
a |-> ##[1:3] bThree legal endpointsAt t+1, t+2, or t+3
Same-cycle and next-cycle responseSystemVerilog
a_same_cycle: assert property (
  @(posedge clk) req |-> ack
);

a_next_cycle: assert property (
  @(posedge clk) req |=> ack
);

Candidate matches

Ranges create candidate endpoints, not a single scheduled check.

A ranged sequence can match at more than one endpoint. Each legal antecedent match can create a consequent obligation, and a new trigger can start a separate property attempt before an earlier one finishes.
##[1:4]

Bounded candidates

The first matching endpoint can satisfy a simple response property, but composition may preserve multiple candidate matches.

first_match

Earliest endpoint

Keep the earliest complete sequence match within one attempt. It does not reserve the response event globally.

strong

Required completion

Make an eventual sequence fail if it cannot complete by the relevant end condition. Prefer a finite deadline when the architecture has one.

overlap

Independent attempts

A second trigger starts a second attempt unless a separate admission rule or outstanding-state model forbids it.

Worked trace

Convert the waveform into endpoints before writing code.

For a request at sample 5 with an exact two-cycle contract, acknowledgement must rise at sample 7. A response at sample 6 is early, at sample 8 is late, and no response leaves a bounded property failed.
TriggerContractObserved responseVerdict
req rises at 5exactly +2ack rises at 7Pass
req rises at 5exactly +2ack rises at 6Fail: early response
req rises at 5within 1..3ack rises at 8Pass at latest boundary
req rises at 5within 1..3ack rises at 9Fail: late response
req never riseswithin 1..3ack never risesVacuous success; trigger cover is empty

Interactive timing lab

Move the obligation across the trace.

Select a scenario. The sampled waveform, property, outcome, and explanation update together.

Request and acknowledgement are high together at sample 2, satisfying overlapped implication.
Pass

Overlapped implication checks the antecedent endpoint.

req and ack are both sampled high at clock 2. The consequent of req |-> ack begins on that same sampled edge, so this attempt passes.

Same cycle propertySystemVerilog
a_same_cycle: assert property (
  @(posedge clk) disable iff (!rst_n)
  req |-> ack
);

Pass. req and ack are both sampled high at clock 2. The consequent of req |-> ack begins on that same sampled edge, so this attempt passes.

Waveform casebook

See the operator before memorizing its syntax.

Each column is a sampled positive clock edge. Read left to right: trigger, legal endpoint, then verdict.

Implication

A request receives its response on the next sampled edge.

Pass at t3
$rose(req) |=> ack

The request edge at t2 creates an obligation at t3. ack is high there, so the attempt passes.

Pulse width

A pulse that drops on the next sample is too short.

Fail at t3
$rose(pulse) |=> pulse

pulse rises at t2 but is low at t3. Nonoverlapped implication checks the next sample and exposes the one-cycle-short pulse.

Backpressure

Valid and payload remain stable until ready accepts them.

Held through t3
valid && !ready |=> valid && $stable(data)

The transfer stalls at t1 and t2. valid stays asserted and the Boolean predicate data == A stays true until ready rises at t3.

Consecutive repetition

The error condition holds on two adjacent samples.

Two-sample run
$rose(err) |-> err[*2]

The antecedent starts at t2. Because |-> overlaps, err[*2] consumes t2 and t3 and completes the required consecutive run.

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.

04 · Sequence operatorsKnow what repeats, and where the match ends.

Distinguish consecutive, nonconsecutive, and goto repetition, then combine sequences only when their start and endpoint contracts are clear.

Concept modelThe occurrence count is not the whole contract
b[*3]Consecutive
b[=3]Gaps and trailing slack
b[->3]Ends on final b
Consecutive repetition forbids gaps. Nonconsecutive and goto repetition permit gaps, but only goto repetition ends on its final occurrence.

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.

Repetition handbook

The operator defines both the hit pattern and the match endpoint.

Consecutive repetition can repeat a Boolean expression or a sequence. Nonconsecutive and goto repetition apply to Boolean expressions and allow gaps, but they differ after the final hit.
FormOperandGapsWhere the match ends
b[*3]Boolean or sequenceNoOn the third consecutive repetition
b[*2:4]Boolean or sequenceNoOn a legal second, third, or fourth repetition
b[=3]Boolean expressionYesAt or after the third hit; trailing non-b slack is allowed
b[=3:5]Boolean expressionYesAfter a legal third through fifth hit, with possible trailing slack
b[->3]Boolean expressionYesExactly on the third hit
b[->3:5]Boolean expressionYesOn a legal third through fifth hit

Algebra

Expand repetition when the endpoint is not obvious.

Writing the long form is an excellent interview technique. It exposes the implicit one-sample concatenation between consecutive repetitions.
Equivalent consecutive formsSystemVerilog
a[*3]
// equivalent to
a ##1 a ##1 a

a ##1 b[*3] ##1 c
// equivalent to
a ##1 b ##1 b ##1 b ##1 c

(a ##2 b)[*3]
// equivalent to
(a ##2 b) ##1 (a ##2 b) ##1 (a ##2 b)

Endpoint contrast

Nonconsecutive repetition can wait after the last hit; goto cannot.

Both forms permit gaps between occurrences. The decisive difference appears when another sequence element follows the repetition.
SequenceLegal sampled trace after aReason
a ##1 b[=3] ##1 cb · b · b · · cThree b hits, then trailing non-b slack before c
a ##1 b[=3] ##1 cb · b · b b cIllegal: an extra b occurs in the trailing region
a ##1 b[->3] ##1 cb · b · b cThird b is the repetition endpoint; c is next sample
a ##1 b[->3] ##1 cb · b · b · cIllegal: c is not immediately after the goto endpoint

Sequence composition

Track start points, spans, and endpoints separately.

Sequence composition is temporal. It is not interchangeable with Boolean logic or property-level and/or.
ConstructStart relationshipEndpoint ruleUse
s1 or s2One compound startEither legal endpointAlternative temporal pattern
s1 and s2Same compound startLater successful endpointBoth patterns, different lengths allowed
s1 intersect s2Same compound startCommon endpoint requiredTwo views of one bounded interval
expr throughout seqexpr begins with selected seq matchIncludes every sample through seq endpointHold condition over a known span
inner within outerinner may begin inside outerInner must complete before outer endsTemporal containment
first_match(seq)Same as seqEarliest complete match onlyDeterministic endpoint selection
named_seq.endedNamed sequence's own startTrue on its match endpointAlign another sequence to completion
Inclusive throughout endpointSystemVerilog
a_req_held_to_grant: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |->
    req throughout (gnt[->1])
);

Waveform drills

Minimum width and consecutive-run properties need an event trigger.

Triggering on a level starts an attempt on every high sample. Trigger on the edge when the requirement applies once per pulse or once per run.
RequirementPreferred propertyTraceVerdict
At least 2 sampled clocks high$rose(p) |=> pp: 0 1 0Fail: low on the next sample
At least 2 sampled clocks high$rose(p) |=> pp: 0 1 1 0Pass
Exactly 2 sampled clocks high$rose(p) |-> p[*2] ##1 !pp: 0 1 1 1 0Fail: pulse is too long
Alert after two err samples($rose(err) ##1 err) |=> alerterr: 0 1 1; alert nextOne obligation per err run
Alert for every adjacent pairerr[*2] |=> alerterr: 1 1 1Two overlapping pair obligations

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.

05 · Reset and meaningful proofMake every pass mean something.

Control attempt lifetime with reset, expose vacuity with coverage, and state the assumptions that separate useful formal proof from an overconstrained result.

Concept modelAssert, assume, and cover answer different questions
Must holdassert

Challenge the implementation.

May occurassume

Define a legal environment.

Can occurcover

Demonstrate reachability.

Meaningful proofchecker + honest assumptions + reachable scenario
A checker constrains the implementation, an assumption constrains the modeled environment, and coverage proves that an interesting path is reachable.

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.

Attempt lifetime

Abort, accept, reject, and block are different outcomes.

Choose the control that matches the specification. Reset commonly discards an in-flight attempt; a flush may explicitly accept or reject it; expect waits procedurally for completion.
ConstructCondition observationEffect on active attemptTypical use
disable iff (x)Asynchronous current valueAbort with no pass or failureReset invalidates transaction
accept_on (x)Asynchronous current valueTerminate as successExternal event makes obligation acceptable
reject_on (x)Asynchronous current valueTerminate as failureExternal event makes obligation invalid
sync_accept_on (x)Sampled on property clockTerminate as successClocked acceptance policy
sync_reject_on (x)Sampled on property clockTerminate as failureClocked rejection policy
expect (property)Property sampling semanticsBlock process until success or failureProcedural test scenario

Reset release

Reset abort and post-reset startup are two separate contracts.

disable iff controls whether attempts exist while reset is active. A second property should describe what is legal on and after deassertion.
  • Use |=> when the first protected sample is after the release edge.
  • Use |-> only when the release edge itself is part of the protected interval.
  • A sampled high reset level is not a release event. Use $rose(rst_n) for active-low reset deassertion.
  • Synchronize asynchronous reset release when the design contract requires a clean first active clock.
Three quiet samples after releaseSystemVerilog
a_quiet_after_reset: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(rst_n) |=>
    (!enable && !data_valid)[*3]
);

Verification roles

Assert, assume, cover, and coverage reports answer different questions.

A proof is meaningful only when the checker is correct, the environment assumptions are honest, and the interesting behavior is reachable.
MechanismQuestionWhat it provesWhat it does not prove
assert propertyMust this always hold?No allowed trace violates the property in the analysis scopeThe property fully represents the specification
assume propertyWhat may the environment do?Only assumed-legal traces are explored in formalThe environment will drive that behavior in simulation
cover propertyCan this temporal scenario occur?At least one trace reaches the scenarioAll safety behavior is correct
assertion coverageWas the checker exercised?Attempts, outcomes, and possible vacuity dataValue-space completeness
covergroupWhich values and crosses occurred?Bins and sampled combinationsA multi-cycle protocol path

Meaningful proof

Treat a formal PASS as the end of an audit, not the start of a celebration.

Formal analysis explores all traces allowed by the model and assumptions. The result is only as useful as the proof boundary, clocks, resets, X semantics, fairness, and reachability evidence.
Property

Correct obligation

Review sampled edges, antecedent triggers, endpoints, and overlapping attempts against the written requirement.

Environment

Honest assumptions

Assume only behavior guaranteed by the real integration. Prove or review every assumption source.

Reachability

Useful cover traces

Cover reset release, triggers, earliest and latest legal responses, and states needed to exercise the checker.

Liveness

Completion policy

Prefer finite deadlines. Justify every unbounded eventuality and fairness assumption in plain language.

Cover trigger, completion, and boundarySystemVerilog
c_request_seen: cover property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req)
);

c_latest_legal_ack: cover property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) ##3 $rose(ack)
);

c_state_path: cover property (
  @(posedge clk) disable iff (!rst_n)
  state == S0 ##1 state == S1
              ##1 state == S2
              ##1 state == S3
);

Diagnostics

Action blocks control regression response, not property truth.

The property already passed or failed before its action block runs. Choose severity to match the verification policy and report sampled context that makes the failure reproducible.
TaskTypical policySimulation effect
$fatalCannot continue meaningfullyReport and terminate
$errorRegression failureReport error; simulator normally continues
$warningSuspicious but tolerated conditionReport warning
$infoDiagnostic or progress messageReport information
Pass and fail action blocksSystemVerilog
a_packet_length: assert property (
  @(posedge clk) disable iff (!rst_n)
  sop |-> length inside {[1:MAX_LEN]}
) begin
  packet_checks_passed++;
end else begin
  $error(
    "bad length=%0d at packet start",
    $sampled(length)
  );
end

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.

06 · Protocol patternsDecompose one interface contract at a time.

Check causality, bounded response, stability, exclusivity, and ordering separately so a failure points to one broken rule instead of one dense property.

Concept modelA handshake is several independent obligations
01Causalitygrant has a requestNo orphan response
02Deadlinerequest reaches grantBounded latency
03Stabilityvalid and data holdBackpressure safe
04Accountingone response per IDNo loss or duplication

One dense property can hide which obligation failed. Small contracts produce better diagnostics and compose cleanly.

Request, response, backpressure, payload, and outstanding state each need their own observable contract and failure message.

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.

Protocol method

Split one interface requirement into independent obligations.

A handshake is not one rule. Check trigger shape, causality, response latency, response pulse, stability, admission, and accounting separately so each failure identifies one broken contract.
Causality

No orphan response

Every response must have a legal outstanding cause.

Deadline

Bounded progress

Each admitted request receives a response within the specified sampled window.

Stability

Offer remains valid

Control and payload remain stable while the receiver applies backpressure.

Accounting

No loss or duplication

Each accepted request is consumed by exactly one matching response.

Recipe 01

Exact two-cycle request and acknowledgement.

The request is a one-cycle pulse, acknowledgement rises exactly two samples later, acknowledgement is a one-cycle pulse, and no second request is admitted before completion.
Decomposed exact-latency handshakeSystemVerilog
a_req_one_cycle: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |=> !req
);

a_ack_exact: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |-> ##2 $rose(ack)
);

a_ack_one_cycle: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(ack) |=> !ack
);

a_no_second_req: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |=>
    !$rose(req) until_with $rose(ack)
);

Recipe 02

Every request receives a grant within three sampled cycles.

Trigger once on the request edge and choose whether same-edge grant is legal. This property checks latency, not response ownership.
  • Using req instead of $rose(req) launches a new attempt on every high sample.
  • Overlapping requests create overlapping attempts.
  • One grant event may satisfy several attempts. Add IDs, credits, or outstanding-state accounting when that reuse is illegal.
  • The finite upper bound already catches ordinary lateness. strong matters mainly for unfinished or unbounded eventuality semantics.
Bounded request-to-grant latencySystemVerilog
a_req_granted: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |-> ##[1:3] $rose(gnt)
);

// Use ##[0:3] if same-edge grant is legal.

Recipe 03

Block a second request until the prior grant.

Admission control is separate from response timing. Endpoint choice determines whether a new request is legal on the grant sample.
OperatorDoes p include q sample?Must q eventually occur?
p until qNoNo: weak
p until_with qYesNo: weak
p s_until qNoYes: strong
p s_until_with qYesYes: strong
Single-outstanding admission ruleSystemVerilog
a_single_outstanding: assert property (
  @(posedge clk) disable iff (!rst_n)
  $rose(req) |=>
    !$rose(req) until_with $rose(gnt)
);

Recipe 04

Hold valid and payload while stalled.

The accepting sample is valid && ready. While valid is high and ready is low, the source must preserve the offered transaction into the next sample.
  • ready may legally be high before valid. That is not an error unless the protocol forbids it.
  • After an accepting valid && ready sample, the source may drop valid or present a new back-to-back transfer according to the protocol.
  • $rose(valid) is not always one transaction when valid remains high across back-to-back accepted transfers.
  • Do not make ready progress part of the source stability property unless the system contract guarantees a sink deadline.
Ready-valid source obligationsSystemVerilog
a_hold_valid: assert property (
  @(posedge clk) disable iff (!rst_n)
  valid && !ready |=> valid
);

a_hold_payload: assert property (
  @(posedge clk) disable iff (!rst_n)
  valid && !ready |=> $stable(payload)
);

Recipe 05

Allow five stalled samples and fail on the sixth.

Define stall as valid && !ready. If five consecutive stall samples occur, require the next sample to resolve the stall.
Sampled stall traceVerdictReason
S S S S S RPassFive stalls, resolved on the sixth sample
S S S S S SFailThe sixth consecutive stalled sample is illegal
S S RNo failureThe five-sample antecedent never completes
S S S ready=1No failureAcceptance resolves the stall early
Five-cycle maximum backpressureSystemVerilog
sequence s_stall;
  valid && !ready;
endsequence

a_stall_at_most_five: assert property (
  @(posedge clk) disable iff (!rst_n)
  s_stall[*5] |=> !s_stall
);

Recipe 06

A grant needs a corresponding request model.

The right property depends on whether request is held, pulsed, tagged, and allowed to overlap.
Protocol shapeUseful checkLimitation
req held through gnt$rose(gnt) |-> reqOnly valid when request is still asserted
one pulsed req, bounded grant$rose(gnt) |-> recent request historyHistory does not consume the request
single outstandingTrack outstanding bitCannot represent multiple requests
K outstandingCredit or pending counterCounts do not prove identity
tagged outstandingID set or scoreboardMust handle reuse and duplicate responses

Recipe 07

Correlation is not consumption, and first_match is not FIFO.

A local variable can correlate one request attempt with a matching response value. It cannot reserve or consume that response, so overlapping attempts can still share one event.
  • first_match chooses the earliest endpoint within one attempt. It does not choose the globally oldest request.
  • Unique live IDs can prove identity without requiring FIFO when out-of-order responses are legal.
  • A scalar counter can prove balance and bounds, but not which request a response belongs to.
  • For unbounded eventual response, strong handles end-of-simulation completion; formal liveness also needs justified fairness.
Correlation property plus accounting modelSystemVerilog
property p_matching_response;
  logic [ID_W-1:0] saved_id;
  @(posedge clk) disable iff (!rst_n)
    ($rose(req), saved_id = req_id)
      |-> ##[1:8]
          ($rose(rsp) && rsp_id == saved_id);
endproperty

// For one-to-one or FIFO behavior:
// 1. push every accepted req_id into a reference queue
// 2. require rsp_id == queue.front() when FIFO is required
// 3. pop exactly once per accepted response
// 4. assert no response when the queue is empty

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.

Interview synthesis

Trace it. State the contract. Prove the scenario happened.

  1. 01Draw sampled edges

    Mark the antecedent endpoint and every legal response edge.

  2. 02Separate obligations

    Check causality, timing, stability, and accounting independently.

  3. 03Audit the evidence

    Cover the trigger, review reset aborts, and state formal assumptions.