QED: Scalable Consistency Verification of Memory Instruction Reordering in Hardware
Gokulan Ravi, Xiaokang Qiu, Mithuna Thottethodi, T. N. Vijaykumar
Abstract
Memory consistency models (MCMs) in out-oforder-issue microprocessor-based shared-memory systems are notoriously non-intuitive and a source of hardware design bugs. Previous hardware verification work is limited to (1) in-orderissue processors, (2) proving the correctness only for some test cases, or (3) bounded verification that does not scale in practice beyond 7 instructions across all threads. Because cache coherence (i.e., write serialization and (non-)multi-copy write atomicity) and pipeline front-end verification and testing are well-studied, we focus on memory instruction ordering in the load-store queue (LSQ) of an out-of-order-issue processor. We show that our approach, called QED, needs to consider (1) only a small subset of instruction pairs and not all in-flight instructions, and (2) only one external event from other cores at a time per instruction of a pair (e.g., an invalidation), where only the events' ordering matters but not their originating cores. We call these results as two+two. Exhaustively exploring all pairs of instruction types and all types of event pairs intervening between each instruction pair, QED checks whether each of a reordered pair's execution trace leads to a cycle, which is well known to indicate an MCM violation. The MCM-violating execution traces in each instruction pair's exploration result in a decision tree of simple, narrowlydefined predicates to be evaluated in the RTL implementation. Our two+two result proves that the number of predicates for all MCMs is independent of program length and of the numbers of in-flight memory instructions and cores. Nevertheless, each predicate must explore all of the LSQ's RTL state. To combat RTL state space explosion, QED employs novel, empirical state space reduction, which itself is verified, to remain scalable for practical design sizes. In our experiments, we automatically generate the decision trees for SC, TSO, and RISC-V WMO, and verify the LSQ of BOOMv3 RTL with 128 loads/64 stores against RISC-V WMO using Jaspergold, where we found two correctness bugs and a performance bug (though not our goal). We fully verify the corrected implementation in under ten days. This unbounded RTL verification of a modern out-of-order-issue processor's LSQ against an MCM is the first in the literature.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 144fff66-c27b-482a-9255-624d293feb1dRelated papers
- Putting Weak Memory in Order via a Promising Intermediate RepresentationSung-Hwan Lee, Minki Cho, Roy David Margalit, Chung-Kil Hur et al.PLDI 2023 · 5 citations
- Synthesizing Formal Models of Hardware from RTL for Efficient Verification of Memory Model ImplementationsYao Hsiao, Dominic P. Mulligan, Nikos Nikoleris, Gustavo Petri et al.MICRO 2021 · 20 citations
- A Proof Recipe for Linearizability in Relaxed Memory Separation LogicSunho Park, Jaewoo Kim, Ike Mulder, Jaehwang Jung et al.PLDI 2024 · 4 citations
- INSIGHT: Automatic Generation of Explanations for Efficient Identification of Hardware Bugs and UnderspecificationsVincent Quentin Ulitzsch, Alessandro Bertani, Peter W. Deutsch, David Langus Rodriguez et al.S&P 2026
- Verification under Intel-x86 with PersistencyParosh Aziz Abdulla, Mohamed Faouzi Atig, Ahmed Bouajjani, K. Narayan Kumar et al.PLDI 2024 · 3 citations
