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
    • The First Wrong Cycle
    • Bisection in Time
    • Bisection in Space
    • Bisection in Stimulus
    • Bisection in History
    • Bisection Across Configurations and Seeds
    • Cone-of-Influence Tracing
    • Differential Debugging
    • When the Bug Is in the Test
    • The Localisation Checklist
  • 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 3 · Localise

Part 3 · Localise · All levels

Part 3 · Localise

Where and when did it first go wrong?

  • 10topics
  • 10lessons

Topics in this section

  1. 1The First Wrong Cycle1 lesson
  2. 2Bisection in Time1 lesson
  3. 3Bisection in Space1 lesson
  4. 4Bisection in Stimulus1 lesson
  5. 5Bisection in History1 lesson
  6. 6Bisection Across Configurations and Seeds1 lesson
  7. 7Cone-of-Influence Tracing1 lesson
  8. 8Differential Debugging1 lesson
  9. 9When the Bug Is in the Test1 lesson
  10. 10The Localisation Checklist1 lesson
On this page

    Part 3 answers: Where and when did it first go wrong?

    Where Part 3 sits on the debug loop: Localise.

    The fastest debuggers do not read more; they cut the search space in half, again and again. This part bisects in time, in the design hierarchy, in the stimulus, across configurations and across version history, then traces the cone of logic behind the first wrong signal.

    After this part you can

    • Walk back from a scoreboard error to the first wrong cycle.

    • Find the commit that introduced a bug with git bisect in a handful of steps.

    • Trace the fan-in cone of a wrong signal to a short list of suspects.

    Lessons in this part

    10 lessons, about 112 min

    1. 1The First Wrong CycleYou can write a symptom as signal, cycle, actual and expected, walk it back hop by hop to the first cycle where an input is right and the output wrong, and spot missing events on the way.11 min
    2. 2Bisection in TimeYou can choose a state question whose answer changes once, check it at both ends, bisect the cycle at which to ask it, and hand the last few cycles to a walk back.11 min
    3. 3Bisection in SpaceYou can list the blocks on a failing path, place interface monitors that check each boundary's own rules, read their first-breach times, and find the block whose inputs are clean while its outputs are wrong.12 min
    4. 4Bisection in StimulusYou can tag recorded stimulus by class and source, halve the classes to find the ones a failure needs, split further by an attribute, and group failing seeds by the class that triggers them.11 min
    5. 5Bisection in HistoryYou can check that bisection applies, run git bisect with a script whose exit code means good, bad or skip, read each step of its log, and confirm the guilty diff explains the symptom.11 min
    6. 6Bisection Across Configurations and SeedsYou can list a failure's configuration dimensions, bisect the ordered ones, build a one-change-at-a-time matrix for the rest, and read the pattern into a bug class while spotting passes that prove nothing.12 min
    7. 7Cone-of-Influence TracingYou can list the fan-in cone of a wrong signal one register stage at a time with Yosys, prune each stage with values from the failing run, and recognise when the cause is a register, the logic between, or a missing input.12 min
    8. 8Differential DebuggingYou can choose a reference (model, previous release, other simulator or configuration), list how it may legitimately differ, compare often enough to see the first disagreement, and read what each disagreement points to.10 min
    9. 9When the Bug Is in the TestYou can decide whether a failure is in the design or the bench by checking both against the spec at the first wrong cycle, recognise the common bench bugs by their signatures, and prove a fixed checker still catches a real bug.11 min
    10. 10The Localisation ChecklistYou can take a reproduced failure through nine localisation checks, say what finishes each one, and hand over one sentence naming the first wrong signal, its cycle, its module and the change that made it.11 min

    Revision sheet

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

    The First Wrong Cycle

    • Each hop asks one thing: given its inputs at that cycle, is this value right? If an input is wrong, it becomes the next symptom.

    • Stop where every input is right and the output is wrong. That cycle and that line are the place to hypothesise about.

    • A value can be wrong because something never happened. Then the next hop is the event that should have written it.

    Rule of thumb: judge every hop against what the design was meant to do, never against what its code happens to do.

    Bisection in Time

    • The question must flip once: clean before some cycle, bad after it. Check both ends first; reset and later overwrites can break that.

    • Each look must leave the run unchanged up to its cycle. Read state from the side, never through the bus the design uses.

    • Bisection finds the first cycle your question can see. A sharper question sees earlier; then walk back the last hops.

    Rule of thumb: if you can check every cycle cheaply, do that in one run; bisect in time when each look is costly.

    Bisection in Space

    • A monitor checks its interface's own rules (known controls, known data when valid, order), so it needs no model of the whole design.

    • Compare first-breach times, not yes or no. A wrong value can echo backwards through feedback, like FIFO pointers, and breach upstream later.

    • The block to open is the one whose inputs were clean at the moment its outputs first went wrong. Then halve inside it the same way.

    Rule of thumb: blame the side that drives the breaching signal at the earliest breach, never simply the upstream side.

    Bisection in Stimulus

    • Split by kind, not by position: source (CPU, DMA), operation type, mode, length. The answer names a feature of the design, not a line of one test.

    • Removing a class must not quietly change the classes you keep. Dropping traffic also drops time; make the replay wait instead of skip.

    • Run the split on every failing seed. Seeds that need the same class are probably one bug; classes that share an attribute point at the shared logic.

    Rule of thumb: a class is needed only if removing it makes the same failure go away, with everything else replayed exactly as before.

    Bisection in History

    • Bisection needs a known good version, a known bad version and a test that tells them apart on its own. Check both ends before you start.

    • Each test halves the suspects: 11 commits take 4 runs, 1,000 take 10. The script's exit code is the answer: 0 good, 1 bad, 125 skip.

    • Bisect answers "when did this test start failing", which is not always "when did this bug arrive". Test for the bug's own signature.

    Rule of thumb: never trust a bisect whose test can fail for more than one reason.

    Bisection Across Configurations and Seeds

    • Ordered dimensions (commits, numeric parameters, tool versions) can be bisected to a boundary. Unordered ones (simulators, option sets, seeds) are compared in a matrix.

    • Read the pattern: failing everywhere means logic; only with X or random start values, uninitialised state; a failure that moves with a parameter, a path.

    • A pass means "not seen with this configuration and this stimulus". Check the test still tests the feature, and push the stimulus past the new limit.

    Rule of thumb: change one dimension at a time from a failing configuration, and never read a pass as a fix until the stimulus reaches the new boundary.

    Cone-of-Influence Tracing

    • Take the cone one stage at a time. The whole transitive cone of an output is usually most of the design; one stage is a handful of registers.

    • Clear a suspect only with a value from the failing run at the right cycle. A cleared register removes its whole cone from the search.

    • If every register behind a wrong value was right, the cause is the logic between them, or an input the logic should have and does not.

    Rule of thumb: never read the RTL behind a wrong signal before you have its stage-one suspect list and a value for each suspect.

    Differential Debugging

    • A reference is only as useful as the list of ways it is allowed to differ. Write that list first; everything else in the diff is evidence.

    • Compare on every beat if you can. An end-of-test compare can pass a design that was wrong for most of the run.

    • Which references disagree is itself a clue: tool-independent bugs agree everywhere; X and initial-state bugs split the simulators.

    Rule of thumb: never diff two runs until you can say, in one sentence, every way they are supposed to differ.

    When the Bug Is in the Test

    • A FAIL is a disagreement. The spec, not the design and not the bench, decides which side is wrong.

    • Ask where the expected value came from. A checker that records its own reasoning answers that in one line.

    • After fixing a checker, prove it still fails on a design with a real bug. A checker that passes everything is the worst bench bug of all.

    Rule of thumb: never change an expected value until you can quote the line of the spec that says the old one was wrong.

    The Localisation Checklist

    • Localise is finished when you can name one signal, one cycle and one module where the values first go wrong, and the checker is cleared.

    • Cheap references first: the commit before, the other simulator, the other configuration. Each takes a minute and can cut the search to one change or one class of bug.

    • Walk the cone from the first wrong value, pruned by values, and check the checker before you blame the design.

    Rule of thumb: do not start Hypothesise until you can write the first wrong signal, cycle and module in one sentence.

    Practise it

    • Practice question: Counter with wrap and saturate modes

    • Practice question: Design a simple DMA controller

    • Code lab: DMA control FSM

    • Practice question: Inline RTL checkers: X/Z detection, liveness and bindable monitors

    • Code lab: Isolation cell model

    • Interview: run a mock interview on this topic

    Related topics

    • Course hub

    • Previous: Part 2 · Observe

    • Next: Part 4 · Hypothesise and Test

    PreviousNext: The First Wrong Cycle

    Up next

    Up nextThe First Wrong Cycle

    Sign in to save progress

    Practice this lessonReport an error

    See also

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