01 · Reactive and fault
Negative Testing and Exception Scoreboarding
Treat injected faults as first-class transactions so the testbench can prove safe failure, payload suppression, error signaling, and status updates without false scoreboard mismatches.
The testbench records fault intent before injection, then checks payload suppression, error reporting, sticky status, interrupt behavior, and recovery as one correlated outcome.
injected fault token ↔ expected exception token ↔ observed response; unrelated traffic stays on the normal scoreboard path
Why it matters
- Server, automotive, and mobile silicon must fail safely when data is corrupted.
- An unhandled ECC error or poisoned packet can cause silent data corruption or a permanent system hang.
- The correct outcome of a corrupted transaction may be a dropped payload plus an error flag and status-counter update, not Correct In equals Correct Out.
What is difficult
- Most ordinary scoreboards assume every input should produce valid output data.
- The injection path and scoreboard expectation must identify the same transaction.
- A predicted exception must be consumed exactly once so a later clean transaction with the same ID is not masked.
- The checker must verify both the absence of corrupted payload and the presence of required error side effects.
Failure signatures
- An expected CRC or ECC rejection appears as a false data mismatch.
- The DUT forwards a poisoned payload instead of dropping it.
- The DUT drops the payload but fails to assert its error flag.
- Error-status registers or counters do not update.
- The scoreboard suppresses an unexpected later mismatch because a predicted-error entry was not deleted.
- A transaction is corrupted without a matching predicted-error notification.
Two viable approaches—and their cost
Transaction poisoning
Flip parity, CRC, ECC, or response bits directly in the transaction or driver path.
- Simple to add for a single agent or packet type.
- Makes directed corruption easy to understand.
- Couples error behavior to the driver.
- Makes expected-failure coordination with the scoreboard difficult.
Error-injection callback or proxy
Keep corruption policy in a reusable layer that can notify checking before the modified transfer reaches the DUT.
- Decouples fault logic from the normal driver.
- Reusable across agents and corruption types.
- Provides one place to coordinate injection and expected exception state.
- Requires a clean uvm_callback or proxy ownership model.
- Must define deterministic ordering between notification and observed DUT response.
Interview answer, built from the mechanism
- Treat errors as first-class transactions. An injection proxy can flip ECC or CRC bits, poison an AXI response, or otherwise mangle the transfer without contaminating the normal driver.
- Before the corrupted transaction reaches the DUT, notify the scoreboard with the stable transaction ID, for example, expect a failure for ID 50.
- The exception scoreboard checks the expected error set, proves that the DUT asserted its error indication, confirms the payload was dropped, and verifies error-status registers or counters.
- Delete the predicted-error entry after the expected exception is consumed so later traffic with a reused ID receives ordinary checking.
Component responsibility contract
| Component | Responsibility | Required change |
|---|---|---|
| Agent config | Error knobs | Add enable_crc_err_injection and related fault controls for the driver or proxy. |
| Driver or proxy | Corruption logic | Mangle parity, CRC, ECC, or response bits on the selected transfer. |
| Virtual sequence | Expectation notification | Send the corrupted transaction ID to checking before the DUT result arrives. |
| Scoreboard | Exception handling | Maintain a Predicted Error Set and prevent false data mismatches. |
| RAL or status monitor | Side-effect proof | Check the required error flag, status field, and counter increment. |
Implementation patterns
// Associative-array membership is the set: key = transaction ID.
bit predicted_error_ids[int unsigned];
virtual function void write_error_notif(mac_item tr);
predicted_error_ids[tr.id] = 1'b1;
endfunction
virtual function void check_data(mac_item act);
if (predicted_error_ids.exists(act.id)) begin
if (!act.error_flag)
uvm_report_error("ERR", "DUT failed to detect injected error");
check_payload_was_dropped(act.id);
check_error_status_updated(act.id);
predicted_error_ids.delete(act.id);
return;
end
check_normal_data(act);
endfunctionThe source mixes queue insertion with associative-array exists/delete calls. This corrected representation is an actual set keyed by transaction ID, so membership and one-time deletion are unambiguous.
select transaction ID 50
notify scoreboard: predicted_error_ids includes 50
corrupt CRC, ECC, parity, or AXI response
drive corrupted transfer
observe DUT result
require: payload dropped
require: error flag asserted
require: status register or counter updated
remove ID 50 from predicted_error_idsThe virtual sequence controls both sides of the experiment: the injected fault and the expected exception contract.
Stress recipe
- Flip CRC, parity, or ECC bits on a selected transaction and register its ID in the predicted-error set before driving it.
- Poison an AXI response and prove the receiver rejects it without a permanent channel hang.
- Use the source example ID 50, then immediately reuse ID 50 for a clean transaction to prove the set entry was deleted.
- Check payload suppression, error_flag, error-status registers, and counter increments together.
- Inject an error without a notification and a notification without an error so the environment catches both coordination failures.
Follow-up questions
Why should errors be modeled as first-class transactions?
Because corruption changes the expected result. The checker needs the fault type and stable transaction identity to distinguish correct rejection from an ordinary mismatch.
Why use a callback or proxy instead of changing every driver?
A proxy separates reusable corruption policy from normal protocol driving and gives the environment one coordination point for injection plus predicted-error notification.
What must exception scoreboarding verify?
It must prove the corrupted payload was not accepted, the required error indication occurred, architectural status or counters updated, and the predicted exception was consumed exactly once.
