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
    • Read and Write-Permission Flows
    • Forwarding Versus Memory Sourcing
    • Writeback, Eviction and Cleaning
      • Dirty Writeback
      • Clean Eviction: Silent or Notified
      • Writeback Buffers
      • Cache Maintenance Operations
  • 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
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹Writeback, Eviction and Cleaning
  1. Topics
  2. Cache Coherency
  3. Transactions
  4. Writeback, Eviction and Cleaning
  5. Dirty Writeback

Part 3 · Transactions · All levels

Dirty Writeback

Follow a dirty value from the cache array to the WB entry, to H and to memory before the WB entry is freed.

On this page

    When may the evicting cache forget the bytes?

    Only after Put-Ack. In this course H writes memory first and then sends Put-Ack, so when C0 frees its WB entry, memory already holds the value. Review Dirty Responsibility first. The eviction states are defined on the topic hub.

    Warm start (MSI): X began at 0, C0 acquired M and stored 3. C0 M / 3, C1 I / -, H exclusive(C0), memory = 0. At local event L, C0 evicts X: the array entry is freed, the value moves to a WB entry and C0 sends PutM. No other request for X occurs in this trace.

    C0 evicts its dirty copy holding three into a WB entry and sends PutM. H writes three to memory and then acknowledges. C0 then frees the WB entry.
    Dirty eviction, course default: PutM, H writes memory, then Put-Ack. C0 keeps the WB entry until Put-Ack.

    Step

    C0 state / value

    C1 state / value

    H directory

    Memory

    Newest data

    0. Warm start

    M / 3

    I / -

    exclusive(C0)

    0

    C0: 3

    C0 evicts X

    MI^A / 3 (in WB)

    I / -

    exclusive(C0)

    0

    C0 WB entry: 3, PutM(3) in flight to H

    1. PutM at H

    MI^A / 3 (in WB)

    I / -

    exclusive(C0), pend PutM C0

    0

    C0 WB entry and H buffer: 3

    H writes memory

    MI^A / 3 (in WB)

    I / -

    U

    3

    C0 WB entry and memory: 3

    2. Put-Ack at C0

    I / -

    I / -

    U

    3

    memory: 3

    Read the newest-data column downwards: 3 is always somewhere. The WB entry is not a readable cache copy, since local loads and stores to X stall in MI^A, but it is where C0 answers any forwarded request for X until Put-Ack. H records U only after memory holds 3, so a new request after that point can safely read memory. Put-Ack here means memory has accepted the write, not that the write would survive power loss (see the course model).

    These traces assume H can always accept a PutM, for example a reserved writeback buffer or a separate message class. Why that reservation is needed to avoid deadlock is covered in Part 5, Message Classes and Virtual Networks.

    Variant: early Put-Ack

    Some designs send Put-Ack as soon as H has the payload in its own buffer, before the memory write, so the evicting cache can reuse its WB entry sooner. H then holds the only copy: it must keep its pending entry and buffer until memory is written, and must answer or stall any new request for X from that buffer, never from memory = 0. When a lesson uses this variant it says so.

    Step

    C0 state / value

    C1 state / value

    H directory

    Memory

    Newest data

    0. Warm start

    M / 3

    I / -

    exclusive(C0)

    0

    C0: 3

    C0 evicts X

    MI^A / 3 (in WB)

    I / -

    exclusive(C0)

    0

    C0 WB entry: 3, PutM(3) in flight to H

    1. PutM at H, Put-Ack sent

    MI^A / 3 (in WB)

    I / -

    exclusive(C0), pend PutM C0

    0

    C0 WB entry and H buffer: 3

    2. Put-Ack at C0

    I / -

    I / -

    exclusive(C0), pend PutM C0

    0

    H buffer: 3

    H writes memory

    I / -

    I / -

    U

    3

    memory: 3

    Common pitfall

    Freeing H's buffer when Put-Ack is sent in the early variant leaves memory at 0 and no copy of 3 anywhere. A Put-Ack hands the value on. It never makes the value disappear.

    Interview

    Name the three points: the array entry is freed (L), H holds the payload (step 1), memory holds it (H writes memory). Say which storage may be freed at each, for the default order and for early Put-Ack.

    Check yourself In the default order, at step 1 may H record U?

    No. Memory is still 0. H records U only after it has written 3 to memory, and only then sends Put-Ack. Until that point the directory reads exclusive(C0), pend PutM C0.

    Related topics

    • Shared course model

    • Eviction transient states

    • WB entry lifetime and capacity

    Previous

    34 / 167

    Next: Clean Eviction: Silent or Notified

    Up next

    Up nextClean Eviction: Silent or Notified

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Writeback Buffers
    • Cache Maintenance Operations