Wishbone · Module 27
Waveform Analysis
Not a viewer manual. Which signals prove or eliminate a hypothesis, why twelve experiments were settled without a waveform, and a blind debug worked end to end from symptom to regression.
This chapter is not about a waveform viewer. Viewers are easy and you already have one.
It is about the question that decides whether the next hour is productive:
Which signals do I need to prove or eliminate my hypothesis?
A waveform is the most expensive evidence in the toolbox — expensive to produce, expensive to store, and above all expensive to read. It is also the most seductive, because it looks like it contains everything. It does. That is the problem.
1. The Evidence Hierarchy
Work upwards. Stop as soon as the hypotheses separate.
| tier | evidence | cost to read |
|---|---|---|
| 1 | test failed | one line |
| 2 | which detector fired | one line |
| 3 | transaction log | one line per transfer |
| 4 | event census at each boundary | one table |
| 5 | boundary probes, per clock | tens of rows |
| 6 | reduced waveform | tens of signals |
| 7 | RTL inspection | hours |
Every experiment in Module 27 was settled at tier 3 or 4.
- SIM B and SIM C separated on one census row: memory phases opened, 0 versus 1.
- SIM D separated on one census row: register slave phases presented, 0 versus 4.
- SIM G separated on two counters: pops and underflows.
- SIM I, J and K separated on a ten-row lineage table.
Not one of them required a waveform to reach a conclusion. The waveforms in this module exist to make a conclusion legible after it has been reached — which is a real and different job.
The anti-pattern is one line long and everybody has done it:
failure -> dump every signal -> stareThree hundred signals over ten thousand clocks contains the answer and does not contain a way to find it. The rule:
Use the cheapest evidence that can discriminate the hypotheses.
2. The Trace Can Lie
Before trusting any of tiers 3 to 5, check them against something that is not them.
The monitor of Chapter 26.3 makes judgements: when a phase began, when it ended, which class of termination it was, which data belonged to it. Every one of those can be wrong — SIM K1 in the previous chapter is a monitor that was.
So this module carries a second observer that makes no judgements at all:
// ── WHY THIS IS NOT THE MONITOR ─────────────────────────────────────────
// A debugger who uses the monitor to check the monitor has proved nothing.
// So this module makes no judgements at all. It counts edges:
//
// presented ( CYC && STB ) how many clocks a request stood
// terminated ( presented && term ) how many ended
// acks / errs / rtys which class, from the pins
// opened ( rising presented ) how many phases began
// max_held longest unanswered stretch
// open_now still presented at the end
// unknown any pass-deciding pin at XThe cross-check, on the clean baseline:
| quantity | raw-pin census | monitor |
|---|---|---|
| phases opened / transactions | 8 | 8 |
ACK terminations | 6 | 6 |
ERR terminations | 2 | 2 |
| unknown fields | 0 | 0 |
Agreement across four independently derived numbers. That is what earns the transaction log the right to be believed for the rest of the session — and it costs one module and one table.
3. Signal Reduction
A waveform should contain every signal that answers a question and nothing else. Here are the four reductions this module actually used.
| case | available | needed | published | why each is there |
|---|---|---|---|---|
| missing completion | ~90 | 8 | 8 | CLK, master CYC/STB, master ADR, slave STB, slave ACK, master ACK |
| wait-state context | ~90 | 7 | 7 | CLK, STB_O, master ADR, delivered ADR, ACK, ERR |
| data corruption | ~90 | 10 | lineage table | the ten edges, none of which is a waveform question |
| arbitration | ~90 | 9 | timeline table | req, grant, owner, target, termination, destination |
Two of those four are not waveforms at all. Data lineage and ownership provenance are tabular questions; drawing them as waveforms would have lost the thing that made them readable, which is that each row is one transfer or one clock and each column is one edge.
The test for a published waveform is not "is it small". It is:
Can you say, for each signal, which competing explanation it eliminates?
If not, delete it. A signal that cannot fail to look the way it looks has no evidentiary value.
4. The Reading Method
- Identify the triggering failure — the detector, not the impression.
- Identify the transaction or attempt it belongs to.
- Mark the clock the request started.
- Mark the completion, or establish its absence.
- State the invariant you expect to hold across that interval.
- Move backwards from the symptom.
- Locate the first clock at which expectation and observation diverge.
- Inspect only the causal predecessors of that clock.
- Formulate a mechanism that explains the divergence.
- Re-run after the fix and confirm the divergence is gone.
Step 7 is the one people skip, and it is the only one that matters. The last visible failure is almost always downstream noise:
divergence first cycle count
target delivered != expected 4 3
address changed downstream 0 0
nothing selected at all 0 0
slave drove wrong read data 16 2
bus carried wrong read data 16 2
monitor recorded wrong data 16 2Three divergences report count 2 at cycle 16; one reports count 3 at cycle 4. Sorting by count picks the wrong one. Sorting by first occurrence picks the cause.
And then check the ordering mechanically, because a plausible story is not evidence:
TEMPORAL CAUSALITY CHECK
claimed root-cause event cycle 4
first data symptom cycle 16
invalid causal orderings 0A claimed root cause whose event happens after the first observed failure is not a root cause. It is a coincidence with a narrative attached, and the check above costs nothing.
5. Say What Is On The Screen
Do not write:
"As you can see, ACK is wrong."
Write:
At edge 4, the decoder computes target S1 for address
0x0110and the request is delivered to S0. The first divergence is the delivered target, twelve clocks before the master observes wrong read data.
The second sentence names an edge, a value, a boundary, and an ordering. The first names a feeling.
The blind case, reduced to what proves it
8 cycles6. The Blind Case, End To End
One defect was armed and its name withheld until the reasoning finished.
Symptom. Five operations issued, five retired, two scoreboard mismatches — one data, one termination. Zero protocol violations. Zero unknown fields. Nothing hung.
Classify. Not completion: 5 issued, 5 retired. Not timing: maximum open phase 0 clocks. Not ownership: owner moved 0, responses misdelivered 0. Data or routing.
Hypotheses. H1 the memory stored the wrong value. H2 the return path delivered the wrong value. H3 the request never reached the memory. H4 the monitor or model is wrong.
Observation 1 — two counters and a back-door read, no waveform:
phases presented to S0 registers 5
phases presented to S1 memory 0
memory word 0x0110, via back door 0xxxxxxxxxEliminate. A memory that was never addressed cannot have stored anything, right or wrong — H1 rejected. A return path carries what a slave sent, and no slave in that window sent anything — H2 rejected. The monitor's unknown count is 0 and the register transfers in the same run are correct — H4 unlikely. H3 survives.
Observation 2 — the decode trace:
transfer address expected delivered
0 0x0110 S1 mem S0 regs
2 0x0110 S1 mem S0 regs
4 0x0200 unmapped S0 regsRoot cause. 0x0110 reaches S0 and so does 0x0200, which is outside every window. Both are true if and only if the region compare uses a truncated address. A widened window would not do this: widening S0 to cover 0x0100–0x01FF captures 0x0110 and leaves 0x0200 outside. 0x0200 is the address that separates the two hypotheses, and the trace says it reached S0.
Only then: the armed defect was ADDR_TRUNCATE, comparing ADR[7:0].
Fix and proof:
STAGE 9 FIX VERIFICATION
scoreboard mismatches before 2 after 0
memory word 0x0110 before 0xxxxxxxxx after 0x5555bbbb
phases presented to S1 before 0 after 2
STAGE 10 REGRESSION
before the fix retired 8 mismatches 2 violations 0
after the fix retired 8 mismatches 0 violations 0The original failing test passes, the memory now holds what was written to it, and an eight-operation regression that also failed before the fix is clean after it.
7. The Fix That Is Not A Fix
THE FIX THAT IS NOT A FIX
The same defective system, running a test that never
touches the memory window:
operations retired 4
scoreboard mismatches 0
protocol violations 0
The suite is green and the decoder is exactly as broken
as it was. A test that avoids the failing address has
removed the evidence, not the defect.Root cause requires all six of these, not the last one alone:
- a mechanism that explains the symptom;
- evidence the mechanism actually occurred;
- a first divergence consistent with it;
- a correction that removes the divergence;
- the original failing test passing;
- a clean regression staying clean.
"I changed three lines and the waveform looks better" satisfies none of them.
8. The Assertions Were Clean
A1 0 A2 0 A3 0 A4 0 A5 0 SPEC 0 LOCAL 0Every executable assertion in the system reported clean, and the system was decoding 0x0200 onto a peripheral. An assertion catches its own class and nothing else. None of the five encodes the address map, because the address map is not a Wishbone rule — it is this system's own specification, and only the decode trace was ever going to find this.
9. Twelve Sentences This Module Refutes
| the sentence | what was measured |
|---|---|
| "Missing ACK means the slave is broken." | SIM B: the slave was never addressed |
| "ACK means the right peripheral was accessed." | SIM D: 4 ACKs, 0 register-slave phases |
| "A long wait is a protocol violation." | SIM C: 391 open clocks, 0 violations |
| "If zero latency passes, wait-state logic is fine." | SIM F: 0 mismatches at lat 0, 3 at lat 1 |
| "If the scoreboard fails, the DUT is wrong." | K1 and K2: the DUT was right in both |
| "If the waveform looks strange, add more signals." | every case settled at tier 3 or 4 |
| "The last visible failure is the root cause." | cycle 16 count 2 vs cycle 4 count 3 |
| "Protocol-clean means functionally correct." | 11 defects, 0 protocol violations in 9 |
| "Coverage hit means the stimulus was sensitive." | the seed, without which SIM I detects nothing |
| "An arbiter problem means two grants." | HC: one grant, 99 misdelivered responses |
| "Wrong read data means the memory stored wrong." | J and I2: the memory was innocent in both |
| "A timeout fixes a missing response." | SIM C: 2× patience, same 1 completion |
10. The Root-Cause Report
Short, causal, and written for the next engineer. This is a template filled in by hand, not simulator output — every number in it is quoted from the runs above:
FAILURE memory readback at 0x0110 returns register data;
0x0200 acknowledges instead of erroring.
REPRODUCTION 5-op deterministic program, no randomness, byte-identical
across runs.
FIRST DIVERGENCE
cycle 4 — decode computes S1, routing delivers S0.
First data symptom at cycle 16; ordering checked.
ROOT CAUSE the region compare uses ADR[7:0]. The high byte is
discarded, so 0x0110 and 0x0200 both alias onto S0's base.
FIX compare the full address width.
PROOF original test 2 mismatches -> 0; 8-op regression 2 -> 0;
memory phases presented 0 -> 2.
PREVENTION add the boundary sweep of Chapter 27.2 to the regression
suite: first and last of each window, one above and below,
a hole, and an alias candidate. 0x0200 is the address that
would have caught this on day one.The PREVENTION line is what stops the same afternoon happening twice.
11. What To Carry Forward
- Use the cheapest evidence that discriminates. Twelve experiments, zero settled by a waveform.
- Cross-check the trace against raw pins before you trust it. The monitor makes judgements; a pin census does not.
- Every published signal must eliminate an explanation. If you cannot say which, remove it.
- Some questions are tables, not waveforms. Lineage and provenance both lost nothing by being printed.
- Sort by first occurrence, never by count.
- Check causal ordering mechanically. A root cause that happens after its symptom is a story.
- Green after avoiding the failing case is not a fix.
- Write the report for the next engineer, and include the test that would have caught it.
Module 27 ends here. Chapter 26.1 taught which detector says something is wrong; this module was about what evidence localises why.
Continue learning
Related tutorials
- Related topic
Debug Checklist
A twelve-step procedure that ends in a proven mechanism, the evidence ladder that keeps you off the waveform, and three fixes that are not fixes.
- Related topic
Data Flow
One Wishbone access, followed through every block in both directions: what the master drives, where the address changes form, which signals are broadcast and which are decoded, and how read data and termination find their way back to exactly one requester.
- Related topic
DAT_O
Both masters and slaves have a DAT_O, and they mean opposite things. What each must drive, when it must be valid, and why a master may legally leave stale write data on the bus during a read.
- Related topic
DAT_I
A master's DAT_I is returned read data; a slave's is incoming write data. Neither may be believed without the condition that qualifies it — and sampling one cycle late returns the previous transaction's value.
Standards & specifications
- Governing standard
- Wishbone SoC Interconnection Architecture (OpenCores)(opens OpenCores in a new tab)
Defines the Wishbone signal set, the bus cycles built from it and the interface rules a portable IP core must follow. It deliberately leaves interconnect topology, address map and arbitration policy to the integrator, so those are system decisions rather than requirements of the specification.
This page also covers RTL structure, verification approach and debugging technique. Those are engineering practice built on the standard, not requirements the standard itself imposes.
Where this fits
Part of the Wishbone curriculum.
