Automatic Datapath Optimization using E-Graphs

Authors: Samuel Coward, George A. Constantinides, Theo Drane

Submitted to arXiv on 25 Apr. 2022
License: CC BY 4.0
Abstract

Manual optimization of Register Transfer Level (RTL) datapath is commonplace in industry but holds back development as it can be very time consuming. We utilize the fact that a complex transformation of one RTL into another equivalent RTL can be broken down into a sequence of smaller, localized transformations. By representing RTL as a graph and deploying modern graph rewriting techniques we can automate the circuit design space exploration, allowing us to discover functionally equivalent but optimized architectures. We demonstrate that modern rewriting frameworks can adequately capture a wide variety of complex optimizations performed by human designers on bit-vector manipulating code, including significant error-prone subtleties regarding the validity of transformations under complex interactions of bitwidths. The proposed automated optimization approach is able to reproduce the results of typical industrial manual optimization, resulting in a reduction in circuit area by up to 71%. Not only does our tool discover optimized RTL, but also correctly identifies that the optimal architecture to implement a given arithmetic expression can depend on the width of the operands, thus producing a library of optimized designs rather than the single design point typically generated by manual optimization. In addition, we demonstrate that prior academic work on maximally exploiting carry-save representation and on multiple constant multiplication are both generalized and extended, falling out as special cases of this paper.

The papers around it, by date and closeness

Higher is closer to this paper; left is older. Lines join papers close to each other: groups of lines are sub-topics. Select a point to see why it is there. Back to the summary of this paper

How to read this map? Illustrated guide

Closest papers Prior work it builds on Papers that cite it

Papers around this one

Ranked by how close their title and abstract are to this paper’s. Select some to read them together.

Closest papers

  1. Very close Cites this paper
    Automating Constraint-Aware Datapath Optimization using E-Graphs
    Samuel Coward, G. Constantinides, Theo Drane · 2023 · Design Automation Conference · cited 31 times · Not summarized yet
    Abstract

    Numerical hardware design requires aggressive optimization, where designers exploit branch constraints, creating optimization opportunities that are valid only on a sub-domain of input space. We developed an RTL optimization tool that automatically learns the consequences of conditional branches and exploits that knowledge to enable deep optimization. The tool deploys custom built program analysis based on abstract interpretation theory, which when combined with a data-structure known as an e-graph simplifies complex reasoning about program properties. Our tool fully-automatically discovers known floating-point architectures from the computer arithmetic literature and out-performs baseline E…

  2. Very close Cites this paper Uses this paper in depth
    ROVER: RTL Optimization via Verified E-Graph Rewriting
    Samuel Coward, Theo Drane, G. Constantinides · 2024 · IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems · cited 20 times · Not summarized yet
    Abstract

    Manual register transfer level (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 determin…

  3. Very close
    ASPEN: LLM-Guided E-Graph Rewriting for RTL Datapath Optimization
    Niansong Zhang, Chen-Hui Deng, Johannes Maximilian Kuehn et al. · 2025 · Workshop on Machine Learning for CAD · cited 13 times · Not summarized yet
    Abstract

    Datapath RTL optimization is a challenging multi-objective task that balances power, performance, and area (PPA). Traditionally, this process is done manually due to the complexity of balancing conflicting objectives. Recent approaches have explored rule-based rewriting using equality saturation with e-graphs, which solves the phase ordering problem but relies on manually designed rewrite rules and proxy PPA cost models. Meanwhile, large language models (LLMs) have been applied to RTL code generation and optimization due to their reasoning and programming capabilities. However, existing LLM-based methods lack a structured approach to represent and explore Pareto-optimal design points while e…

  4. Very close Cites this paper
    Multiplier Optimization via E-Graph Rewriting
    Andy Wanna, Samuel Coward, Theo Drane et al. · 2023 · Asilomar Conference on Signals, Systems and Computers · cited 7 times · Not summarized yet
    Abstract

    Multiplier circuits account for significant resource usage in datapath-dominated circuit designs, and RTL designers continue to build bespoke hand-crafted multiplication arrays for their particular application. The construction of an optimized multiplier presents trade-offs between pre-processing to generate a smaller array and array reduction. A data structure known as an e-graph has recently been applied to datapath optimization, where the e-graph's ability to efficiently explore trade-offs has been shown to be crucial. We propose an e-graph based rewriting framework to construct optimized multiplier circuits. Such a framework can express alternative multiplier representations and generate…

  5. Very close
    RTL++: Graph-enhanced LLM for RTL Code Generation
    Mohammad Akyash, Kimia Zamiri Azar, H. Kamali · 2025 · 2025 IEEE International Conference on LLM-Aided Design (ICLAD) · cited 38 times · Not summarized yet
    Abstract

    As hardware design complexity escalates, there is an urgent need for advanced automation in electronic design automation (EDA). Traditional register transfer level (RTL) design methods are manual, time-consuming, and prone to errors. While commercial (instruction-tuned) large language models (LLMs) shows promising performance for automation, they pose security and privacy concerns. Open-source models offer alternatives; however, they frequently fall short in quality/correctness, largely due to limited, high-quality RTL code data essential for effective training and generalization. This paper proposes RTL++, a first-of-its-kind LLM-assisted method for RTL code generation that utilizes graph r…

  6. Very close
    RTLRewriter: Methodologies for Large Models Aided RTL Code Optimization
    Xu-Feng Yao, Yiwen Wang, Xing Li et al. · 2024 · International Conference on Computer Aided Design · cited 59 times · Not summarized yet
    Abstract

    Register Transfer Level (RTL) code optimization is crucial for enhancing the efficiency and performance of digital circuits during early synthesis stages. Currently, optimization relies heavily on manual efforts by skilled engineers, often requiring multiple iterations based on synthesis feedback. In contrast, existing compilerbased methods fall short in addressing complex designs. This paper introduces RTLRewriter, an innovative framework that leverages large models to optimize RTL code. A circuit partition pipeline is utilized for fast synthesis and efficient rewriting. A multi-modal program analysis is proposed to incorporate vital visual diagram information as optimization cues. A specia…

  7. Very close Cites this paper Uses this paper in depth
    Datapath Verification via Word-Level E-Graph Rewriting
    Samuel Coward, Emiliano Morini, Bryan Tan et al. · 2023 · Formal Methods in Computer-Aided Design · cited 8 times · Not summarized yet
    Abstract

    Formal verification of datapath circuits is challenging as they are subject to intense optimization effort in the design phase. Industrial vendors and design companies deploy equivalence checking against a golden or existing reference design to satisfy correctness concerns. State-of-the-art datapath equivalence checking tools deploy a suite of techniques, including rewriting. We propose a rewriting framework deploying bitwidth-dependent rewrites based on the e-graph data structure, providing a powerful assistant to existing tools. The e-graph allows generation of a path of rewrites between the reference and implementation designs, which can then be checked by a trusted industry tool. We demo…

  8. Very close Cites this paper
    E-Syn: E-Graph Rewriting with Technology-Aware Cost Functions for Logic Synthesis
    Chen Chen, Guangyu Hu, Dong-Sheng Zuo et al. · 2024 · Design Automation Conference · cited 34 times · Not summarized yet
    Abstract

    Logic synthesis plays a crucial role in the digital design flow. It has a decisive influence on the final Quality of Results (QoR) of the circuit implementations. However, existing multi-level logic optimization algorithms often employ greedy approaches with a series of local optimization steps. Each step breaks the circuit into small pieces (e.g.,k-feasible cuts) and applies incremental changes to individual pieces separately. These local optimization steps could limit the exploration space and may miss opportunities for significant improvements. To address the limitation, this paper proposes using e-graph in logic synthesis. The new workflow, named E-Syn, makes use of the well-established …

Prior work it builds on

  1. Related* Used in depth by this paper
    Data-Flow Transformations to Maximize the Use of Carry-Save Representation in Arithmetic Circuits
    A. K. Verma, P. Brisk, P. Ienne · 2008 · IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems · cited 65 times · Not summarized yet
  2. Related Used in depth by this paper
    egg: Fast and extensible equality saturation
    Max Willsey, Chandrakana Nandi, Y. Wang et al. · 2020 · Proc. ACM Program. Lang. · cited 328 times · Not summarized yet
    Abstract

    An e-graph efficiently represents a congruence relation over many expressions. Although they were originally developed in the late 1970s for use in automated theorem provers, a more recent technique known as equality saturation repurposes e-graphs to implement state-of-the-art, rewrite-driven compiler optimizations and program synthesizers. However, e-graphs remain unspecialized for this newer use case. Equality saturation workloads exhibit distinct characteristics and often require ad-hoc e-graph extensions to incorporate transformations beyond purely syntactic rewrites. This work contributes two techniques that make e-graphs fast and extensible, specializing them to equality saturation. A …

  3. Close
    IMpress: Large Integer Multiplication Expression Rewriting for FPGA HLS
    Ecenur Ustun, Ismail San, Jiaqi Yin et al. · 2022 · IEEE Symposium on Field-Programmable Custom Computing Machines · cited 44 times · Not summarized yet
    Abstract

    Large integer multiplication is becoming a major challenge for FPGA-based acceleration of many cryptographic applications. Existing techniques for decomposing and optimizing large integer multiplication bring about nontrivial trade-offs between different resource types as well as performance. In this work, we regard determining the level and order of multiplication decomposition as a phase ordering problem, which is a notable problem in compiler optimization. Our framework, IMpress, leverages equality saturation to automatically produce a wide range of equivalent integer multiplication expressions corresponding to various hardware implementations. We devise constrained and multi-objective ex…

  4. Related
    Equality saturation: a new approach to optimization
    R. Tate, M. Stepp, Zachary Tatlock et al. · 2009 · ACM-SIGACT Symposium on Principles of Programming Languages · cited 355 times · Not summarized yet
    Abstract

    Optimizations in a traditional compiler are applied sequentially, with each optimization destructively modifying the program to produce a transformed program that is then passed to the next optimization. We present a new approach for structuring the optimization phase of a compiler. In our approach, optimizations take the form of equality analyses that add equality information to a common intermediate representation. The optimizer works by repeatedly applying these analyses to infer equivalences between program fragments, thus saturating the intermediate representation with equalities. Once saturated, the intermediate representation encodes multiple optimized versions of the input program. A…

  5. Related*
    A Difference Based Adder Graph Heuristic for Multiple Constant Multiplication Problems
    Oscar Gustafsson · 2007 · 2007 IEEE International Symposium on Circuits and Systems · cited 133 times · Not summarized yet

Papers that cite it

  1. Close Uses this paper in depth
    Combining Power and Arithmetic Optimization via Datapath Rewriting
    Samuel Coward, Theo Drane, Emiliano Morini et al. · 2024 · IEEE Symposium on Computer Arithmetic · cited 15 times · Not summarized yet
    Abstract

    Industrial datapath designers consider dynamic power consumption to be a key metric. Arithmetic circuits contribute a major component of total chip power consumption and are therefore a common target for power optimization. While arithmetic circuit area and dynamic power consumption are often correlated, there is also a tradeoff to consider, as additional gates can be added to explicitly reduce arithmetic circuit activity and hence reduce power consumption. In this work, we consider two forms of power optimization and their interaction: circuit area reduction via arithmetic optimization, and the elimination of redundant computations using both data and clock gating. By encoding both these cl…

  2. Close Uses this paper in depth
    SEER: Super-Optimization Explorer for High-Level Synthesis using E-graph Rewriting
    Jian-Yi Cheng, Samuel Coward, Lorenzo Chelini et al. · 2024 · International Conference on Architectural Support for Programming Languages and Operating Systems · cited 29 times · Not summarized yet
    Abstract

    High-level synthesis (HLS) is a process that automatically translates a software program in a high-level language into a low-level hardware description. However, the hardware designs produced by HLS tools still suffer from a significant performance gap compared to manual implementations. This is because the input HLS programs must still be written using hardware design principles. Existing techniques either leave the program source unchanged or perform a fixed sequence of source transformation passes, potentially missing opportunities to find the optimal design. We propose a super-optimization approach for HLS that automatically rewrites an arbitrary software program into efficient HLS code …

  3. Close Uses this paper in depth
    SEER: Super-Optimization Explorer for HLS using E-graph Rewriting with MLIR
    Jian-Yi Cheng, Samuel Coward, Lorenzo Chelini et al. · 2023 · arXiv.org · preprint, not peer reviewed · cited 7 times · Not summarized yet
    Abstract

    High-level synthesis (HLS) is a process that automatically translates a software program in a high-level language into a low-level hardware description. However, the hardware designs produced by HLS tools still suffer from a significant performance gap compared to manual implementations. This is because the input HLS programs must still be written using hardware design principles. Existing techniques either leave the program source unchanged or perform a fixed sequence of source transformation passes, potentially missing opportunities to find the optimal design. We propose a super-optimization approach for HLS that automatically rewrites an arbitrary software program into efficient HLS code …

  4. Close
    E-morphic: Scalable Equality Saturation for Structural Exploration in Logic Synthesis
    Chen Chen, Guangyu Hu, Cun-Xi Yu et al. · 2025 · Design Automation Conference · cited 17 times · Not summarized yet
    Abstract

    In technology mapping, the quality of the final implementation heavily relies on the circuit structure after technologyindependent optimization. Recent studies have introduced equality saturation as a novel optimization approach. However, its efficiency remains a hurdle against its wide adoption in logic synthesis. This paper proposes a highly scalable and efficient framework named E-morphic. It is the first work that employs equality saturation for resynthesis after conventional technology-independent logic optimizations, enabling structure exploration before technology mapping. Powered by several key enhancements to the equality saturation framework, such as direct e-graph-circuit conversi…

  5. Close Uses this paper in depth
    SmoothE: Differentiable E-Graph Extraction
    Yao-Hui Cai, Kaixin Yang, Chen-Hui Deng et al. · 2025 · International Conference on Architectural Support for Programming Languages and Operating Systems · cited 16 times · Not summarized yet
    Abstract

    E-graphs have gained increasing popularity in compiler optimization, program synthesis, and theorem proving tasks. They enable compact representation of many equivalent expressions and facilitate transformations via rewrite rules without phase ordering limitations. A major benefit of using e-graphs is the ability to explore a large space of equivalent expressions, allowing the extraction of an expression that best meets certain optimization objectives (or cost models). However, current e-graph extraction methods often face unfavorable scalability-quality trade-offs and only support simple linear cost functions, limiting their applicability to more realistic optimization problems. In this wor…

How are these papers found?

We compare the title and abstract of this paper with those of every paper summarized on this site, and with the papers Semantic Scholar recommends, those it cites and those citing it (for a much-cited paper, its most recent citations and, from OpenAlex, the most cited ones). Among the prior work and the follow-ups, the papers that use each other in depth, a method it uses and the much-cited follow-ups come a little higher. The levels (very close, close, related) come from the similarity of the texts, not from a judgment of quality; * marks a paper without an abstract, compared by its title. The sentence under a paper is written by an AI from the two abstracts: check it in the papers. A paper marked not relevant by three readers leaves the list.

Updated on 5 November 2026.

The illustrated guide to the papers around a paper