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

  • How to Use This Course
  • Reading Path
  • Cache Coherency Glossary
  • The Shared Course Model
  • Cache Coherency Revision Sheet
  • Why Coherence Exists8
  • States and Protocols12
  • Transactions12
  • Races and Controller Design8
  • Progress and the Fabric16
  • Ordering and Synchronization12
  • Performance and Scalability12
  • Real Protocols12
  • SoC Integration12
  • Power, Clocking and Reliability12
  • Verification12
  • Debug and Bring-up12
    • Silicon Bring-up Coherency Triage
    • Cross-Layer Observability Strategy
      • What to Trace
      • Coherence Performance Counters
      • Debug Hooks in Controllers
      • Reproducing a Race
    • Post-Silicon Regression and Guardrails
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹Cross-Layer Observability Strategy
  1. Topics
  2. Cache Coherency
  3. Debug and Bring-up
  4. Cross-Layer Observability Strategy
  5. What to Trace

Part 12 · Debug and Bring-up · All levels

What to Trace

Choose trace taps, record fields, filters and triggers, and size the trace buffer from message rate, record size and the time window you need.

On this page

    What will you wish you had recorded?

    When a load returns a stale value or a core hangs, the question is always about one line: which transactions touched it, in which order did H serialize them, and which message did not arrive. A coherence trace answers that only if three choices were made at design time: where the taps are, what each record holds, and how the limited buffer is spent.

    Where to tap

    Tap H's input and output (every request, response and forward it receives or sends) and each cache controller's coherence port. H's tap shows the serialization order, because H decides which transaction for X is active. The cache taps show what each cache actually received and when, which matters because the course model assumes no FIFO order: a record order at H can differ from the delivery order at C0. A common time base (a global timestamp, or per-tap timestamps with a known offset) is what makes records from different taps comparable.

    What each record holds

    Field

    Illustrative size

    Line address (mandatory): 42 bits covers a 48-bit physical address with 64-byte lines

    6 B

    Message type and direction or capture point (mandatory)

    1 B

    Source and destination (mandatory): 4 bits each

    1 B

    Transaction id (mandatory)

    2 B

    Timestamp (mandatory)

    4 B

    State before and after (optional): at a cache the line state, at H a compressed directory and pending-entry code

    2 B

    Payload word or hash (optional)

    4 B for a 32-bit hash, more for a word

    Why each field is needed, and what you lose without it: see Trace-First Debug.

    The five mandatory fields are 14 bytes; this lesson's illustrative record adds the 2-byte state field for 16 bytes, and leaves the payload out. A payload word or hash enlarges every record, and it raises the security question covered in Debug Hooks in Controllers, as do the addresses and timestamps themselves. The state fields are the expensive design choice, because they need wires from the state arrays to the tap, but they are what let you check a trace against the protocol table without a reference model.

    Worked case: one write miss, as the trace buffer sees it

    Take the write miss from S{C0} in Write Miss and Ownership: C0 S / 0, C1 I / -, H S{C0}, memory = 0, MSI, C1 stores 1. That lesson has the message sequence and the snapshot table. Here is the same transaction, labelled A, as records from three taps (illustrative generic format, illustrative cycle numbers).

    Cycle

    Tap

    Dir

    Type

    Txn

    Src to dst

    State before to after

    96

    C1

    out

    GetM(X)

    A

    C1 to H

    I to IM^D

    100

    H

    in

    GetM(X)

    A

    C1 to H

    S{C0} to S{C0}, pend GetM C1, acks 0/1

    103

    H

    out

    Inv(X)

    A

    H to C0

    unchanged

    110

    C0

    in

    Inv(X)

    A

    H to C0

    S to I

    112

    C0

    out

    Inv-Ack(X)

    A

    C0 to H

    I

    120

    H

    in

    Inv-Ack(X)

    A

    C0 to H

    S{C0}, pend GetM C1, acks 0/1 to U, pend GetM C1, acks 1/1

    160

    H

    out

    Data(X, M)

    A

    H to C1

    unchanged until the grant is delivered

    168

    C1

    in

    Data(X, M)

    A

    H to C1

    IM^D to M

    The gap from 120 to 160 is H's memory read, which is an internal event, not a message; a tap can log it as a separate internal record if the designers chose to. Read the trace the way a checker would: the Data with M permission at cycle 160 must come after the Inv-Ack at 120, and C0's state must be I before C1's is M. If the H tap showed the Data before the Inv-Ack, that would be the bug the linked lesson warns about, visible in two records.

    Buffer depth versus bandwidth

    Diagram
    # not-run: illustrative arithmetic
    peak records at H        = 2 per cycle (one in, one out), 1 GHz clock
    record size              = 16 B (14 B mandatory + 2 B state, illustrative)
    fill rate                = 2 x 16 B = 32 B per cycle = 32 GB/s
    window wanted            = 10 us = 10,000 cycles
    buffer needed, no filter = 32 B x 10,000 = 320,000 B, about 312.5 KiB
    on-chip buffer available = 16 KiB = 1,024 records
    window, no filter        = 1,024 / 2 per cycle = 512 cycles = 0.512 us
    filtered to one line     = 1 record per 50 cycles (illustrative)
    window, filtered         = 1,024 x 50 = 51,200 cycles = 51.2 us

    The unfiltered buffer covers half a microsecond, which rarely includes the start of the transaction that went wrong. Filtering to the suspect line stretches the same storage a hundredfold. That is why per-address filtering matters: coherence is defined per location, so the full history of one line is worth more than a short history of every line. The filter is an address match and mask (one line, or a set of lines), optionally combined with a message-type mask and a source mask.

    Taps at H and the caches feed an address, type and source filter. Passing messages are timestamped into a circular buffer. A trigger such as a pending-entry timeout stops recording after a set number of further records, and the buffer is read through the debug port.
    A trace path: filter first, then record into a circular buffer that a trigger freezes.

    Triggers decide which window you keep. A circular buffer always holds the most recent records; the trigger stops it a set number of records after an event, so you get history before the event and a little after. Good triggers for coherence are a pending-entry timeout at H (the hang case), a checker or parity event, or the first request to a chosen line.

    Common pitfall

    Tracing only at H. H's records show what it decided, not what each cache received. With no FIFO order, the question 'did C0 see the Inv before its own Data?' can only be answered at C0's tap.

    Interview

    Given a message rate, a record size and a buffer size, compute the window in microseconds, then show how an address filter changes it. Name the fields you would never drop: line address, type and direction, source and destination, transaction id and timestamp.

    Check yourself Why include the transaction id when the line address and timestamp are already in the record?

    Two transactions on the same line can overlap at H, and a late response for an old one can arrive after a new one has started. Address and time cannot say which transaction an Inv-Ack belongs to; the id can. Without it a trace can show an apparently correct ack that actually completed the wrong transaction.

    Related topics

    • Shared course model

    • Using the trace on silicon

    • Hardware Debug: observability by design

    • Observability in silicon

    Previous

    138 / 167

    Next: Coherence Performance Counters

    Up next

    Up nextCoherence Performance Counters

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Debug Hooks in Controllers
    • Reproducing a Race