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
    • Transient States and Races
      • Why Transient States Exist
      • Simultaneous Upgrades
      • Racing Requests at the Home
      • Eviction Versus Intervention
    • Controller Resources
  • Progress and the Fabric16
  • Ordering and Synchronization12
  • Performance and Scalability12
  • Real Protocols12
  • SoC Integration12
  • Power, Clocking and Reliability12
  • Verification12
  • Debug and Bring-up12
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹Transient States and Races
  1. Topics
  2. Cache Coherency
  3. Races and Controller Design
  4. Transient States and Races
  5. Eviction Versus Intervention

Part 4 · Races and Controller Design · All levels

Eviction Versus Intervention

Resolve writeback-first and forward-first arrival orders while finding dirty data outside the cache array.

On this page

    Where is the line after its tag is gone?

    An eviction can remove the line from the cache array before H has taken the dirty data. A later forwarded request must therefore search the writeback (WB) entries, not only the array. Review Writeback Buffers.

    Both traces start from reset followed by C0 acquiring M and storing 1. When C0 evicts X, it moves 1 into a WB entry, sends PutM W and enters MI^A; H still records exclusive(C0), memory = 0. Select MSI. W labels that writeback; R labels C1's GetS.

    Eviction state (Primer names)

    Meaning

    Loads and stores to X

    MI^A

    Was M, wants I, waits for Put-Ack. WB entry keeps the dirty data.

    Stall

    SI^A, EI^A

    Was S or E, wants I, waits for Put-Ack. Clean. An SI^A reached from MI^A by a Fwd-GetS keeps the WB entry until Put-Ack.

    Stall

    II^A

    Lost the line to a Fwd-GetM or Inv while waiting for Put-Ack.

    Stall

    A Fwd that hits a line in MI^A is answered from the WB entry. Fwd-GetS: send Data to H, go to SI^A. Fwd-GetM: send Data to H, go to II^A. In every case the WB entry is freed only on Put-Ack.

    Order A: H accepts W before R

    Writeback W wins H's order. H writes memory, then sends Put-Ack, and C0 frees its WB entry. R waits until the memory write, then receives S / 1. The final reader is C1 only; H must not invent a retained S copy at evicted C0.

    H accepts C0's dirty writeback, queues C1's read, writes one to memory, acknowledges C0 and grants C1 shared one.
    Writeback-first order: H writes memory, acknowledges the writeback, then serves the queued reader.

    Step

    C0 state / value

    C1 state / value

    H directory

    Memory

    Newest data

    Initial

    M / 1

    I / -

    exclusive(C0)

    0

    C0: 1

    C0 evicts

    MI^A / 1 (in WB)

    I / -

    exclusive(C0)

    0

    C0 WB: 1, PutM(1) in flight to H

    1. PutM W at H

    MI^A / 1 (in WB)

    I / -

    exclusive(C0), pend PutM C0

    0

    C0 WB and H buffer: 1

    2. GetS R at H

    MI^A / 1 (in WB)

    IS^D / -

    exclusive(C0), pend PutM C0, queued GetS C1

    0

    C0 WB and H buffer: 1

    H writes memory

    MI^A / 1 (in WB)

    IS^D / -

    U, pend GetS C1

    1

    C0 WB, H buffer and memory: 1, Data(1) in flight to C1

    3. Put-Ack at C0

    I / -

    IS^D / -

    U, pend GetS C1

    1

    H buffer and memory: 1, Data(1) in flight to C1

    4. Data at C1

    I / -

    S / 1

    U, pend GetS C1

    1

    C1 and memory: 1

    (assumed) grant delivered

    I / -

    S / 1

    S{C1}

    1

    C1 and memory: 1

    Order B: R wins before the old PutM arrives

    H selects R and forwards to C0 while W's PutM is still in flight. C0 is in MI^A, so it answers from its WB entry and goes to SI^A. Its Data says PutM W outstanding: C0 keeps no readable copy, so H does not record it as a sharer. H writes memory and completes R, independent of W. When W arrives, C0 is no longer a recorded holder, so this is a PutM from a non-holder: H sends Put-Ack without changing the directory or memory. This course marks the Data so that H never records C0. The Primer instead records C0 as a sharer and removes it when the late PutM from a non-owner arrives, then sends Put-Ack. Either way the late PutM writes nothing. Some designs also tag each directory entry with a generation, a per-entry counter that tells an old message from a new transaction on the same line, but the rule does not need one.

    C1's read wins, C0 returns its buffered one from an evicted line, H writes memory and grants C1 S, then acknowledges C0's late writeback without changing anything.
    Forward-first order: the WB entry answers the Fwd, R completes without waiting for W, and the late PutM only gets its Put-Ack.

    Step

    C0 state / value

    C1 state / value

    H directory

    Memory

    Newest data

    Initial

    M / 1

    I / -

    exclusive(C0)

    0

    C0: 1

    C0 evicts

    MI^A / 1 (in WB)

    I / -

    exclusive(C0)

    0

    C0 WB: 1, PutM(1) in flight to H

    1. GetS R at H

    MI^A / 1 (in WB)

    IS^D / -

    exclusive(C0), pend GetS C1

    0

    C0 WB: 1, PutM(1) in flight to H

    2. Fwd-GetS at C0 (handled from WB)

    SI^A / 1 (in WB)

    IS^D / -

    exclusive(C0), pend GetS C1

    0

    C0 WB: 1, Data(1) and PutM(1) in flight to H

    3. Data at H

    SI^A / 1 (in WB)

    IS^D / -

    exclusive(C0), pend GetS C1

    0

    C0 WB and H buffer: 1, PutM(1) in flight to H

    H writes memory

    SI^A / 1 (in WB)

    IS^D / -

    U, pend GetS C1

    1

    C0 WB, H buffer and memory: 1, Data(1) in flight to C1, PutM(1) in flight to H

    4. Data at C1

    SI^A / 1 (in WB)

    S / 1

    U, pend GetS C1

    1

    C1, C0 WB and memory: 1, PutM(1) in flight to H

    (assumed) grant delivered

    SI^A / 1 (in WB)

    S / 1

    S{C1}

    1

    C1, C0 WB and memory: 1, PutM(1) in flight to H

    5. PutM W at H (non-holder)

    SI^A / 1 (in WB)

    S / 1

    S{C1}

    1

    C1, C0 WB and memory: 1

    6. Put-Ack at C0

    I / -

    S / 1

    S{C1}

    1

    C1 and memory: 1

    H writes memory and leaves the entry U, pend GetS C1: in MSI an S record claims memory is current, and C0, answering from its WB entry, is not recorded as a sharer. If W reaches H before C0's Data, H holds W in X's pending entry until the forward is answered; Part 10's A Power-Down Race traces that order.

    H never makes R wait for W. If it did, and W were queued behind R, R would wait for W while W waited for R. In SI^A C0's WB entry still holds 1 but serves no loads, and H does not count it as a sharer, so the final sharer set is {C1}. If H instead treated the late W as a normal writeback, it could overwrite newer data in memory or remove C1's record; acknowledging it without change avoids both.

    Common pitfall

    Responding 'absent' from an I tag while the same controller's WB entry holds the only current value. Also avoid treating a late PutM as a normal writeback after R: that could erase the reader's directory record.

    Interview

    Give both orders. W-first: H writes memory, then Put-Ack, and the reader waits behind the writeback. R-first: the WB entry answers the Fwd, R completes, and the late PutM from a non-holder gets Put-Ack with no change. Explain why the final sharer set is {C1}, not {C0,C1}.

    Check yourself Why must R-first not recreate S at C0 merely because Fwd-GetS normally downgrades M to S?

    C0's line was already evicted. It answers from the WB entry and goes to SI^A, which serves no loads and only waits for Put-Ack. Its Data says the PutM is outstanding, so H records S{C1}, not {C0,C1}.

    Related topics

    • Shared course model

    • Prerequisite: accepted writeback

    Previous

    41 / 167

    Next: Controller Resources

    Up next

    Up nextController Resources

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Why Transient States Exist
    • Simultaneous Upgrades