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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Part 0 · What Debugging Is6
  • Part 1 · Reproduce8
  • Part 2 · Observe9
  • Part 3 · Localise10
  • Part 4 · Hypothesise and Test6
  • Part 5 · Bug Classes16
  • Part 6 · Debug by Stage9
  • Part 7 · Hangs and Deadlocks7
  • Part 8 · Intermittent Failures7
    • Why Intermittents Happen
    • Making the Rate Go Up
    • Capturing the Rare Event
    • Statistics of Rare Failures
    • Ordering-Dependent Bugs
    • Heisenbugs
    • An Intermittent on dbglab
  • Part 9 · Fix, Prove, Prevent7
  • Part 10 · Case Studies12
  • Part 11 · Debug as a Team5
  • Part 12 · Interview Prep5
Loading lesson

‹The Art of Hardware Debug
  1. Topics
  2. The Art of Hardware Debug
  3. Part 8 · Intermittent Failures

Part 8 · Intermittent Failures · All levels

Part 8 · Intermittent Failures

It fails once a day. How do I catch it?

  • 7topics
  • 7lessons

Topics in this section

  1. 1Why Intermittents Happen1 lesson
  2. 2Making the Rate Go Up1 lesson
  3. 3Capturing the Rare Event1 lesson
  4. 4Statistics of Rare Failures1 lesson
  5. 5Ordering-Dependent Bugs1 lesson
  6. 6Heisenbugs1 lesson
  7. 7An Intermittent on dbglab1 lesson
On this page

    Part 8 answers: It fails once a day. How do I catch it?

    Where Part 8 sits on the debug loop: Reproduce, Observe.

    Intermittent failures defeat every method that needs a reliable repro, so the first job is to make them less intermittent. This part raises the failure rate, captures the rare event when it happens, and uses statistics to decide when a fix is really a fix.

    After this part you can

    • Raise the failure rate of a rare bug by changing what stresses it.

    • Capture a rare event with triggers and a flight recorder.

    • Calculate how many clean runs prove a fix to a stated confidence.

    Lessons in this part

    7 lessons, about 73 min

    1. 1Why Intermittents HappenYou can name the five usual hidden inputs behind an intermittent failure, tell from its rate and pattern which one is likely, and make that input explicit in a simulation so it fails on demand.11 min
    2. 2Making the Rate Go UpYou can score a stress in failures per unit of simulation time, pick the stress from the state the bug needs, sweep clock ratios and phases, and keep the stressed setting as the repro and the proof.10 min
    3. 3Capturing the Rare EventYou can build a ring-buffer flight recorder sized to the detection latency, choose between a symptom, a precursor and a cause as the trigger, and dump only the windows a trigger opens.10 min
    4. 4Statistics of Rare FailuresYou can calculate how many clean runs show a fix to a stated confidence, bound the rate left after a clean sweep, put an interval on a measured rate, and test whether two rates differ.9 min
    5. 5Ordering-Dependent BugsYou can list the independent events behind an ordering failure, enumerate their possible orders as directed runs, read the failing cells as a specification of the bug, and prove a fix in every order.11 min
    6. 6HeisenbugsYou can recognise when observation changed the run, name the three usual ways it does (time, randomness, side effects), and observe with a passive monitor whose run is identical to the quiet one.10 min
    7. 7An Intermittent on dbglabYou can take an intermittent from a measured rate to a deterministic directed repro, catch its precursor with a probe, fix the cause, and prove the fix with a stated bound on seeds that never ran before.12 min

    Revision sheet

    The part on one page, taken from each lesson's Remember box.

    Why Intermittents Happen

    • Hardware does not fail at random. Something differs between a passing run and a failing one; the job is to find what.

    • Unrelated clocks: the ratio sets the failure rate and the phase decides which events fail. Silicon picks a new phase at every power-up.

    • An unreset flop takes the value its simulator gives it: X, 0 or random. Only random start values behave like a chip.

    Rule of thumb: before chasing an intermittent, write down which input you think differs between passing and failing runs, and how you will control it.

    Making the Rate Go Up

    • Score a stress in failures per simulated millisecond (or per CPU hour), not per run: a longer run fails more often and costs just as much more.

    • Shape beats amount: the same 10% of stalled cycles in bursts gave 97 times the yield of single-cycle stalls.

    • At a 1:1 clock ratio the phase decides everything: 57% or 10% for the same setting. Sweep the phase, never just one ratio.

    Rule of thumb: ask what state the bug needs, then stress that state, one knob at a time, measured in failures per unit of cost.

    Capturing the Rare Event

    • A flight recorder costs little and is always on; the failing check freezes it. Make it deeper than the time from cause to detection.

    • Trigger on the earliest cheap sign you have. A precursor fires more often than the bug: count its false triggers and accept them.

    • Dump windows, not runs: four 40-cycle windows held both failures in 27 KB; the full dump of the same run was 55 MB.

    Rule of thumb: never wait for a rare failure with nothing recording; arm a recorder and a trigger first, so the next occurrence is the last one you need.

    Statistics of Rare Failures

    • To see a bug of rate p at least once with 95% confidence you need about 3/p runs: 29 for 10%, 299 for 1%, 2,995 for 0.1%.

    • After n clean runs the rate is below about 3/n at 95% (the rule of three). A clean sweep bounds the bug; it never proves zero.

    • Prove a fix on the stressed repro first: at 88% per run, 2 clean runs say as much as 29 at the default 10%.

    Rule of thumb: state the confidence and the rate you are ruling out before you start the sweep, and size the sweep from them.

    Ordering-Dependent Bugs

    • An ordering bug needs event B before event A, or both in one cycle. Random stimulus reaches that order only when latencies happen to line up.

    • Make each event's timing a knob and run every order: a small grid of directed runs beats a thousand random seeds.

    • The failing cells are the bug's specification. A fix must pass every cell, and the random test stays to find orders you did not list.

    Rule of thumb: when a failure depends on timing, name the two events, make their order a knob, and run every order before you change the design.

    Heisenbugs

    • If a failure disappears when you add observation, suspect the observation first: compare the quiet and the observed run before believing either.

    • Debug code must not take time from the driver, draw from the stimulus generator or read anything with a side effect.

    • A passive monitor watches the pins, samples at the edge and drives nothing. Check it: the FAIL line must be identical with it on and off.

    Rule of thumb: observation must leave the failing line identical, cycle for cycle; check that before you trust what it shows.

    An Intermittent on dbglab

    • Turn a rate into an order: the zero fill first fails 20 seeds in 20, the pattern fill first passes 20 in 20. That is the repro and the first half of the proof.

    • A precursor fires where the symptom cannot: the probe flagged the unwritten FILL in Verilator, which passes because its flops start at 0.

    • Prove on the repro, then on old and fresh seeds: 1,000 fresh clean seeds bound the rate below 0.30%. Making the bench pass is not a fix.

    Rule of thumb: an intermittent is closed when the ordered repro, the old failing seeds and a sweep of fresh seeds all pass, and something in the regression would catch it again.

    Practise it

    • Practice question: Waveform debug: missing pulse in CDC due to narrow pulse width

    • Practice question: Pulse synchroniser: stretching pulses across clock domains

    • Practice question: D flip-flop with asynchronous reset

    • Code lab: CDC pulse stretch

    • Code lab: DFF async reset

    • Interview: run a mock interview on this topic

    Related topics

    • Course hub

    • Previous: Part 7 · Hangs and Deadlocks

    • Next: Part 9 · Fix, Prove, Prevent

    PreviousNext: Why Intermittents Happen

    Up next

    Up nextWhy Intermittents Happen

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Part 0 · What Debugging Is
    • Part 1 · Reproduce
    • Part 2 · Observe