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
    • LLC Data and Directory Policies
    • Devices and DMA
    • The Memory-Controller Boundary
      • Point of Coherence and Serialization
      • Memory-Controller Reordering
      • Same-Address Hazards Below the Home
      • Memory Latency and Coherence
  • Power, Clocking and Reliability12
  • Verification12
  • Debug and Bring-up12
  • Interview and Design Review17
  • Capstone: A Coherent Model Lab5
Loading lesson

‹The Memory-Controller Boundary
  1. Topics
  2. Cache Coherency
  3. SoC Integration
  4. The Memory-Controller Boundary
  5. Same-Address Hazards Below the Home

Part 9 · SoC Integration · All levels

Same-Address Hazards Below the Home

Review read-after-write, write inversion, stale response and byte-merge hazards in the memory controller's queues.

Can all cache states look legal while memory becomes wrong?

Yes. The data-value invariant says each epoch starts with the newest value, the end value of the last write epoch (see the glossary for epoch). H can choose every epoch correctly and still hand a cache an old value if the queues below it lose that value. A correct H decision needs a downstream path that preserves its current bytes and matches replies to the work that requested them.

Use the previous lesson's write-queue model: X and Y (a different line) start at memory = 0, and queue acceptance lets the controller hold W X = 1, W X = 2 and R X at once. Each row below is a way the controller's queues can break the same-address rule. These are implementation defects, not legal outcomes of a weak memory model. If H waited for DRAM itself before the next access to X, none of them could arise.

Hazard

Concrete failure to detect

Contract obligation

Read-after-write

R X served from DRAM = 0 while W X = 1 waits in the write queue, H grants S with 0

Check reads against the write queue by address, forward the youngest matching data or hold the read until the write issues.

Write-after-read

A younger W X = 2 drains before an older R X that should return 1, so the read returns 2

An older same-address read issues, or takes its data, before a younger write to that address drains.

Write inversion

Old accepted W X = 1 overwrites newer W X = 2, DRAM ends at 1

Keep same-address write order in the write queue, or merge so the youngest data wins.

Stale response reuse

Reply for an old read finishes a newer request for X

Match active work identity, not address alone.

Partial-line merge

A later word update reconstructs other words from stale bytes

Preserve untouched current bytes under the write-mask contract.

Premature buffer reuse

Accepted newest bytes overwritten before safe handoff

Keep protected storage until the defined acceptance event.

A boundary response needs active-transaction matching, required ordering and untouched-byte preservation before responsibility can move.
Correct address matching is necessary but insufficient for current-data preservation.

Link to late acknowledgments and data for existing matching rules, and writeback buffers for source retention. Do not invent generation tags as a universal wire requirement: identity can be implemented in different ways, but the association must be unambiguous under permitted outstanding work.

For a partial-line example, take a second word W at byte offset 8 of X's line (Y stays a different line in this topic). A partial write of W must keep the newest X, not an X rebuilt from memory = 0. The whole-line traffic checker already injects that neighbouring-value loss; this lesson adds where a memory-side merge could reintroduce it: the merge must take untouched bytes from the youngest queued write to the line, not from DRAM.

Common pitfall

Verifying SWMR private tags while never comparing the values accepted and emitted by the memory-side queues.

Interview

Track address, work identity, required order, byte mask and data responsibility separately. State the first boundary event at which the value became wrong.

Check yourself Would a stronger CPU fence restore X after an older memory-side write overwrote it?

No. A fence constrains operation ordering under its architecture. It cannot repair a downstream implementation that violates its accepted ordering/data contract.

Related topics

  • Shared course model

  • Write-queue checker and stale-fill case

Previous

108 / 167

Next: Memory Latency and Coherence

Up next

Up nextMemory Latency and Coherence

Sign in to save progress

Practice this lessonReport an error

See also

  • Point of Coherence and Serialization