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
    • Memory Models and Protocols
    • Barriers, Fences and Completions
    • Speculation, Replay and Recovery
  • 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

‹Cache Coherency
  1. Topics
  2. Cache Coherency
  3. Ordering and Synchronization

Part 6 · Ordering and Synchronization · All levels

Ordering and Synchronization

Relate coherent values to architectural memory models, fences, atomics and speculative recovery.

  • 3topics
  • 12lessons

Topics in this section

  1. 1Memory Models and Protocols4 lessons
    • Coherence Is Not Consistency
    • SC, TSO and Store Buffers
    • Litmus Tests: SB and MP
    • Weak Models: Arm and RISC-V
  2. 2Barriers, Fences and Completions4 lessons
    • Fences Are Not Flushes
    • Acquire and Release
    • Atomics and RMW at the Cache
    • Completion Versus Visibility
  3. 3Speculation, Replay and Recovery4 lessons
    • Speculative Loads and Invalidations
    • Load Replay on Snoop
    • LR/SC and Reservations
    • Ordering Bugs in Out-of-Order Cores

The previous transactions preserve permission and data per location. This section asks which combinations of observations across operations an architecture permits. Work from a named model and explicit initial values, then connect ordering, atomicity and recovery to the coherent implementation.

Learning sequence moves from per-location correctness to memory models, synchronization and speculative recovery.
Coherence is necessary but not a complete architectural memory model.

Twelve lessons

Lesson

After it you can...

Coherence Is Not Consistency

Explain why SB 0,0 distinguishes SC from the stated TSO subset.

SC, TSO and Store Buffers

Separate issue, forwarding and global store visibility.

Litmus Tests: SB and MP

Enumerate exact outcomes with a bounded operational model.

Weak Models: Arm and RISC-V

Demand the published model and exact instruction test.

Fences Are Not Flushes

Distinguish ordering from memory cleaning.

Acquire and Release

Identify which store the acquire must read from.

Atomics and RMW at the Cache

Separate indivisibility from individual coherent accesses.

Completion Versus Visibility

Name the endpoint behind a completion claim.

Speculative Loads and Invalidations

Separate execution from architectural observation.

Load Replay on Snoop

Preserve protocol work during a selected replay policy.

LR/SC and Reservations

Distinguish reservations, permission and value equality.

Ordering Bugs in Out-of-Order Cores

Build model-specific evidence before proposing a fix.

Suggested order: memory models, synchronization, then speculation. The litmus examples add a second location Y in a different line, with X = Y = 0 initially unless stated otherwise. Protocol traces keep the shared model's cache and home notation.

Scope for the whole section: the examples are abstract hardware operations (loads, stores, fences and atomics on ordinary coherent memory), not C/C++ programs, whose compilers and language rules add their own reorderings. The litmus enumerator models SC and TSO only. Arm and RISC-V outcomes come from their published models, never from the enumerator.

Common pitfall

A weak-model-permitted result is not a lost-update exemption for the coherence controller. A controller losing the required X value is a different failure from a legal cross-location observation.

Check yourself Why is a passing SWMR check insufficient to approve a committed SC MP result flag=1,payload=0?

SWMR checks permissions per line. The named SC program orders the payload write before the flag write and the flag read before the payload read. That cross-location contract is additional.

Related topics

  • Shared course model

  • Prerequisite: races and pending work

  • Start: memory models

PreviousNext: Memory Models and Protocols

Up next

Up nextMemory Models and Protocols

Sign in to save progress

Practice this lessonReport an error

See also

  • How to Use This Course
  • Reading Path
  • Cache Coherency Glossary