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
    • Reading a Waveform with a Question
    • Dump Strategy
    • Logging That Helps
    • Assertions as Always-On Probes
    • Scoreboards Report Late
    • Comparing a Good and a Bad Run
    • X in a Waveform
    • Counters and Performance Probes
    • Observability by Design
  • 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 2 · Observe

Part 2 · Observe · All levels

Part 2 · Observe

How do I see what the hardware actually did?

  • 9topics
  • 9lessons

Topics in this section

  1. 1Reading a Waveform with a Question1 lesson
  2. 2Dump Strategy1 lesson
  3. 3Logging That Helps1 lesson
  4. 4Assertions as Always-On Probes1 lesson
  5. 5Scoreboards Report Late1 lesson
  6. 6Comparing a Good and a Bad Run1 lesson
  7. 7X in a Waveform1 lesson
  8. 8Counters and Performance Probes1 lesson
  9. 9Observability by Design1 lesson
On this page

    Part 2 answers: How do I see what the hardware actually did?

    Where Part 2 sits on the debug loop: Observe.

    Most debugging time is spent looking at the wrong signals. This part reads waveforms and logs with a question in mind, places probes where they pay, compares a good run with a bad one, and makes designs observable before they need to be.

    After this part you can

    • Read a waveform to answer one question, not to browse.

    • Find the first difference between a passing and a failing run with a script.

    • Choose dumps, logs, assertions and counters that will answer the next question.

    Lessons in this part

    9 lessons, about 95 min

    1. 1Reading a Waveform with a QuestionYou can turn a failure message into one written question, choose the lanes and cycles it needs, judge each lane right or wrong, and move the question when the window holds no wrong input.11 min
    2. 2Dump StrategyYou can turn dumping on per run, pick the scope and the window from the question, rerun a deterministic failure with the dump opened at the right event, and estimate what a dump will cost before taking it.11 min
    3. 3Logging That HelpsYou can write log lines with a cycle, a level, a source, an id and key=value fields, choose verbosity levels by reader, and answer a debug question from a log with a grep or awk one-liner.10 min
    4. 4Assertions as Always-On ProbesYou can choose where an assertion pays (where a value is created, not where it is used), write it so its message names the rule and values, bind it without touching the RTL, and make sure the simulator is really running it.10 min
    5. 5Scoreboards Report LateYou can read a scoreboard message as a symptom, estimate how late it reports and why, and add a per-transaction or in-order check that reports at the transaction that went wrong.11 min
    6. 6Comparing a Good and a Bad RunYou can set up a good and a bad run that share their stimulus, diff their logs, find the first signal and cycle where two VCD files disagree with a script, and tell a cause from its echoes.10 min
    7. 7X in a WaveformYou can explain what X means in simulation, name its usual sources, spot where an if/else hides one, and place an $isunknown check where a value is used so the X is caught when it is created.11 min
    8. 8Counters and Performance ProbesYou can choose event counters, occupancy high-water marks and latency histograms for a performance or hang question, read them to find a bottleneck or a stuck stage, and spot when a total hides a tail.10 min
    9. 9Observability by DesignYou can choose the debug features a block needs before tape-out, estimate their area and verification cost, review a design against a checklist, and specify a sticky-error and trace-ring block that keeps the first failure.11 min

    Revision sheet

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

    Reading a Waveform with a Question

    • Before you open the waveform, write the question: which signal, which cycle, what value you expected.

    • Keep the lanes the questioned signal is computed from. A lane you cannot call right or wrong does not belong on the screen.

    • If every input is right in the window, or wrong in every slot, the cause is outside the window. Ask a new question about an earlier cycle.

    Rule of thumb: if you cannot say what value a lane should have, it is not part of your question.

    Dump Strategy

    • Dump size grows with scope times time. Narrow one so you can afford the other: one word for the whole run, or the whole design for a few hundred cycles.

    • Open the window at the event your question is about, not a round number of cycles before the failure.

    • A deterministic failure is cheap to run twice: once without a dump to learn the cycle, once with the window you need.

    Rule of thumb: never dump everything from time zero unless the run is short enough that it does not matter.

    Logging That Helps

    • One event per line, starting with the cycle, then level, source and id, then key=value fields in a fixed order.

    • Use the ids the bench already prints, so a log line and a FAIL message can be joined with one grep.

    • Log at transaction boundaries, not inside every always block, and choose levels so the default log stays readable.

    Rule of thumb: if you cannot grep for it, you did not log it.

    Assertions as Always-On Probes

    • Place a check where a wrong value is first created, such as a register loading from its inputs, not where the value is finally consumed.

    • A failing assertion's message should be a bug report: the rule, the cycle, the value it saw and the value it expected.

    • Icarus 13 rejects or silently drops concurrent SVA. Run assertions in a simulator that executes them, or write the same rule as clocked code.

    Rule of thumb: an assertion that cannot fire in your simulator is not a probe; prove it fires once before you trust its silence.

    Scoreboards Report Late

    • A scoreboard reports when it next observes the damage, not when the damage is done. The gap depends on the stimulus, not the bug.

    • "Last written by" in a message is the model's belief. Check that the hardware agrees before you open that transaction.

    • Check each transaction when it completes, in order where order is defined, and keep the end-of-test compare as the backstop.

    Rule of thumb: never start a hunt at the scoreboard's cycle; start at the transaction it blames, and check that it really happened.

    Comparing a Good and a Bad Run

    • Diff runs that share their stimulus: the same test and seed on two commits, or two simulators. Two seeds differ from the first cycle and tell you nothing.

    • Log the bus, not just the verdict. A diff of PASS against FAIL has one line; a diff of transactions points at a cycle.

    • The first difference is not always the cause. Sort differences by when they start and when they heal; follow the one still open when it reaches a value something uses.

    Rule of thumb: compare like with like: one change between the runs, the same stimulus, and follow the first difference that is still open when something uses it.

    X in a Waveform

    • X means unknown: the chip will have a 0 or a 1 there, and the simulation cannot say which. It never means "don't care".

    • An if/else on an X condition takes the else branch and shows a clean value. A clean output does not prove a clean input.

    • Check for X where a value is used (bus write data, enables, selects), not only at the scoreboard, which may read it thousands of cycles later.

    Rule of thumb: treat every X that reaches a control or an output as a bug until a reset or a write proves it harmless.

    Counters and Performance Probes

    • Pair every work counter with a wait counter: handshakes and cycles spent waiting for one. Their ratio is where the time goes.

    • Totals and averages hide tails. Keep a histogram with power-of-two buckets and a maximum for any latency someone cares about.

    • In a hang, print the counters every few hundred cycles. The ones that stop are the finished work; the one still climbing is the stage that waits.

    Rule of thumb: for a performance question, count work, waiting and the worst case before you open a waveform.

    Observability by Design

    • Silicon shows only what you designed to be seen. Decide the questions you will ask of a hung chip, then build the registers that answer them.

    • Keep the first failure: sticky errors with a first-error record, and a trace that freezes on the trigger. Later errors must not overwrite the evidence.

    • Debug state must be readable when the main bus is hung, through a side-band port. Debug logic is logic: it needs tests and an area budget.

    Rule of thumb: for every way the block can fail, name the register that will show it on silicon, and a path to read it that does not need the block to work.

    Practise it

    • Practice question: Waveform debug: a write transaction timeout

    • Practice question: FSM illegal-state debugging: waveform analysis and assertions

    • Code lab: Plusargs with $value$plusargs

    • Code lab: String formatting

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

    • Interview: run a mock interview on this topic

    Related topics

    • Course hub

    • Previous: Part 1 · Reproduce

    • Next: Part 3 · Localise

    PreviousNext: Reading a Waveform with a Question

    Up next

    Up nextReading a Waveform with a Question

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Part 0 · What Debugging Is
    • Part 1 · Reproduce
    • Part 3 · Localise