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
    • The Debug Loop
    • Symptom, Fault and Cause
    • The Cost of a Bug by Stage
    • Guessing vs Searching
    • Meet dbglab
    • A Bug Report Others Can Act On
  • 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
  • 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 0 · What Debugging Is

Part 0 · What Debugging Is · All levels

Part 0 · What Debugging Is

What is debugging, and why does guessing fail?

  • 6topics
  • 6lessons

Topics in this section

  1. 1The Debug Loop1 lesson
  2. 2Symptom, Fault and Cause1 lesson
  3. 3The Cost of a Bug by Stage1 lesson
  4. 4Guessing vs Searching1 lesson
  5. 5Meet dbglab1 lesson
  6. 6A Bug Report Others Can Act On1 lesson
On this page

    Part 0 answers: What is debugging, and why does guessing fail?

    Where Part 0 sits on the debug loop: The whole loop.

    Debugging is a search, and searches have methods. This part sets out the debug loop the whole course uses, the difference between a symptom and its cause, why a bug costs more at every stage, and the running design, dbglab, that you will debug throughout.

    After this part you can

    • Name the nine steps of the debug loop and the cost of skipping each.

    • Tell a symptom from a fault from a cause on a real waveform.

    • Write a bug report someone else can reproduce.

    Lessons in this part

    6 lessons, about 67 min

    1. 1The Debug LoopYou can name the nine steps of the debug loop and what each one produces, and walk a failing regression from the first report to a check that stops the bug coming back.12 min
    2. 2Symptom, Fault and CauseYou can separate a failure into its symptom, its fault and its cause, measure how far apart they are in time, and tell a fix that removes the cause from a patch that only hides the symptom.12 min
    3. 3The Cost of a Bug by StageYou can list the stages from RTL to the field with what a debug run costs and what it shows at each, and explain with a real example why the same bug needs more experiments when visibility shrinks.11 min
    4. 4Guessing vs SearchingYou can write down the suspects and what each possible result of an experiment would rule out, pick the experiment that splits them evenly, and run a halving search over a test's length, a design's history or its stimulus.9 min
    5. 5Meet dbglabYou can draw dbglab from memory, find any register in its map, build its history, run any test in either simulator, and read a PASS or FAIL line and the log it points to.12 min
    6. 6A Bug Report Others Can Act OnYou can write a bug report whose title states the symptom, whose repro command fails on someone else's machine from a clean checkout, and which separates what was observed from what is guessed.11 min

    Revision sheet

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

    The Debug Loop

    • Each step ends with something you can show: a failing line, a repro command, a first wrong value, a prediction, a clean seed sweep, a new check.

    • Reproduce and Prove use the same command. Without a repro, a passing run tells you nothing.

    • A hypothesis is useful only if it predicts a result you have not seen yet. Run that experiment before you edit the RTL.

    Rule of thumb: do not touch the design until you can make it fail on demand, and do not close the bug until that same command passes.

    Symptom, Fault and Cause

    • Symptom: where a check or a user first sees something wrong. Fault: the first wrong value inside the design. Cause: the code or decision that made it.

    • Walk back from the symptom to the first wrong value. Here that is 7,944 cycles, from the scoreboard at cycle 7949 to an X in the FILL register at reset.

    • A fix at the symptom can pass every test you have and still fail in silicon. Fix the cause, then check the fix in a run that could tell the two apart.

    Rule of thumb: the line you change must be the line that made the first wrong value, not the line that reported it.

    The Cost of a Bug by Stage

    • Each stage multiplies the cost of one run, the people involved and the size of the fix. The numbers vary by project; the shape does not.

    • Visibility falls as cost rises: every signal in RTL, pins and scan dumps in silicon. Fewer things seen means more experiments per bug.

    • On dbglab's seed 17, one dump and one script found the first X in under a second; pass or fail only took 11 runs and still named no signal.

    Rule of thumb: find it in the cheapest stage that can show it, and move any later failure back there before you debug it.

    Guessing vs Searching

    • Before an experiment, predict its result. If you are almost sure of it, it buys almost nothing; the most a yes-or-no run can buy is one bit.

    • Halving N suspects takes about log2 N runs: 1,500 operations took 11 here. Random pokes over the same knob took 670.

    • Halving needs a monotone question, like "is the state already wrong after n operations?". Check both ends before you start.

    Rule of thumb: before you run anything, say what each possible result would rule out.

    Meet dbglab

    • dbglab: two masters (CPU port, DMA) share one valid/ready bus to RAM, CSRs, a default slave and a stream peripheral that crosses into pclk.

    • tb/run.sh <test> [seed] [icarus|verilator] prints one PASS or FAIL line; exit 0, 1, or 125 if it does not build. A seed fixes the stimulus.

    • The history has bugs in it on purpose. v0.1 is clean; later commits are not. The course finds the bugs one at a time.

    Rule of thumb: learn the map before you debug: which block, which address, which test checks it.

    A Bug Report Others Can Act On

    • Title the symptom, not your theory: test, what was wrong, where it was seen. A guessed cause in the title steers everyone who reads it.

    • The repro is a command anyone can paste: commit, test, seed, tool and version. Run it from a clean checkout before you file.

    • Say what you ruled out and how (other seeds, the other simulator, the last good commit). It saves the next person repeating it.

    Rule of thumb: if the reader has to ask you a question before they can reproduce it, the report is not finished.

    Practise it

    • Practice question: Counter with wrap and saturate modes

    • Practice question: Waveform debug: a write transaction timeout

    • Code lab: DMA control FSM

    • Practice question: Reset strategies in RTL

    • Code lab: D flip-flop with asynchronous reset

    • Interview: run a mock interview on this topic

    Related topics

    • Course hub

    • Next: Part 1 · Reproduce

    PreviousNext: The Debug Loop

    Up next

    Up nextThe Debug Loop

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Part 1 · Reproduce
    • Part 2 · Observe
    • Part 3 · Localise