Introduction
Multipliers are fundamental components of modern computing architectures, serving as the primary workhorses for datapath-heavy applications such as artificial intelligence, digital signal processing, and cryptography. Despite their importance, the methodology for designing these circuits has remained relatively static. Traditional multiplier design typically follows a three-stage pipeline: generating an initial array of partial product bits, reducing that array using compressor trees (such as Wallace or Dadda trees), and performing a final addition to produce the result.
While this structured approach is reliable, it often treats these stages as isolated "black boxes." This compartmentalization creates a design gap; the search space for logic optimization is so vast that human designers and standard commercial synthesis tools often miss non-standard logic structures that could offer superior performance. This paper introduces OptiMult, a tool designed to bridge this gap by using e-graph rewriting to automatically discover high-performance, unconventional multiplier architectures.
Methodology: E-Graphs and Equality Saturation
At the core of OptiMult is the use of e-graphs (equivalence graphs) and a technique known as equality saturation. Unlike traditional optimization methods that iteratively transform a single circuit representation into another, an e-graph stores thousands of mathematically equivalent versions of a circuit simultaneously. By applying a set of rewrite rules (e.g., the commutative property $a + b = b + a$), the tool expands the graph until it reaches a state of saturation or hits a resource limit. It then uses a cost model to extract the most efficient design from the resulting space.
Phased Optimization and Dual Representation
To overcome the "scalability wall" inherent in exploring such a massive search space, OptiMult employs a two-phase optimization strategy:
- Phase 1 (High-Level): The tool focuses on the placement of compressor cells, such as Full Adders and Half Adders, to reduce the initial bit array efficiently.
- Phase 2 (Gate-Level): The compressor cells are decomposed into raw Boolean logic (AND, OR, XOR gates). This allows the tool to perform fine-grained optimizations that squeeze out additional picoseconds of latency.
Furthermore, OptiMult utilizes a dual representation of the multiplier, viewing it as both a "sum of rows" and a "row of sums." This flexibility allows the engine to apply optimizations that might be mathematically obvious in one view but obscured in the other. For larger circuits, a recursive divide-and-conquer approach is used to break down wide multipliers into smaller, previously optimized blocks.
Experimental Results
The researchers evaluated OptiMult against industry-standard commercial synthesis tools using a state-of-the-art TSMC 5nm cell library. The benchmarks included unsigned multipliers and squarers ranging from 3-bit to 8-bit widths. All designs were formally verified for correctness using commercial equivalence checking tools.
Discovery of "Alien" Logic
One of the most significant outcomes of the OptiMult search was the discovery of non-standard logic structures that the authors termed Triangle Adders (TA) and P-adders (PA). These are complex, multi-input compressors that exploit specific bit correlations more efficiently than standard textbook components. By blurring the traditional boundaries between array reduction and carry-propagation, OptiMult identified shortcuts that human designers typically overlook.
Quantitative Gains
OptiMult demonstrated substantial improvements over commercial baselines, particularly in specialized circuits:
- Latency Reduction: The tool achieved a 46.2% reduction in latency for a 5-bit squarer and a 21.2% reduction for an 8-bit squarer. Even for general-purpose 3-bit multipliers, it found an 8.5% speed improvement.
- Area Efficiency: Optimization did not always come at the cost of size. For a 6-bit squarer, OptiMult produced a design that was both faster and 34% smaller in area than the commercial baseline.
- Search Efficiency: The phased approach proved vital; for a 3-bit squarer, the two-phase method reached convergence in 31 iterations, compared to 42 iterations for a single-phase search.
Discussion and Limitations
While OptiMult shows great promise, the research also highlighted several challenges. The tool encountered scalability limits with general (non-square) 5-bit multipliers, where the complexity of Boolean expressions became too high for the e-graph to reduce effectively. Additionally, the current iteration optimizes each output bit independently, which may miss opportunities for logic sharing across different bits. The cost model also assumes a simplified fan-out of one for all gates, which does not fully account for the electrical constraints of real-world hardware.
Conclusion
OptiMult demonstrates that e-graph rewriting can uncover highly optimized hardware structures that surpass the performance of industry-standard tools. By specializing in squarer circuits and discovering novel compressor structures like Triangle Adders, the tool proves that there is still significant performance to be harvested from fundamental arithmetic units. Future work will focus on incorporating Booth encoding and more complex (7:3) counters to further expand the tool's reach and scalability.
Summary updated