Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
    • Sequence Puzzles
      • Exact Delay Then Bounded Hold
      • Goto Repetition With Sparse Events
      • Nonconsecutive Repetition [=2]
      • Sequence and Operator
      • first_match in an Antecedent
      • within Window Length Off-By-One
    • Implication Puzzles
    • Temporal Corner Puzzles
    • Assertion Debug Puzzles
    • SVA Assertion Puzzles: Tricky Q&A
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Sequence Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. SVA Assertion Puzzles
  4. Sequence Puzzles
  5. Nonconsecutive Repetition [=2]
On this page

    VLSI DV Interview PuzzlesAll levels

    Nonconsecutive Repetition [=2]

    Property intent: after start, match two nonconsecutive a occurrences, then done one cycle after the match ends. Timeline (all other samples are 0, so a=0 at C30, C32, C34 and later): C30 start=1, C31 a=1, C33 a=1, C35 d1. Determine the verdict, and say what a[->2] would do with the same waveform.

    Puzzle

    Difficulty: Hard · Puzzle 3 of 6 · Topic: Sequence Puzzles

    Property intent: after start, match two nonconsecutive a occurrences, then done one cycle after the match ends. Timeline (all other samples are 0, so a=0 at C30, C32, C34 and later): C30 start=1, C31 a=1, C33 a=1, C35 done=1. Determine the verdict, and say what a[->2] would do with the same waveform.

    Code

    design.sv
    property p_seq_nonconsecutive;
      @(posedge clk) start |-> a[=2] ##1 done;
    endproperty

    Hint

    [=2] is goto repetition plus any number of trailing cycles where a stays low. List every cycle where the match can end.

    Step-by-step solution

    Diagram
    1) start triggers at C30. a[=2] counts the two a samples at C31 and C33.
    2) Unlike [->2], a[=2] may keep matching after the second a for as long as a stays low, so its legal end points are C33, C34 and C35 (until the next a).
    3) ##1 done needs done one cycle after one of those end points. Taking the end at C34, done must be at C35, and it is.
    4) So the sequence matches and the property passes. With a[->2] the only end point is C33, done would be needed at C34, and the same waveform would FAIL.
    5) Tool note: some free tools (for example Verilator 5.048) reject [=n] followed by ##; reason with end points or use a full SVA simulator.

    Answer

    Answer: PASS - the two a matches occur, and done is observed one cycle after the legal end point C34 of the [=2] match (a[->2] would FAIL here).

    How this was checked

    Checked by running a model of the rule in Verilator 5 and a Python model. Verilator runs a[->2] spelled out as a gap-tolerant pair of hits: it ends on the second a (C33), so done is needed at C34 and the check fails. A small model of the LRM end-point semantics (it also reproduces the Verilator verdicts above): [=2] has several legal end points, so it passes where [->2] fails.

    Why candidates get it wrong

    [=n] is [->n] plus a tail of non-a cycles, so its end point is flexible while [->n] ends exactly on the n-th a. This waveform is passed by [=2] and failed by [->2], which is why done at C35 is legal here.

    Interviewer follow-up

    Would adding an extra a pulse at C34 still pass? Model answer: No, it FAILS. With a high at C34 the tail of low cycles stops at C33, so the only legal end of a[=2] is C33, ##1 done requires done at C34, and done is at C35. (A third a before the second match ends, for example a also high at C30, also breaks the exactly-two count.)

    Say it out loud

    I would list the a hits at C31 and C33, then done at C35. With the nonconsecutive repetition the match can end at C33, C34 or C35 while a stays low, so the end at C34 followed by done at C35 is legal and the property passes. The goto form ends only on the second a, so it would need done at C34 and would fail on this same waveform. The trap is treating the two operators as the same; I would check which end point the spec really means.

    Related topics

    • Repetition: [*], [->], [=]

    • Back to Sequence Puzzles

    • SVA Assertion Puzzles section

    Previous

    113 / 293

    Next: Sequence and Operator

    Up next

    Up nextSequence and Operator

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Exact Delay Then Bounded Hold
    • first_match in an Antecedent
    • within Window Length Off-By-One