PrefixRL: Optimization of Parallel Prefix Circuits using Deep Reinforcement Learning

Rajarshi Roy, Jonathan Raiman, Neel Kant, Ilyas Elkin, Robert Kirby, Michael Y. Siu, Stuart F. Oberman, Saad Godil, Bryan Catanzaro · DOI

Introduction

Parallel prefix circuits, such as adders and priority encoders, are fundamental building blocks in high-performance digital design. Optimizing these circuits for area, delay, and power is a critical task in modern VLSI design. However, the design space for an $N$-bit prefix circuit is immense, scaling at $O(2^{N^2})$, which precludes exhaustive search for practical bit-widths.

Traditionally, designers have relied on regular, human-engineered structures like Sklansky, Kogge-Stone, or Brent-Kung adders. While automated tools exist, they often rely on simplified analytical models to estimate performance. These models frequently fail to account for physical design realities like wire congestion and capacitive loading, leading to sub-optimal hardware. PrefixRL addresses these challenges by employing deep reinforcement learning (RL) to explore the unrestricted design space, guided by ground-truth feedback from actual physical synthesis.

Methodology

PrefixRL frames circuit optimization as a Markov Decision Process (MDP) solved via a Scalarized Double Deep Q-Network (DQN). The state is represented as a prefix graph on an $N \times N$ grid, where the agent can take actions to add or delete logic nodes. A legalization procedure ensures that every action results in a valid circuit.

The PrefixRL framework: An RL agent interacts with a circuit environment, using physical synthesis feedback to optimize prefix graphs.

The core innovation is the "synthesis-in-the-loop" reward mechanism. Instead of relying on inaccurate analytical models, the environment uses OpenPhySyn to physically synthesize the circuit at each step, measuring real area and delay. To handle the high computational cost of synthesis (up to 36 seconds per step), the authors implemented a massively parallelized asynchronous distributed system with 192 CPU workers and aggressive caching. The Q-network itself utilizes a fully convolutional Residual Network (ResNet) architecture to process the grid representation and predict action values.

Experimental Setup

The agent was trained using the Nangate45 open-source 45nm cell library. Evaluation was performed against several standard baselines, including regular human-designed adders (Sklansky, Kogge-Stone, Brent-Kung) and automated methods like Simulated Annealing (SA) and Pruned Search (PS). To test generalization, the designs were also synthesized using a commercial 8nm industrial cell library and proprietary EDA tools.

Results and Discussion

PrefixRL successfully discovered novel circuit architectures that outperform traditional designs. For 32-bit adders, the agent generated a Pareto frontier that dominated all prior baselines, achieving up to 16.0% lower area for the same delay targets. These gains scaled even further for 64-bit adders, reaching up to 30.2% area reduction.

Pareto frontiers for 32-bit and 64-bit adder synthesis, showing PrefixRL outperforming traditional architectures and heuristic search methods.

A key insight from the study is that training with physical synthesis is essential; agents trained on analytical models produced designs that performed poorly in real hardware. Furthermore, the agent demonstrated remarkable generalization: designs optimized on the 45nm open-source library maintained their superiority when synthesized in a modern 8nm commercial process, suggesting the RL agent learned fundamental topological efficiencies rather than node-specific quirks.

Conclusion

PrefixRL demonstrates that deep reinforcement learning can design complex datapath circuits from scratch, surpassing both human heuristics and commercial EDA tool defaults. While the approach is computationally intensive and currently excludes power optimization, it represents a significant step toward fully automated, high-performance hardware design. Future work will focus on integrating power metrics and adapting to non-uniform timing constraints.

Summary updated

BibTeX
@inproceedings{roy2021prefixrl,
  author = {Rajarshi Roy and Jonathan Raiman and Neel Kant and Ilyas Elkin and Robert Kirby and Michael Y. Siu and Stuart F. Oberman and Saad Godil and Bryan Catanzaro},
  title = {{PrefixRL: Optimization of Parallel Prefix Circuits using Deep Reinforcement Learning}},
  booktitle = {DAC},
  year = {2021},
  doi = {10.1109/dac18074.2021.9586094},
}
Figure