Skip to Timing + operators questions

Part 2 · Timing and operators

SystemVerilog AssertionsImplication, endpoints, and repetition

Place obligations on exact sampled edges, inspect pass and failure waveforms, and distinguish the sequence operators that control occurrence and match endpoints.

Question directory

Questions for Timing + operators

Open a question at its supporting explanation. The complete property reference stays directly above each answer set.

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.

Strong answer

Overlapped implication, |->, starts the consequent at the antecedent endpoint. Nonoverlapped implication, |=>, starts the consequent on the sampling event after the antecedent ends.

Why it works

  • For a one-cycle antecedent, a |=> b aligns with a |-> ##1 b when both use the same property clock.
  • For a multi-cycle antecedent, count from the selected antecedent match endpoint, not from its first cycle.
  • An explicit ## delay belongs to the consequent sequence and shifts the actual Boolean test from that starting point.
What the interviewer is testing

Whether you can place the consequent exactly on a trace and state the limited case in which two formulations are equivalent.

Common trap

Do not memorize |-> as current cycle and |=> as next cycle without considering a multi-cycle antecedent endpoint.

PropertyFirst b sample for one-cycle aMeaning
a |-> bSame sampled edgeOverlapped
a |=> bOne sampled edge laterNonoverlapped
a |-> ##1 bOne sampled edge laterExplicit delayed consequent
  • |->
  • |=>
  • antecedent
  • consequent

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.