← Design Verification Interviews
Interview Question · Concept
Sequence Operators: AND, OR, Intersect, Within
The Question
The interviewer asks
Explain the difference between s1 and s2, s1 intersect s2, s1 or s2 and s1 within s2 for two sequences that start at the same edge.
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
and needs both sequences to match from the same start. They may end at different edges, and the result ends at the later one. intersect also needs both, but they must end at the same edge, so it constrains length. or needs either one. s1 within s2 needs s1 to match somewhere inside the span of a match of s2, starting no earlier and ending no later.
Both match from edge 1, so and and or match; intersect needs equal lengths; s1 within s2 holds because edges 1-2 lie inside 1-3.
| Operator | Both must match? | End point |
|---|---|---|
s1 and s2 | Yes | The later end |
s1 intersect s2 | Yes, same length | The common end |
s1 or s2 | Either | Each match of either |
s1 within s2 | Yes, s1 inside s2 | The end of s2 |
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer draws two sequences of different lengths. It marks the correct end point for each combined form.
What Interviewers Listen For (Senior)
A good senior answer uses intersect to put a limit on the length of an open-ended sequence. It checks tool support first, and splits the rule into separate assertions when needed.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItCompareScale It
- Sequence Operators: AND, OR, Intersect, Within
-
WhyUsing Intersect to Bound a LengthL2 Mid-LevelL3 Senior
Why would you intersect a sequence with
1[*1:8]?2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
1[*1:8]matches every length from one to eight edges and constrains nothing else. Intersecting with it keeps only the matches of the other sequence that finish within eight edges. It is a compact way to bound something likereq ##1 ack[->1], whose goto could otherwise wait forever.Self-Check
Tick each key point you covered in your answer.
Misconception
"Intersecting with
1[*1:8]delays the sequence by eight cycles."It filters matches by length; it adds no delay.
Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §8.26 (PDF p177)
-
What IfAn Intersect That Never MatchesL2 Mid-LevelL3 Senior
What if the other sequence has no match shorter than 8 edges? What does the intersect give?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
No match at all, because intersect needs both sequences to match with the same start and end. In an antecedent, the property then never triggers and passes vacuously. In a consequent, every attempt fails. Cover the intersected sequence, so you see that it can match.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"Intersect only removes long matches, so it can only remove failures."
It removes matches. In a consequent, losing every match turns the attempt into a failure.
-
CompareOne Sequence AND vs Two AssertionsL2 Mid-Level
Compare
req |-> (##1 ack) and (##3 status)with two assertionsreq |-> ##1 ackandreq |-> ##3 status.2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
As verdicts on each request they agree: both obligations must hold. The single property gives the conjunction an end point, so you can follow it with
##1 donemeasured from the later operand. Two assertions report separately, which makes the failing half obvious in the log. Prefer separate assertions unless something must follow the combined end.And Ends with Its Later OperandOne lane per request for req |-> ((##1 ack) and (##3 stat)) ##1 done.donemust come one edge afterstat, the later operand.attempt startspassfailAll edges- Edge 2 · t=15
A request at 15 starts both operands at once:
ackis due at 25 andstatat 45. - Edge 6 · t=55
ackcame at 25 andstatat 45, so theandends at 45.doneat 55 completes the attempt, which passes. - Edge 9 · t=85
The second request has
ackat 75.donearrives at 85, one edge afterack, but theandhas not ended yet, so thisdonecounts for nothing. - Edge 11 · t=105
statcame at 95, sodonewas due at 105. It is low, and the attempt fails.More context
doneone edge after the earlier operand is not enough. What follows anandis measured from its later end. - Edge 13 · t=125
The third request has no
ackat 125. One operand failed, so theandcannot match, and the attempt fails at once, without waiting forstat.
Read the lanes as text
- req @15, from edge 2 (t=15): passes at edge 6 (t=55).
- req @65, from edge 7 (t=65): fails at edge 11 (t=105).
- req @115, from edge 12 (t=115): fails at edge 13 (t=125).
Sampled values, edge 1 to 15: req 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0; ack 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0; stat 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1; done 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0.
The program behind the lanes
The lanes come from running this program on Verilator 5.052. Each lane is a separate copy of
both_then_donethat can start only at that lane's edge, so every verdict and its edge are read from that copy's own output.module tb; logic clk = 0; always #5 clk = ~clk; // rising edges at 5, 15, 25, ... logic req = 0, ack = 0, stat = 0, done = 0; both_then_done: assert property (@(posedge clk) req |-> ((##1 ack) and (##3 stat)) ##1 done); initial begin @(negedge clk); req = 1; // request at 15 @(negedge clk); req = 0; ack = 1; // ack at 25 @(negedge clk); ack = 0; @(negedge clk); stat = 1; // stat at 45 @(negedge clk); stat = 0; done = 1; // done at 55: in time @(negedge clk); done = 0; req = 1; // request at 65 @(negedge clk); req = 0; ack = 1; // ack at 75 @(negedge clk); ack = 0; done = 1; // done at 85: too early @(negedge clk); done = 0; stat = 1; // stat at 95 @(negedge clk); stat = 0; // no done at 105 @(negedge clk); req = 1; // request at 115 @(negedge clk); req = 0; // no ack at 125 @(negedge clk); @(negedge clk); stat = 1; // stat at 145 @(negedge clk); stat = 0; $finish; end endmoduleBoth operands start together. The attempt fails as soon as either operand fails, or when what follows the later end fails.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"One failure of the
andmeans both halves failed."The
andfails if either operand fails; the report does not say which. Verilator 5.052 even reports one attempt twice when both fail.Source ASIC Point engine notes (Verilator 5.052 SVA probes), "Failing cases of the §7 forms" (and row)
- Edge 2 · t=15
-
Scale ItA Team Policy for Constructs Tools Disagree OnL3 SeniorL4 Staff
Your simulator and your formal tool disagree on some sequence operators. How do you keep a shared assertion library trustworthy?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Probe each operator on every tool with one property that must fail and one that must pass. Record which forms give the standard verdict. Allow only that subset in shared checkers, and enforce it with a lint rule. Rewrite the rest with auxiliary logic or simpler forms. Re-run the probes whenever a tool version changes.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Staff)
A good staff answer treats the supported subset as a versioned list with tests that must fail. A methodology team owns it and measures it again on every tool upgrade.
Tool as Truth
"If the vendor documents the operator, it works."
Silent misbehaviour is the dangerous case: a tool that compiles a construct and never reports its failure passes every test.
Source ASIC Point engine notes (Verilator 5.052 SVA probes)
-
Prove ItWriting a Within Rule for a BurstL2 Mid-Level
Write a property: after
start, exactly oneerr_irqpulse must occur somewhere during the burst, which lasts untillast, inclusive.2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Count instead of combining sequences. A counter clears at
startand addserr_irqwhile the burst is open. Thenlast |-> err_cnt + err_irq == 1checks the total on the last beat. A pure-SVA form built fromerr_irq[=1]andwithina burst sequence is legal but hard to read. On Verilator 5.052 it also uses two constructs that engine cannot run, while the counter runs everywhere and shows up in the waveform.Self-Check
Tick each key point you covered in your answer.
Missed Corner
Writes
start |-> ##[1:$] err_irq ##[1:$] last.That allows any number of extra pulses and is unbounded twice; it checks ordering, not "exactly one".
Source IEEE 1800-2017 §16.9.10
What People Get Wrong
Common wrong answers and why they fail.
Misconception
"and and intersect are the same."
intersect adds the equal-length requirement; with lengths 2 and 3, and matches and intersect never does.
Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §8.27 (PDF p180)
Misconception
"within means s1 happens during the first cycle of s2."
s1 may start and end anywhere inside the span of the s2 match. It must not start before s2 starts or end after s2 ends.
Source IEEE 1800-2017 §16.9.10
Tool as Truth
"Our or and within rules pass in simulation, so they are right."
Verilator 5.052 misses the failures of sequence or and rejects intersect with a variable-length operand. A probe for this batch also saw no failure from a fixed-length within that had to fail.
Source ASIC Point engine notes (Verilator 5.052 SVA probes), rows "sequence or", "intersect", "within"
Buzzword Without Mechanism
Recites the four names but cannot place an end point.
The end point decides what any following ## or implication measures from; without it the operators are just vocabulary.