Introduction
Modern hardware design complexity requires advanced methodologies for optimization and analysis. Machine learning (ML), particularly Graph Neural Networks (GNNs), has emerged as a powerful tool for predicting design Quality-of-Results (QoR) early in the cycle. However, the hardware community faces two significant hurdles: an infrastructure gap between hardware description languages (HDLs) and graph ML libraries, and a severe scarcity of diverse, labeled datasets.
Verilog-to-PyG (V2PYG) addresses these challenges by providing an open-source framework that bridges Verilog RTL and the PyTorch Geometric (PyG) platform. It offers a robust pipeline for converting designs into graph formats and introduces novel data augmentation techniques to generate the massive datasets necessary for training effective GNNs.
The V2PYG Pipeline
The V2PYG framework integrates established Electronic Design Automation (EDA) tools—Yosys for front-end parsing, ABC for logic manipulation, and OpenROAD for physical design—into a cohesive ML-ready pipeline.
The framework extracts two primary graph representations:
- And-Inverter Graphs (AIGs): Technology-independent representations using only two-input AND gates and inverters, ideal for learning fundamental logic structures.
- Mapped Netlists: Technology-dependent graphs reflecting actual hardware gates from specific standard cell libraries (e.g., 7nm), capturing physical implementation details.
Logic-Preserving Data Augmentation
A core contribution of V2PYG is its approach to data scarcity. Unlike image data, circuit logic cannot be randomly altered without breaking functionality. V2PYG leverages logic synthesis transformations—originally designed for optimization—as a means of "functionally equivalent" data augmentation.
By randomly applying operations like Rewriting, Refactoring, and Resubstitution at the node level, the framework generates thousands of structurally distinct yet functionally identical versions of a circuit. This allows for the creation of diverse datasets from a single source design. Additionally, Sequential Augmentation via retiming moves registers across logic boundaries to vary timing characteristics without changing functional behavior.
Automated Labeling and Multi-Fidelity
V2PYG automates the collection of "ground truth" labels by piping augmented designs through the OpenROAD flow. This enables the extraction of performance metrics (area, power, delay) at various stages—from high-level synthesis to final placement and routing. This multi-fidelity approach allows models to learn features at different levels of abstraction, from abstract logic flows to detailed physical implementations.
Key Insights and Results
The framework's utility was demonstrated on standard benchmarks (ITC'99, ISCAS'85), where it successfully generated thousands of unique, functionally verified samples. For instance, augmenting the i10.aig benchmark produced variations ranging from 1,900 to 2,600 AND gates, following a Gaussian-like distribution of features—ideal for robust ML training.
Crucially, 100% functionality preservation was confirmed via Combinatorial Equivalence Checking (CEC). By implementing these features as a command (aigaug) within the widely used ABC tool, the authors have made high-quality hardware graph data generation accessible to the broader research community.
Conclusion and Future Work
V2PYG provides the necessary infrastructure to scale graph-based ML for hardware design. Future developments include handling more complex sequential state machines and integrating with MLIR CIRCT for higher-level hardware representations. The framework is open-source and available at https://yu-maryland.github.io/Verilog-to-PyG/.
Summary updated