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
  • Part 9 · Fix, Prove, Prevent7
    • Fix the Cause, Not the Symptom
    • Proving the Fix
    • The Regression Test That Pins the Bug
    • The Assertion That Would Have Caught It
    • Root-Cause Analysis, Done Honestly
    • Escape Analysis
    • The Bug Write-Up That Teaches the Team
  • 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 9 · Fix, Prove, Prevent

Part 9 · Fix, Prove, Prevent · All levels

Part 9 · Fix, Prove, Prevent

How do I close the bug for good?

  • 7topics
  • 7lessons

Topics in this section

  1. 1Fix the Cause, Not the Symptom1 lesson
  2. 2Proving the Fix1 lesson
  3. 3The Regression Test That Pins the Bug1 lesson
  4. 4The Assertion That Would Have Caught It1 lesson
  5. 5Root-Cause Analysis, Done Honestly1 lesson
  6. 6Escape Analysis1 lesson
  7. 7The Bug Write-Up That Teaches the Team1 lesson
On this page

    Part 9 answers: How do I close the bug for good?

    Where Part 9 sits on the debug loop: Fix, Prove, Prevent.

    A bug is not fixed when the test passes; it is fixed when the cause is gone, the fix is proven, and the next bug like it would be caught earlier. This part covers all three, plus the root-cause and escape analysis that make a team better after every bug.

    After this part you can

    • Tell a fix of the cause from a fix that hides the symptom.

    • Prove a fix with a repro, a seed sweep and a regression test.

    • Run an honest root-cause and escape analysis.

    Lessons in this part

    7 lessons, about 82 min

    1. 1Fix the Cause, Not the SymptomYou can name the cause as the decision that made a bug possible, place each candidate fix on the chain from cause to symptom, and find and run the input where two fixes disagree before choosing one.11 min
    2. 2Proving the FixYou can build the four rungs of proof for a fix, run a seed sweep before and after and read it by signature, count how often the sweep reached the condition, and add a formal check when the claim is about every input.12 min
    3. 3The Regression Test That Pins the BugYou can write a directed test that states a bug's condition, show it fails on the guilty commit and passes on its parent and the fix, run it where it can fail, and name and keep it so it stays useful.11 min
    4. 4The Assertion That Would Have Caught ItYou can write an assertion from the rule a bug broke, bind it where the rule lives, show it fires at the root-cause cycle and is silent on the fix, expose vacuous passes with a cover, and know which SVA forms each tool checks.12 min
    5. 5Root-Cause Analysis, Done HonestlyYou can run a five-whys analysis where each answer has evidence, follow both the mechanism and the escape, recognise the three dishonest endings, and test proposed actions against the history.12 min
    6. 6Escape AnalysisYou can reconstruct the verification that existed at a bad commit, place each escape at the gate it slipped through with a real run, and turn the result into measurable changes to the verification plan.12 min
    7. 7The Bug Write-Up That Teaches the TeamYou can write a bug write-up with a summary, exposure, mechanism, root cause, escape, fix, proof and prevention, each backed by a command, and end it with one lesson that applies beyond this bug.12 min

    Revision sheet

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

    Fix the Cause, Not the Symptom

    • Every candidate fix makes the failing seed pass. That is the entry ticket, not the evidence.

    • Size a fix to the specification of the input, never to the values your tests happened to make.

    • Before choosing between two fixes, find the input where they disagree, write a test for it and run both.

    Rule of thumb: a fix is the cause fix only if it holds for every input the specification allows.

    Proving the Fix

    • Same command as the repro first, in both simulators. Then the shrunk repro, which tests the mechanism without the noise.

    • A sweep means nothing without the same sweep before the fix. Sort both by signature and count how often the bug's condition was reached.

    • When the claim is "for every input", sampling cannot prove it. A short formal check on the real RTL can, in seconds.

    Rule of thumb: a fix is proven when every rung that could have failed it was run, before and after, with the counts written down.

    The Regression Test That Pins the Bug

    • A pin is proven at three points: it passes on the parent commit, fails on the guilty commit, and passes on the fix.

    • A seed reaches the bug by luck. A directed test states the condition, so a change to the random test cannot take it away.

    • Run the pin where it can fail. A test that passes on the buggy commit in your nightly simulator pins nothing.

    Rule of thumb: do not close a bug until a test that names its condition fails on the commit that caused it.

    The Assertion That Would Have Caught It

    • Write the assertion from the specification of the rule, never from the fix or the buggy line: then it means the same before and after.

    • Prove it three ways: it fires on the buggy commit at the cause, it is silent on the fix across the regression, and a cover shows it was not vacuous.

    • Check what your tools check. Icarus 13 compiles no concurrent SVA; Yosys 0.69 ignores bind; Verilator is two-state, so X checks never fire there.

    Rule of thumb: an assertion you have not seen fail, and seen not vacuous, protects nothing.

    Root-Cause Analysis, Done Honestly

    • Every why needs evidence you can show: a run, a diff, a log line. An answer you cannot show is a guess; mark it and go and get the evidence.

    • Ask two chains: why did the bug happen, and why did it get through. They fork at the commit and usually end at different causes.

    • Stop at something you can change and check. "Be more careful" fails both tests; "block a commit that adds a failing run" passes them.

    Rule of thumb: a root cause is something you can change, and you have shown that changing it would have stopped this bug.

    Escape Analysis

    • A bug gets through one of four gates: not planned, planned but never reached, reached but not checked, checked but nobody acted. Name the gate.

    • Prove the gate with a run at the bad commit: a coverage count of zero, a check that would have fired, a regression diff nobody read.

    • Each plan change must be measurable and must catch this bug when you put it back. One test per escape pins one bug; a goal per gate catches its siblings.

    Rule of thumb: replay verification as it was at the bad commit; today's tests tell you nothing about why it escaped.

    The Bug Write-Up That Teaches the Team

    • The report asks someone to act; the write-up records the answer after the fix is proven. Write it for a reader who was not there.

    • Every claim carries the command that shows it. Exposure says exactly which inputs and which versions are affected, not "long transfers".

    • End with one lesson that changes how people write new code, plus the checks added. If nothing generalises, say why.

    Rule of thumb: if a reader of the write-up could make the same mistake tomorrow, the write-up is not finished.

    Practise it

    • Practice question: Counter with wrap and saturate modes

    • Code lab: DMA control FSM

    • Practice question: Random stability and post-repair safety

    • Practice question: Debugging rare seed failures in regression

    • Code lab: Bind assertion

    • Interview: run a mock interview on this topic

    Related topics

    • Course hub

    • Previous: Part 8 · Intermittent Failures

    • Next: Part 10 · Case Studies

    PreviousNext: Fix the Cause, Not the Symptom

    Up next

    Up nextFix the Cause, Not the Symptom

    Sign in to save progress

    Practice this lessonReport an error

    See also

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