Module 3: Checking Architecture | Intermediate UVM

Debug-Friendly Diagnostics

Turn verification failures into precise, actionable evidence instead of cryptic error messages.

Learning objectives

  • Explain what makes a UVM diagnostic useful during interactive debug and regression triage.
  • Distinguish a verification failure from a testbench infrastructure failure.
  • Design scoreboard messages that identify the transaction, correlation key, timing, and expected/actual values involved.
  • Use UVM reporting macros and verbosity appropriately without flooding regression logs.
  • Build a repeatable debug path from a checker failure back through the monitor, predictor, and DUT.
  • Recognize how diagnostic quality affects the usability of reusable verification components.

Step 1: Understand the concept

A checker can correctly detect a failure and still be difficult to debug. Consider these two messages:

`uvm_error("SB", "Response mismatch")

and:

`uvm_error("SB",


$sformatf(
"Response mismatch: id=7 addr=0x4000 "  +
"expected=0x000000A5 actual=0x00000095 " +
"start_cycle=142 response_cycle=148 latency=6",
actual.id
)
)

The second message gives the engineer information needed to begin the investigation without immediately opening every waveform and source file.

Debug-friendly diagnostics means deliberately preserving the evidence surrounding a verification result. A useful diagnostic answers questions such as:

  • Which component detected the problem?
  • Which transaction or correlation key was involved?
  • What did the checker expect?
  • What did the DUT actually produce?
  • When did the relevant events occur?
  • Was the transaction part of a particular stream, channel, or protocol phase?
  • Could the failure instead be caused by the monitor, predictor, configuration, or reset handling?
Core idea: A diagnostic is part of the verification architecture. The goal is not to print more text; the goal is to preserve the information needed to classify and reproduce a failure.

Step 2: Understand the diagnostic path

By this point in the course, a transaction may travel through several components before a failure is reported.

 DUT


│
▼
Monitor
│ observed transaction
▼
Predictor ──► Reference Model
│               │
│               └── expected transaction
▼
Scoreboard
│
├── correlation
├── comparison
├── timeout / outstanding-state checks
│
▼
UVM report
│
▼
Engineer / regression triage

A scoreboard message should therefore identify enough information to connect the report back to the transaction path.

For example, an out-of-order response failure is much easier to investigate when the message contains the correlation ID:

Unexpected response:


id=7
stream=RX
response_cycle=148
outstanding_ids={3, 4, 9}

This immediately suggests a correlation problem, ID reuse issue, missing expectation, or monitor problem rather than simply saying "scoreboard failed."

Step 3: Classify the failure before reporting it

Not every checker problem means the DUT is wrong. A reusable environment should distinguish different failure classes.

Failure Useful diagnostic information Likely investigation
Unexpected response ID, stream, response time, actual transaction Monitor, DUT response, correlation state
Expected/actual mismatch ID, expected fields, actual fields DUT behavior, predictor, reference model
Duplicate response ID, first response time, duplicate response time DUT protocol behavior or monitor duplication
Timeout ID, start time, deadline, current time DUT completion, monitor, timeout policy
Outstanding at end of test IDs, streams, count, last known activity Stimulus completion, DUT completion, drain logic
Malformed transaction Transaction fields and monitor location Protocol monitor or DUT interface behavior

This classification matters because the next debugging action is different for each case. A timeout should not be investigated exactly like a data mismatch.

Step 4: Build structured scoreboard diagnostics

A practical scoreboard should have small helper functions for formatting diagnostic data. This prevents every failure path from producing a completely different message format.

function string format_packet(packet p);


if (p == null)
return "";

return $sformatf(
"id=%0d addr=0x%08h data=0x%08h",
p.id,
p.addr,
p.data
);
endfunction

The checker can then use that helper when comparing transactions:

function void check_response(packet expected, packet actual);


if (expected == null) begin
`uvm_error("SB_UNEXPECTED",
$sformatf(
"Unexpected response: actual={%s}",
format_packet(actual)
))
return;
end

if (!actual.compare(expected)) begin
`uvm_error("SB_MISMATCH",
$sformatf(
"Response mismatch: expected={%s} actual={%s}",
format_packet(expected),
format_packet(actual)
))
return;
end

`uvm_info("SB_MATCH",
$sformatf(
"Response matched: %s",
format_packet(actual)
),
UVM_HIGH)

endfunction

Notice that the diagnostic ID is different for an unexpected response and a mismatch. This makes regression logs easier to search and allows related messages to be grouped.

Important: Use a stable report ID such as SB_MISMATCH for classification, while the message text carries transaction-specific information.

Step 5: Report the right amount of information

More logging is not automatically better. A regression containing millions of successful transaction messages can hide the one failure that matters.

A useful strategy is:

  • UVM_LOW or UVM_MEDIUM for important environment events.
  • UVM_HIGH for detailed transaction-level diagnostics.
  • UVM_FULL for very detailed debugging when needed.
  • uvm_error for actual verification errors.
  • uvm_warning for conditions that deserve attention but are not necessarily failures.
  • uvm_info for normal diagnostic information.
  • uvm_fatal only when continuing would make meaningful verification impossible.

For example, every successful transaction does not normally need to be printed at UVM_LOW. Instead, successful matches can be available at high verbosity:

`uvm_info("SB_MATCH",


$sformatf("Matched response id=%0d", actual.id),
UVM_HIGH)

During normal regression this message remains hidden at lower verbosity. During a focused debug run, increasing verbosity can expose the transaction history.

Step 6: Include timing and ordering evidence

Lessons 17–19 introduced correlation, out-of-order checking, and latency. Diagnostics should expose those concepts when they are relevant to a failure.

For example, a latency failure should provide:

`uvm_error("LATENCY",


$sformatf(
"Latency violation: id=%0d " +
"start_cycle=%0d response_cycle=%0d " +
"observed=%0d allowed=[%0d:%0d]",
id,
start_cycle,
response_cycle,
observed_latency,
min_latency,
max_latency
))

For an out-of-order checker, the key information is usually the correlation state:

`uvm_error("SB_UNKNOWN_ID",


$sformatf(
"Response has no outstanding expectation: " +
"id=%0d stream=%0d response_cycle=%0d outstanding=%0d",
actual.id,
actual.stream,
response_cycle,
expected_by_id.size()
))

These messages turn abstract checker failures into concrete questions: "Was ID 7 accepted?", "Did the predictor create an expectation?", and "Was ID 7 already consumed?"

Step 7: Make transaction differences visible

A generic compare() failure often does not tell the engineer which field differs. For important scoreboards, report the relevant fields explicitly.

if (actual.data !== expected.data) begin


`uvm_error("SB_DATA",
$sformatf(
"Data mismatch: id=%0d addr=0x%08h " +
"expected_data=0x%08h actual_data=0x%08h",
actual.id,
actual.addr,
expected.data,
actual.data
))
end

if (actual.status !== expected.status) begin
`uvm_error("SB_STATUS",
$sformatf(
"Status mismatch: id=%0d " +
"expected_status=%0d actual_status=%0d",
actual.id,
expected.status,
actual.status
))
end

Which fields deserve individual diagnostics depends on the protocol and checker. Do not automatically print every field of a large transaction. Focus on fields that distinguish likely failure causes.

Step 8: Diagnose the verification environment itself

One of the most important intermediate-level debugging skills is recognizing when the checker is reporting a problem caused by the testbench rather than the DUT.

Observed mismatch
   │
   ├── Was the monitor transaction correct?
   │       │
   │       └── No → investigate monitor/protocol reconstruction
   │
   ├── Was the DUT input actually accepted?
   │       │
   │       └── No → investigate predictor trigger condition
   │
   ├── Was the expected transaction calculated correctly?
   │       │
   │       └── No → investigate predictor/reference model
   │
   ├── Is correlation correct?
   │       │
   │       └── No → investigate IDs/streams/reset
   │
   └── All above correct
           │
           └── Investigate DUT behavior

For example, if the predictor creates an expected response every time a sequence sends an item, but the DUT only accepts an item when valid && ready is true, the scoreboard can report perfectly consistent mismatches caused by an incorrect predictor boundary.

Good diagnostics should therefore expose the event boundary used by the environment: acceptance cycle, ID, stream, and relevant protocol state.

Step 9: Use UVM reports as a debugging interface

UVM reporting provides more than a way to print strings. Report severity and verbosity allow the environment to communicate both the importance and the amount of detail.

`uvm_info("PREDICT",


$sformatf(
"Accepted request id=%0d addr=0x%08h; generating expected response",
req.id,
req.addr
),
UVM_HIGH)

`uvm_warning("MON",
$sformatf(
"Observed protocol condition requiring attention: id=%0d",
tr.id
))

`uvm_error("SB_MISMATCH",
$sformatf(
"Expected response differs from actual response: id=%0d",
tr.id
))

In a reusable component, avoid embedding assumptions about a particular test's desired log format. Give the message a stable report ID and enough context for the engineer to interpret it.

Step 10: Build a repeatable failure-debug workflow

When a regression fails, avoid immediately changing RTL or testbench code. First classify the evidence.

  1. Find the first meaningful error. Later failures may be consequences of an earlier problem.
  2. Identify the transaction. Record its ID, stream, address, or other correlation information.
  3. Check the monitor. Confirm that the transaction reconstructed from the interface is correct.
  4. Check acceptance. Confirm the predictor processed the transaction at the correct protocol boundary.
  5. Check prediction. Determine whether the expected result is correct independently of the DUT.
  6. Check correlation. Confirm that the expected and actual transactions refer to the same logical operation.
  7. Check timing. For latency or timeout failures, compare the recorded event boundaries and deadlines.
  8. Inspect the waveform. Use the diagnostic transaction ID and timestamp to narrow the waveform window.
  9. Reproduce with the same seed and configuration. Avoid debugging a different randomized scenario.
Debug principle: The report should reduce the search space. A good message lets you move from "something failed" to "this transaction failed, at this boundary, for this reason."

Exercise 1: Upgrade a weak scoreboard message

Start with:

`uvm_error("SB", "Mismatch")

Rewrite it so the message contains at least:

  • transaction ID
  • address
  • expected data
  • actual data
  • simulation time or protocol cycle

Then choose a more specific report ID than SB.

Exercise 2: Classify the failure

A scoreboard reports:

Response id=12 was received, but no expected transaction exists.

List at least three possible causes. Your answer should include both DUT-related and testbench-related possibilities.

Then identify the first three pieces of evidence you would inspect before changing code.

Exercise 3: Debug a latency failure

The specification permits a response within 8 cycles. The checker reports:

id=5


start_cycle=240
response_cycle=250
observed_latency=10
max_latency=8

Determine whether this is sufficient evidence to conclude that the DUT violated the latency requirement. What additional information would you want to rule out a monitor or predictor boundary error?

Exercise 4: Build a diagnostic checklist

Create a checklist for an out-of-order scoreboard failure containing:

  1. correlation ID
  2. stream or channel
  3. expected state
  4. actual transaction
  5. timing information
  6. reset information
  7. outstanding transaction count

The goal is to make the checklist reusable across multiple protocol environments.

Advanced challenge: Build a diagnostic transaction history

Extend an out-of-order scoreboard so that each outstanding transaction retains enough information to diagnose a later timeout or mismatch.

For each outstanding ID, retain information such as:

id


stream
address
expected_data
accept_cycle
deadline

When a timeout occurs, print the stored context. When a mismatch occurs, print both the stored expectation and the observed response.

Then add a high-verbosity diagnostic showing when an expectation is inserted and when it is removed.

Finally, run the environment with low verbosity and verify that normal regressions remain readable. Increase verbosity only for a focused debug run.

Knowledge check

  1. Why is "Mismatch" usually a poor diagnostic?
    It does not identify the transaction, differing fields, timing, or context needed to investigate the failure.
  2. Should every successful transaction be reported at low verbosity?
    Usually no. High-volume success messages can obscure failures. Detailed transaction tracing is better exposed at higher verbosity.
  3. Does every scoreboard error prove that the DUT is wrong?
    No. Monitor reconstruction, predictor boundaries, reference-model behavior, correlation, reset handling, and configuration can all produce checker failures.
  4. What information is especially important for an out-of-order failure?
    The correlation key, stream/channel when applicable, expected state, actual transaction, and relevant timing information.
  5. Why should report IDs be stable?
    Stable report IDs make messages easier to search, classify, filter, and recognize across regression runs.
  6. What is the purpose of diagnostic history for outstanding transactions?
    It preserves the context needed to explain later mismatches, late responses, and timeouts instead of reporting only that an ID was missing.

Connecting the module

Lesson 30 completes the checking-architecture module by connecting the mechanisms built throughout Lessons 21–29:

  • Lesson 21: Scoreboard patterns determine where checking state belongs.
  • Lesson 22: Reference models calculate expected behavior.
  • Lesson 23: Predictors turn observed inputs into expected transactions.
  • Lesson 24: In-order scoreboards compare ordered streams.
  • Lesson 25: Out-of-order scoreboards correlate transactions by key.
  • Lesson 26: Multi-stream scoreboards manage relationships across streams.
  • Lesson 27: Error handling determines how failures are classified and reported.
  • Lesson 28: Timeout detection identifies transactions that exceed timing limits.
  • Lesson 29: End-of-test draining ensures outstanding verification work is completed.
  • Lesson 30: Diagnostics preserve the evidence needed to understand all of those failures.

The important progression is from detecting a failure to explaining a failure.

Stimulus


│
▼
DUT
│
▼
Monitor
│
▼
Predictor ──► Reference Model
│
▼
Checker
│
├── mismatch
├── unexpected response
├── duplicate
├── timeout
└── undrained transaction
│
▼
Debug-friendly diagnostic
│
▼
Fast failure triage

Key takeaways

  • A checker is only part of verification; engineers also need enough evidence to understand its result.
  • Good diagnostics identify the transaction, failure class, expected state, actual state, and relevant timing.
  • Use stable UVM report IDs and appropriate verbosity so regression logs remain useful.
  • Do not assume a scoreboard failure automatically means the DUT is broken.
  • Trace failures through monitor, acceptance boundary, predictor, reference model, correlation state, and checker before changing code.
  • Diagnostic information should help both interactive waveform debug and automated regression triage.
  • Lessons 21–30 form a complete checking architecture: prediction, correlation, comparison, timing, draining, and diagnosis.

Next lesson

The next module moves from checking architecture into coverage and assertions. You will use the same disciplined approach—define what matters, collect useful evidence, and debug failures systematically—to build functional coverage and assertion-based verification.