Overview
Cache coherence is the property that maintains data consistency across multiple caches in a multi-core system. It enables data sharing among caches and substantially reduces task computation time.[1] In multi-core cache systems, when multiple accesses target the same cache line, coherence must be enforced correctly to preserve correctness.[2]
Coherence Protocols
Canonical coherence protocols are organized around a set of stable states that describe the permitted accesses to a cached line. One well-known set of canonical states is MOESIF (Modified, Owned, Exclusive, Shared, Invalid, Forward), which is used by the open-source BedRock coherence protocol.[3]
BedRock reduces implementation burden by eliminating transient coherence states from the protocol. The protocol's design complexity, concurrency, and verification effort have been analyzed and compared against a canonical directory-based invalidate coherence protocol.[3]
Directory Implementations (BlackParrot-BedRock)
The BedRock protocol has been instantiated in the BlackParrot 64-bit RISC-V multicore processor through three cache coherence directory microarchitectures, collectively called BlackParrot-BedRock (BP-BedRock):[3]
- Fixed-function coherence directory engine — provides a baseline design for performance and area comparisons.
- Microcode-programmable coherence directory — demonstrates the feasibility of implementing a programmable coherence engine capable of maintaining sufficient protocol processing performance.
- Hybrid fixed-function and programmable coherence directory — blends the protocol processing performance of the fixed-function design with the programmable flexibility of the microcode-programmable design.
These implementations demonstrate the feasibility and challenges of including programmable logic within the coherence system of modern shared-memory multicore processors.[3]
Network-on-Chip (NoC) Considerations
In multi-core designs, cache coherence generates traffic that must be carried by the on-chip interconnect. Routing serves two roles: facilitating data sharing (influenced by topology) and managing NoC-level communication. Cache coherence is, however, often overlooked in routing, causing mismatches between design expectations and evaluation outcomes.[1]
Two main challenges have been identified:[1]
- The lack of specialized tools to assess cache coherence's impact.
- The neglect of topology selection in routing.
A Cache Coherence Traffic Analyzer (CCTA) has been proposed to assess coherence traffic, and a cache-coherence-aware routing approach with integrated topology selection has been shown to achieve up to 10.52% lower packet latency, 55.51% faster execution time, and 49.02% total energy savings.[1]
Failure Modes
If coherence is not enforced correctly, accesses to the same cache line can lead to:[2]
- Stale data — a core reads a value that has been updated elsewhere.
- Data corruption — concurrent updates produce an inconsistent line state.
- Stalls — cores are forced to wait while coherence is re-established.
Verification Relevance
Cache coherence conflicts are among the system behaviors that may need to be exercised during RISC-V verification and coverage-oriented test generation. In that context, coverage closure refers to the process of reaching sufficient functional and code coverage to gain confidence that relevant design behaviors — including coherence interactions — have been tested.[2]