Introduction
The verification of modern microprocessor designs represents one of the most significant bottlenecks in hardware engineering. Traditional assertion-based verification (ABV) requires engineers to manually specify thousands of properties to catch potential bugs. This process is not only labor-intensive and expensive but also prone to human oversight; if a specific corner case is not covered by an assertion, the bug remains undetected.
Symbolic Quick Error Detection (SQED) has emerged as a powerful alternative to traditional methods. By focusing on self-consistency rather than checking against a manual specification, SQED has successfully identified critical bugs in industrial designs, such as RISC-V cores. However, despite its empirical success, SQED previously lacked a rigorous formal foundation. This research provides that foundation, proving that SQED is both sound and, under certain conditions, complete.
The SQED Methodology
The core principle of SQED is the "mirror test." Instead of asking if a processor produces the correct result according to a specification, it asks if the processor produces consistent results when performing the same operation on different parts of its architectural state.
The methodology involves partitioning the processor's architectural state (registers and memory) into two halves: an "original" set ($\mathcal{L}_O$) and a "duplicate" set ($\mathcal{L}_D$). A QED test consists of an original instruction sequence ($i_O$) followed by a duplicate sequence ($i_D$) that performs the same operations on the duplicate state.
As illustrated in Figure 2, the process begins by selecting a partition and a mapping. Bounded Model Checking (BMC) is then used to symbolically explore instruction sequences. If the final state $s_{2n}$ is not QED-consistent—meaning the values in $\mathcal{L}_O$ do not match those in $\mathcal{L}_D$—a counterexample is identified, signaling a bug.
Formalizing Soundness and Completeness
The researchers modeled the processor as a formal transition system, distinguishing between the architectural state (visible to software) and the non-architectural state (internal mechanics like pipelines and buffers). This formalization allowed for the proof of two critical properties:
- Soundness: The authors formally prove that SQED is sound regardless of the instruction specification. If the hardware is inconsistent with itself, it is inherently buggy. This "spec-independence" is a major advantage, as it eliminates the risk of false positives caused by incorrect manual assertions.
- Completeness: The paper categorizes bugs into Type-A (incorrect output values) and Type-B (unintended state corruption). They prove that for a wide class of these bugs, a failing QED test must exist. Furthermore, by introducing specialized "hard-reset" instructions to clear the non-architectural state, they prove a variant of SQED that is fully complete—guaranteeing that any bug in the design can be found given sufficient search depth.
Key Insights
A significant insight from this work is the role of the initial state. Standard SQED might miss "pathological" bugs that only trigger from very specific non-architectural states. The introduction of Soft-Reset and Hard-Reset concepts addresses this, ensuring that the verification process can reach the necessary internal states to trigger hidden errors.
Furthermore, because self-consistency is a universal property, SQED bypasses the need for expert-level implementation knowledge. This makes it a highly scalable and accessible verification strategy compared to traditional manual methods.
Conclusion and Future Directions
By providing a mathematical "proof of work" for SQED, this research elevates a successful heuristic to a rigorous formal method. While the current framework is robust, future work aims to extend these proofs to handle more complex scenarios, such as out-of-order execution and multi-core systems. Additionally, extending the framework to detect "liveness" issues, such as hardware deadlocks, remains an important area for continued research. The optimization of BMC tools to automatically determine optimal state partitions also promises to further enhance the efficiency of this verification approach.
Summary updated