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
    • Virtual Networks and Progress
    • Filtering and Snoop Pruning
    • Latency, Fairness and QoS
    • Hierarchical and Chiplet Coherence
      • Two-Level Directories
      • Clusters and Global Homes
      • Coherence Across Dies
      • Hierarchy Trade-Offs
  • 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

‹Hierarchical and Chiplet Coherence
  1. Topics
  2. Cache Coherency
  3. Progress and the Fabric
  4. Hierarchical and Chiplet Coherence
  5. Hierarchy Trade-Offs

Part 5 · Progress and the Fabric · All levels

Hierarchy Trade-Offs

Compare scoped metadata and local traffic against added indirection, replicated state and cross-level bottlenecks.

Does adding a hierarchy always reduce cost?

No. With this section's clusters, K0 = {C0, C2} and K1 = {C1}, a flat presence vector needs 3 bits. The hierarchy needs a 2-bit global cluster vector plus a local vector in each occupied cluster: 4 bits when only K0 holds X, 3 when only K1 does, and 5 when both do. It never saves a bit here. Hierarchy is not a synonym for compression. It can improve locality or spread work, but the full metadata and path costs matter.

Now take an illustrative design with 64 caches in 8 clusters of 8. For one tracked line, count only presence bits, and assume a local vector is allocated only in occupied clusters. A flat vector uses 64. The global cluster vector uses 8, and each occupied cluster's local vector adds 8. With two occupied clusters the total is 24; with all eight it is 72. The hierarchy saves bits while at most six clusters are occupied, breaks even at seven (8 + 7 x 8 = 64) and costs more at eight. These are not complete directory sizes: tags, pointers, pending entries, replacement state, ECC and the real allocation policy are excluded.

example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Illustrative presence-vector accounting, not a hardware area estimate.
# A local vector is allocated only in occupied clusters.
def bits(clusters, per_cluster, occupied):
    assert clusters > 0 and per_cluster > 0
    assert 0 <= occupied <= clusters
    flat = clusters * per_cluster
    hierarchy = clusters + occupied * per_cluster
    return flat, hierarchy

assert bits(8, 8, 2) == (64, 24)
assert bits(8, 8, 8) == (64, 72)
assert bits(8, 8, 7) == (64, 64)
# Saves only with at most six occupied clusters: break-even at seven.
assert [k for k in range(9) if bits(8, 8, k)[1] < 64] == list(range(7))

# This section's clusters: K0 = {C0, C2}, K1 = {C1}.
sizes = {"K0": 2, "K1": 1}
flat = sum(sizes.values())
def small(occupied):
    return len(sizes) + sum(sizes[k] for k in occupied)
cases = [("K0",), ("K1",), ("K0", "K1")]
assert flat == 3
assert [small(c) for c in cases] == [4, 3, 5]
assert all(small(c) >= flat for c in cases)
assert any(small(c) > flat for c in cases)
print("PASS: sparse occupancy saves bits, break-even at 7 of 8 clusters, the small example never saves")

Dimension

Possible benefit

Cost or countercase

Global cluster vector

Summarize many local cores

Local metadata and replication can exceed flat storage.

Local reads and probes

Keep eligible work inside a cluster

Global permission may still require remote coordination.

Traffic aggregation

Avoid visiting every remote private cache directly

Local fanout and required acknowledgements still exist.

Home placement

Distribute work by address or locality

A hot line still needs one global ordering decision.

Extra proxy stages

Distribute work and buffer data in transit

Add finite resources, traversal delay and dependency edges.

A hierarchy trade-off review includes workload, all metadata levels, required paths and finite-resource dependencies.
Compare the whole design under an explicit sharing pattern.

From the dirty checkpoint of Three-Hop Versus Four-Hop, a hierarchy that saves global presence bits still has to find C0 and keep X = 1 safe until the transfer completes. The eight-leg path of Clusters and Global Homes is not guaranteed faster than the flat three- or four-leg paths; locality, queueing and physical placement decide. No performance or progress guarantee follows from the bit count.

Common pitfall

Comparing a complete flat directory against only the global hierarchy vector, while omitting local tags, entries, pending state and data buffers.

Interview

Give one sparse-sharing benefit and one dense-sharing counterexample. Then explain why metadata savings alone say nothing about dirty intervention latency.

Check yourself Why is 24 versus 64 not an SRAM-area result?

It counts only presence-vector bits under an assumed occupancy and allocation policy. Physical SRAM dimensions and the omitted tags, state, protection and replication can change the total substantially.

Related topics

  • Shared course model

  • Scoped coverage

  • Endpoint counts are not link costs

Previous

61 / 167

Next: Ordering and Synchronization

Up next

Up nextOrdering and Synchronization

Sign in to save progress

Practice this lessonReport an error

See also

  • Two-Level Directories
  • Clusters and Global Homes