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
    • Single-Writer, Multiple-Reader Invariant
    • Line States and Transitions
      • MSI Protocol
      • MESI and the Exclusive State
      • MOESI and Dirty Sharing
      • Stable Versus Transient States
    • Directory Versus Snoop Fundamentals
  • 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
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹Line States and Transitions
  1. Topics
  2. Cache Coherency
  3. States and Protocols
  4. Line States and Transitions
  5. Stable Versus Transient States

Part 2 · States and Protocols · All levels

Stable Versus Transient States

Track permission separately from requested permission while a shared-to-modified upgrade waits for invalidation acknowledgement.

On this page

    C0 has asked to write, but C1 has not yet invalidated its copy. What state should C0 be in? Calling it M would grant permission too early; calling it an ordinary S would hide unfinished work. A transient state records that work and the conditions still required for completion. Prerequisite: the stable MSI and MESI permissions.

    The names follow the Primer, second edition: XY^D means 'was X, wants Y, waiting for Data', and XY^AD adds 'waiting for acks'. Because this course collects Inv-Acks at H, the requester only ever waits for Data. The official gem5 MESI Two Level controller description uses the plain names IS, IM and SM for comparable states; our messages follow the course model, not gem5's opcodes.

    Course name (acks at H)

    Primer name with acks at requester

    What is retained?

    What is missing?

    Access rule

    IS^D

    IS^D

    No usable value

    Value and read permission

    Loads and stores stall

    IM^D

    IM^AD

    No usable value

    Value and exclusive permission

    Loads and stores stall

    SM^D

    SM^AD

    Current shared value

    H's grant, sent after H collects the Inv-Acks

    Loads hit, stores stall

    A local store request changes S to SM^D, where loads still hit; only Data granting M permission changes SM^D to M.
    Upgrade states in the course model (SM_D is SM^D); H's acknowledgement tracking is separate, and races are omitted.

    SM^D can also lose: if another writer's GetM was serialized first, C0 receives an Inv while waiting, answers it, and becomes IM^D, now needing the data as well as permission. That race is taught in Part 4.

    Reading the upgrade trace as transient bookkeeping

    The shared upgrade with one required acknowledgement (GetM, Inv, Inv-Ack collected at H, then permission-only Data) is traced row by row in Epochs and Serialization. Use the same C0 and C1 roles and step numbers, and read each row for its pending work rather than its messages:

    Step in that trace

    C0 retains

    C0 still lacks

    H's pending entry tracks

    1. GetM at H

    S copy of 0, loads hit

    Exclusive permission

    Requester C0, acks 0/1

    2. Inv at C1

    S copy of 0, loads hit

    Exclusive permission

    Unchanged: no message reached H, C1 still listed

    3. Inv-Ack at H

    S copy of 0, loads hit

    Exclusive permission (grant not yet sent)

    acks 1/1, C1 removed, ready to grant

    4. Data at C0

    Value and M permission

    Nothing: C0 is stable M

    Kept until the (assumed) grant-delivered row

    C0 stays in SM^D through steps 1 to 3 and is stable M only at step 4; H's entry settles at exclusive(C0) one row later, under the course model's grant-delivery assumption. Four serial legs, because acks go to H. The Primer's design instead sends acks to the requester with an ack count in Data, three legs; both are legal, and then C0 waits in SM^AD for Data and every ack.

    What the pending record must remember

    H needs the requester C0, the outstanding acknowledgement count, and the source of the data; C0 needs its requested permission and retained line. A state label without these obligations cannot explain completion. If data and permission arrived separately in a different model, both conditions would need tracking; do not infer one from the arrival of the other.

    Stable describes a settled permission condition; it does not mean no future event can change it. Transient describes outstanding protocol work; it does not promise a fixed number of cycles. Eventual delivery, eventual controller service and available buffering would all be needed to argue that this pending request finishes. The snapshots establish permission safety for this trace, not a general progress proof.

    Common pitfall

    A load hit in SM^D is fine, but a store is not: the value is present while exclusive permission is absent. Likewise, counting an acknowledgement when sending Inv would confuse issuing a request with observing its completion.

    Check yourself Why not send the M-permission Data alongside Inv and rely on C1 invalidating quickly?

    Here that is unsafe only because the acks go to H: C0 would receive Data, treat it as the grant and store while C1 might still hold S, since no FIFO order exists between Data and Inv. With an ack count in Data and acks sent to the requester (the Primer's design), sending Data early is legal: C0 waits in SM^AD until all acks arrive, so the writer-plus-reader overlap still cannot occur.

    Interview

    When asked why transients exist, name a retained fact and a missing fact: SM^D has data but lacks exclusive permission, so loads hit and stores stall. Then show the Inv-Ack returning to H and Data granting permission only after the acknowledgement condition is satisfied.

    Related topics

    • Course model and delivery assumptions

    • Upgrade trace: Epochs and Serialization

    • MSI permissions and value tracking

    • Compare: silent E-to-M store

    Previous

    21 / 167

    Next: Directory Versus Snoop Fundamentals

    Up next

    Up nextDirectory Versus Snoop Fundamentals

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • MSI Protocol
    • MESI and the Exclusive State