ROVER: RTL Optimization via Verified E-Graph Rewriting

Samuel Coward,Theo Drane,George A. Constantinides
2024-06-18
Abstract:Manual RTL design and optimization remains prevalent across the semiconductor industry because commercial logic and high-level synthesis tools are unable to match human designs. Our experience in industrial datapath design demonstrates that manual optimization can typically be decomposed into a sequence of local equivalence preserving transformations. By formulating datapath optimization as a graph rewriting problem we automate design space exploration in a tool we call ROVER. We develop a set of mixed precision RTL rewrite rules inspired by designers at Intel and an accompanying automated validation framework. A particular challenge in datapath design is to determine a productive order in which to apply transformations as this can be design dependent. ROVER resolves this problem by building upon the e-graph data structure, which compactly represents a design space of equivalent implementations. By applying rewrites to this data structure, ROVER generates a set of efficient and functionally equivalent design options. From the ROVER generated e-graph we select an efficient implementation. To accurately model the circuit area we develop a theoretical cost metric and then an integer linear programming model to extract the optimal implementation. To build trust in the generated design ROVER also produces a back-end verification certificate that can be checked using industrial tools. We apply ROVER to both Intel-provided and open-source benchmarks, and see up to a 63% reduction in circuit area. ROVER is also able to generate a customized library of distinct implementations from a given parameterizable RTL design, improving circuit area across the range of possible instantiations.
Hardware Architecture
What problem does this paper attempt to address?
The paper attempts to address the issue that existing commercial logic and high-level synthesis tools in the semiconductor industry cannot match the performance of manually designed circuits, especially in terms of Register Transfer Level (RTL) design and optimization. Manual optimization can often be decomposed into a series of local equivalent transformations, but the order of these transformations has a significant impact on the final result and depends on the specific design. Therefore, the paper proposes a verification-based e-graph rewriting method to generate efficient and functionally equivalent design options through automated design space exploration. Specifically, the goals of the paper are: 1. **Automated Design Space Exploration**: Automatically explore the design space by modeling the data path optimization problem as a graph rewriting problem. 2. **Generate Efficient RTL Implementations**: Generate efficient and functionally equivalent design options by applying a series of mixed-precision RTL rewriting rules. 3. **Ensure the Correctness of Generated Designs**: Ensure that the generated designs are functionally equivalent to the original design through backend verification certificates. 4. **Minimize Circuit Area or Delay**: Given an RTL implementation, find functionally equivalent implementations that minimize circuit area or delay. The main contributions of the paper include: - Applying e-graph rewriting techniques to RTL data path optimization. - Proposing a set of multi-bit-width and multi-symbol rewriting rules to support data path design space exploration. - Developing a method to automatically generate necessary and sufficient conditions for RTL rewriting verification. - Proposing a robust verification method based on problem decomposition to ensure the correctness of the generated RTL designs. Through these methods, the paper aims to improve the level of automation in hardware design, reduce the workload of engineers, and generate more efficient circuit designs.