Introduction
Verifying complex arithmetic circuits, or datapaths, remains one of the most significant bottlenecks in modern hardware design. As engineers optimize circuits for power, performance, and area (PPA), the resulting implementation often bears little resemblance to the original mathematical specification. While industrial Equivalence Checking (EC) tools are highly sophisticated, they frequently struggle with aggressive arithmetic optimizations, often timing out after 24 hours or returning inconclusive results. This failure necessitates manual guidance from verification engineers—a process that is slow, expensive, and prone to human error.
This paper introduces a novel "verification assistant" that automates this guidance. By leveraging e-graphs and word-level rewriting, the framework decomposes a single, intractable proof into a "waterfall" of small, manageable intermediate steps. This approach has demonstrated the ability to solve previously "unverifiable" designs in seconds and achieve speedups of over 6x on standard benchmarks.
Methodology
The proposed framework acts as a bridge between high-level hardware descriptions and industrial verification tools. The workflow consists of five primary stages:
- Parsing: The tool utilizes the open-source Slang parser to convert SystemVerilog designs (both specification and implementation) into an intermediate representation of S-expressions.
- E-Graph Construction: These expressions are loaded into an e-graph (equivalence graph). An e-graph is a specialized data structure capable of representing a vast space of mathematically equivalent circuits compactly, avoiding the exponential memory explosion typical of traditional rewriting systems.
- Equality Saturation: Using the
egglibrary, the framework applies a comprehensive library of word-level rewrites. These rules include standard algebraic identities (e.g.,a * 2becomesa << 1) but are crucially bitwidth-dependent. This ensures that the rewrites respect hardware-specific constraints like overflows and signal truncation. - Extraction via ILP: After the e-graph explores the equivalence space, the tool must find the most efficient path between the specification and the implementation. It uses Integer Linear Programming (ILP) to identify intermediate versions of the designs that share the maximum amount of internal logic, making them easier for an EC tool to compare.
- The Proof Waterfall: Rather than attempting to prove $Spec = Impl$ directly, the assistant generates a sequence of intermediate SystemVerilog files representing the steps found during extraction. The industrial tool then verifies each step in the chain. If every incremental step is proven, the entire transformation is formally validated.
Key Insights
The Waterfall Strategy
The core innovation lies in the "waterfall" approach. Industrial tools are exceptionally efficient at local logic optimization but often fail to grasp global algebraic transformations. By providing a sequence of intermediate "hints," the assistant plays to the strengths of existing solvers, turning a global search problem into a series of local checks.
Avoiding Phase-Ordering Problems
Traditional rewriting tools often suffer from the "phase-ordering problem," where the order in which rules are applied determines whether a solution is found. E-graphs mitigate this by applying all rules simultaneously and maintaining all discovered equivalences in parallel, ensuring no optimization path is prematurely discarded.
Soundness without Trust
A critical feature of this framework is that the e-graph assistant itself does not need to be part of the Trusted Computing Base (TCB). Because every intermediate step it generates is independently verified by a trusted industrial EC tool, any errors in the assistant's logic would be caught during the waterfall verification process, maintaining the mathematical rigor of the final proof.
Experimental Results
The authors evaluated the tool against a suite of challenging datapath benchmarks, including ADPCM decoders, H.264 motion estimation kernels (VBSME), and reconfigurable filters provided by Intel.
- Solving the Unverifiable: In a case study involving complex floating-point multiplication of denormal numbers, a leading industrial tool failed to reach a conclusion after 24 hours. The e-graph assistant generated a proof waterfall that the same industrial tool verified in just 0.24 seconds.
- Performance Gains: For the H.264 VBSME-8 benchmark, the total verification time was reduced from 93 seconds to 14.5 seconds, representing a 6.4x speedup.
- Automation at Scale: The tool successfully automated the generation of up to 115 intermediate proof steps. Manually constructing such a proof path would be practically impossible for a human engineer within a standard design cycle.
Limitations and Future Work
While highly effective, the tool currently faces challenges with certain complex designs, such as the "Box Filter" benchmark, where it could not find a complete path between the specification and implementation. In these cases, it still provided a 4.5x speedup by simplifying the problem, but it suggests that the rewrite library requires further expansion.
Additionally, there is a known trade-off between the time spent on ILP extraction and the resulting verification speed. Future research will focus on extending the framework to handle sequential logic (circuits with state and memory) and exploring C-to-RTL verification, which would allow designers to formally link high-level C++ models directly to their hardware implementations.
Summary updated