Module 7: Debug and Regression | Intermediate UVM

Waveform Debug Strategy

Turn a failing UVM test into a focused temporal investigation by selecting the right signals, time window, transactions, and verification evidence.

Learning objectives

  • Explain when waveform inspection is more useful than additional textual logging.
  • Identify the signals and time window needed to investigate a protocol failure.
  • Correlate waveform activity with monitor transactions, scoreboard failures, assertions, and test logs.
  • Trace a transaction backward from a failure to the first relevant divergence.
  • Use reset, handshake, state, and transaction boundaries to structure waveform analysis.
  • Avoid common waveform-debugging mistakes such as dumping everything or starting at the wrong event.

Why waveform strategy matters

A waveform is one of the most powerful debugging artifacts in a verification environment because it preserves time and causality. A report can tell you that transaction 42 returned the wrong value. A waveform can help answer why: was the request accepted at the wrong cycle, did the DUT change state unexpectedly, did a handshake remain asserted, or did the response appear too early?

But a waveform containing every signal in the design is not automatically useful. Large SoC simulations can produce enormous databases that are slow to open and difficult to navigate.

Core strategy: Start from a known verification event and work outward in time and hierarchy. Do not begin by randomly inspecting signals until something looks suspicious.

Lesson 62 established how to increase textual diagnostic detail selectively. This lesson applies the same discipline to waveforms: collect enough temporal evidence to explain the failure, but avoid drowning the engineer in unrelated activity.

Step 1: Know when to use a waveform

Not every failure requires waveform inspection. Start with the cheapest evidence that can answer the question.

Failure symptom Useful first evidence Waveform value
Configuration is wrong UVM configuration/report output Usually low
Expected transaction never appears Monitor/scoreboard diagnostics High if timing or handshake is unclear
Wrong response value Scoreboard + transaction trace High for tracing request/response timing
Protocol assertion failure Assertion + nearby signals Usually very high
Reset corruption Reset-aware reports High for state and timing investigation
Intermittent seeded failure Exact seed + logs High after reproducing the failure

The waveform should answer a specific question. "Open the waveform" is not a debugging strategy by itself.

Step 2: Preserve the failing run

Before inspecting signals, preserve enough information to reproduce the same simulation:

  • test name,
  • random seed,
  • relevant configuration,
  • simulator/build information,
  • failure timestamp or transaction ID,
  • report ID and severity,
  • and the waveform database generated by that run.

A waveform from a different seed can be useful for understanding architecture, but it is not evidence of what happened in the failing execution.

`uvm_error("SB_MISMATCH",


$sformatf(
"id=%0d expected=0x%0h actual=0x%0h",
id,
expected.data,
actual.data
))

If the report identifies transaction ID 42, use that transaction as the anchor for waveform investigation instead of scanning the entire simulation.

Step 3: Select the right waveform signals

A useful debug window usually contains several categories of signals.

Category Examples Why it matters
Clock/reset clk, reset_n Establishes timing and reset boundaries
Handshake valid, ready, enable Defines when protocol events actually occur
Payload address, data, byte enables, control fields Shows what was transferred
Protocol state FSM state, outstanding count, request state Explains why behavior changed
Response response data, response valid, error status Connects DUT behavior to scoreboard observations
Relevant internal state FIFO pointers, pending flags, arbitration state Useful when interface behavior alone is insufficient

Do not add internal DUT signals merely because they are available. Add them when they can distinguish between competing explanations for the failure.

Step 4: Understand transaction boundaries

Protocol debugging becomes much easier when the engineer knows exactly which cycle represents transaction acceptance and which cycle represents completion.

For a ready/valid interface, a transfer commonly occurs when:

accept = valid && ready;

The waveform investigation should therefore begin at the actual acceptance event, not merely at the cycle when valid first becomes high.

cycle:       10   11   12   13   14


valid:        0    1    1    1    0
ready:        0    0    1    1    0
^
accepted

If the scoreboard says transaction 42 was wrong, identify the exact acceptance cycle for transaction 42 and then trace the response from that point.

Do not assume signal assertion equals transaction completion. The protocol specification defines the meaningful event. For different interfaces, acceptance and completion may have different conditions.

Step 5: Correlate waveform events with UVM transactions

The monitor is the bridge between pin-level activity and transaction-level verification. A strong waveform investigation uses both representations.

Physical signals
  |
  | protocol sampling
  v


Monitor transaction
|
+------> Scoreboard
|
+------> Coverage
|
+------> Transaction recording
|
v
Waveform correlation

Suppose the monitor reports:

UVM_INFO [BUS_TX]


Observed id=42 addr=0x100 data=0x55

The waveform should let you locate the corresponding acceptance event and verify whether the sampled address/data actually matched the transaction published by the monitor.

This can reveal an important class of verification bugs: the DUT may be correct while the monitor samples signals at the wrong time or interprets the protocol incorrectly.

Step 6: Trace backward from the failure

A common debugging mistake is to start at the moment the scoreboard reports the failure and immediately blame the signal that differs. Instead, walk backward through the causal chain.

Scoreboard mismatch
   |
   v


Actual transaction differs
|
v
What did the monitor observe?
|
v
What did the DUT drive?
|
v
When was the request accepted?
|
v
What DUT state existed before acceptance?
|
v
What event first diverged from the expected behavior?

The first divergence is usually more valuable than the final incorrect value.

For example, if the final response data is wrong, possible earlier causes include:

  • wrong request address,
  • request accepted one cycle earlier than expected,
  • incorrect byte enable,
  • reset occurring while a transaction was outstanding,
  • incorrect internal state transition,
  • or an incorrect monitor interpretation.

Step 7: Use assertions as waveform anchors

Assertions are particularly useful because an assertion failure identifies a temporal condition that was violated.

ap_idle_during_reset:


assert property (
@(posedge clk)
!reset_n |-> !busy
)
else
`uvm_error("RESET",
"busy asserted during reset");

When this assertion fails, do not inspect the entire waveform. Start around the failing clock edge and examine:

  1. reset state,
  2. clock edge,
  3. busy,
  4. the signals that control busy,
  5. and any state transition immediately preceding the failure.

Assertions therefore provide useful temporal anchors for waveform navigation.

Step 8: Treat reset as a waveform boundary

Reset deserves special treatment because it can invalidate assumptions about transactions, internal state, and scoreboard expectations.

Normal operation
  |
  v


transaction 41
|
v
RESET ASSERTED
|
+---- monitor resets partial transaction
+---- predictor restores state
+---- scoreboard applies reset policy
|
v
RESET RELEASED
|
v
new transaction epoch

When debugging a failure near reset, identify whether the transaction began before reset, during reset, or after reset. Also verify whether the DUT specification says outstanding work is discarded, completed, preserved, or converted into an error.

This is particularly important for the reset-aware scoreboards and predictors introduced earlier in the course.

Step 9: Debug handshakes before payloads

For many protocol failures, the first useful waveform question is not "Why is the data wrong?" but "Did the transfer happen when both sides believed it happened?"

valid  ────────┐      ┌────────────
           └──────┘


ready  ────┐         ┌──────────────
└─────────┘

accept = valid && ready
^
transfer event

If the acceptance event is wrong, downstream payload mismatches may simply be consequences.

A useful investigation order is:

  1. clock and reset,
  2. handshake/acceptance condition,
  3. address/control fields,
  4. payload,
  5. response timing,
  6. internal state if necessary.

Step 10: Use a focused time window

Most waveform viewers allow engineers to zoom or navigate to a specific time range. Use the failure timestamp or transaction boundary as the center of the investigation.

                    failure
                   |
                   v


------|---------|-----X-----|---------|------
earlier    request    response    later
|
+-- inspect causal history 

Start slightly before the suspected transaction and extend the window until the first divergence is understood. Expand the window only when necessary.

Debugging heuristic: If you have been staring at a very large waveform for several minutes without forming a concrete hypothesis, narrow the time window and define the question you are trying to answer.

Step 11: Combine waveform, log, and transaction evidence

The strongest debug workflow uses several independent observations.

Evidence Answers
UVM report What verification component detected?
Monitor transaction What did the verification environment observe?
Scoreboard/predictor What was expected and what differed?
Assertion Which temporal rule failed?
Waveform What physically happened over time?
Transaction recording How did transaction-level activity align with simulation time?

If two sources disagree, that disagreement is itself evidence. For example, if the monitor says a transfer contained 0x55 but the waveform shows 0x57 at the protocol acceptance edge, investigate the monitor before concluding that the DUT produced the wrong value.

Step 12: Recognize testbench bugs in waveform debug

A waveform failure is not automatically a DUT failure.

Consider this causal chain:

Monitor samples one cycle too early
    |
    v


Observed transaction is wrong
|
v
Scoreboard compares wrong actual data
|
v
UVM_ERROR
|
v
Engineer initially suspects DUT

The waveform can expose the real problem by showing that the monitor's transaction boundary does not match the protocol's acceptance event.

Other testbench-related waveform problems include:

  • incorrect clocking or sampling assumptions,
  • race-prone signal access,
  • incorrect reset handling,
  • driver driving at the wrong protocol phase,
  • predictor using the wrong acceptance event,
  • or scoreboard expectations being created too early.

Common mistakes

Mistake Why it causes problems Better approach
Dumping every signal Creates huge databases and hides relevant behavior Select signals based on the debugging question
Starting at the final bad value The root cause may have occurred many cycles earlier Trace backward to the first divergence
Ignoring reset boundaries Pre-reset expectations may be incorrectly compared with post-reset behavior Mark reset epochs explicitly during investigation
Assuming valid means transfer Many protocols require a handshake condition Identify the actual protocol acceptance event
Only looking at DUT internals The monitor or predictor may be the source of the problem Correlate pins, transactions, assertions, and checker state
Using a different seed for convenience The observed waveform may not represent the failing execution Reproduce the exact seed and configuration
Keeping the entire simulation in view Temporal relationships become difficult to see Start with a focused window around the failure
Assuming waveform evidence proves DUT failure Verification infrastructure can also violate assumptions Check the DUT and testbench interpretation independently

Debug recipe: scoreboard mismatch

Use this sequence when a scoreboard reports a transaction mismatch.

  1. Record the failure context. Save test, seed, transaction ID, expected value, actual value, and timestamp.
  2. Locate the transaction boundary. Find the protocol event that accepted the request.
  3. Check reset and enable conditions. Make sure the transaction was not affected by an unexpected state transition.
  4. Check request fields. Address, command, byte enables, IDs, and control signals should be correct.
  5. Check DUT state. Inspect relevant state only if interface evidence does not explain the behavior.
  6. Check response timing. Verify that completion occurred at the expected event.
  7. Compare monitor output with waveform. Confirm that the monitor reconstructed the physical transfer correctly.
  8. Find the first divergence. Classify the problem as DUT behavior, monitor interpretation, predictor logic, scoreboard logic, or test configuration.

Try it yourself

  1. Run a deterministic protocol test and generate a waveform.
  2. Identify the clock and reset signals first.
  3. Add the protocol handshake and payload signals to the waveform view.
  4. Locate one accepted transaction using the protocol's actual acceptance condition.
  5. Compare the waveform with the monitor's transaction output.
  6. Intentionally introduce a one-cycle timing error in a driver or monitor.
  7. Use the waveform to determine which component violated the expected timing.
  8. Restore the component and confirm that the original transaction behavior returns.

Challenge: find the first divergence

Your regression reports:

UVM_ERROR [SB_MISMATCH]


id=42 expected=0xA5 actual=0xA1

The monitor reports that request ID 42 was accepted at simulation time T. The response was reported at T + 40ns.

Build a waveform investigation containing:

  • clock and reset,
  • request handshake,
  • request address/control/payload,
  • response handshake,
  • response payload,
  • the most relevant DUT state signal,
  • and any assertion associated with the protocol.

Determine which of these explanations is most consistent with the waveform:

  1. the driver sent the wrong request,
  2. the DUT accepted the request incorrectly,
  3. the DUT generated the wrong response,
  4. the monitor sampled the response incorrectly,
  5. or the scoreboard/predictor generated the wrong expectation.

Do not stop at the first signal that differs. Identify the earliest event that contradicts the expected protocol behavior.

Knowledge check

  1. Why should waveform debugging start from a known failure?
    It narrows the investigation to a relevant transaction and time window instead of requiring inspection of the entire simulation.
  2. What is usually more useful than dumping every signal?
    Selecting signals that can distinguish between the likely causes of the failure.
  3. Why is the monitor important during waveform debugging?
    It connects physical interface activity to the transaction-level information consumed by scoreboards, predictors, and coverage.
  4. What is the first divergence?
    The earliest event at which observed behavior stops matching the expected behavior. Later failures may be consequences of this event.
  5. Why should reset be treated as a waveform boundary?
    Reset can change DUT state and invalidate, preserve, or transform outstanding transaction expectations depending on the specification.
  6. Does a waveform mismatch automatically mean the DUT is wrong?
    No. The driver, monitor, predictor, scoreboard, timing assumptions, or test configuration can also be incorrect.

Key takeaways

  • A waveform is most valuable when it answers a specific temporal debugging question.
  • Preserve the exact failing seed, test, configuration, and failure context before investigating.
  • Start with clock, reset, handshake, and transaction boundaries before examining deep internal state.
  • Correlate waveform activity with monitor transactions, assertions, scoreboards, predictors, and reports.
  • Trace backward from the final failure to the first meaningful divergence.
  • Use focused signals and time windows instead of dumping or viewing everything.
  • A waveform can reveal verification-component bugs just as effectively as DUT bugs.

Where this lesson goes next

Lesson 62 taught how to control textual diagnostic detail. Lesson 63 applies the same discipline to temporal debug: preserve the failing execution, select relevant evidence, and trace the first divergence.

Next, Lesson 64: Seed Reproduction makes that workflow deterministic. Instead of merely inspecting one failing waveform, you will learn how to capture and reproduce the exact randomized scenario that produced a regression failure.