TL;DR
Estimating circuit quality metrics like area and delay directly from Register Transfer Level (RTL) code is essential for fast hardware design loops, but current Large Language Model (LLM) approaches miss critical structural information. StructRTL bridges this gap by learning structure-aware representations from Control Data Flow Graphs (CDFGs) and using knowledge distillation from gate-level netlists. The framework achieves state-of-the-art quality estimation accuracy while delivering a massive 145× speedup over traditional logic synthesis toolchains.
What Problem Does This Paper Address?
In modern Electronic Design Automation (EDA), hardware designers write code in Hardware Description Languages (HDLs) like Verilog. To know if a design meets strict area and delay constraints, engineers must run it through a logic synthesis toolchain to generate a gate-level netlist. This feedback loop is notoriously slow and computationally expensive.
To speed things up, researchers have turned to machine learning to estimate design quality directly from RTL code. Recent state-of-the-art methods use LLMs to process Verilog code as text tokens. However, treating hardware code like natural language ignores explicit structural semantics—such as data dependencies and control flow—that dictate physical circuit performance. Traditional graph-based approaches try to capture this structure but rely on shallow, hand-crafted features that fail to model complex circuit patterns.
Methods
StructRTL introduces a structure-aware graph self-supervised learning framework that operates on Control Data Flow Graphs (CDFGs) rather than raw text tokens.
The framework consists of three main pillars:
- Hybrid Model Architecture: StructRTL first passes the CDFG through a Graph Isomorphism Network (GIN) to capture local neighborhood context. It then injects global positional embeddings (derived from Laplacian eigenvectors) and feeds the flattened sequence into a Transformer encoder to model long-range dependencies.
- Tailored Self-Supervised Pretraining: To learn robust representations without human labels, the authors design two tasks:
- Structure-Aware Masked Node Modeling: Instead of masking raw input features (which introduces functional ambiguity), the model masks 20% of the post-GNN context-aware embeddings and tasks the Transformer with predicting the original node types. Stratified masking and class-balanced focal loss are used to combat severe class imbalances (e.g., millions of wires vs. rare arithmetic operators).
- Edge Prediction: The model learns to reconstruct the graph's connectivity by predicting whether an edge exists between pairs of nodes.
- Cross-Stage Knowledge Distillation (KD): Directly predicting gate-level metrics from high-level RTL is challenging. StructRTL tackles this by first training a "teacher" model on post-mapping (PM) netlists, where area and delay are precisely known. It then distills this low-level structural knowledge into the CDFG-based "student" predictor by aligning their final-layer activations.
Datasets
The authors compiled a large-scale dataset of 13,200 designs by aggregating and filtering open-source Verilog datasets, including VeriGen, RTLCoder, MGVerilog, and DeepCircuitX. All designs were simulated using Verilator to ensure functional correctness and synthesized using Yosys and ABC to obtain ground-truth area and delay metrics.
For out-of-distribution testing, they evaluated the model on 51 industrial design pairs (102 modules total), where each module contains over 10,000 CDFG nodes and thousands of lines of complex RTL code.
Key Insights and Ideas
- Tokens vs. Graphs for Hardware: LLMs excel at capturing syntax and high-level semantics for code generation, but they struggle with physical hardware metrics like delay. Delay is highly sensitive to structural properties (like critical path depth and reconvergent dataflow) that are explicitly exposed in a CDFG but only implicitly buried in token sequences.
- Masking Embeddings, Not Raw Features: In computational graphs like CDFGs, masking a raw operator (e.g., changing a
+to a*) creates valid but entirely different circuit logic, confusing the model. Masking the post-GNN embeddings preserves the structural integrity of the graph while forcing the model to infer missing components from surrounding context. - Cross-Stage Supervision Matters: Gate-level netlists contain fine-grained physical insights that are absent at the RTL stage. Forcing the RTL graph model to align its internal representations with a netlist-trained teacher significantly boosts downstream estimation accuracy.
Key Results
StructRTL establishes a new state-of-the-art across all evaluated metrics:
- Superior Accuracy: Without knowledge distillation, StructRTL outperforms the best LLM baseline (CodeV-QW-7B) by roughly 0.1 in $R^2$ score for both area and delay estimation.
- Boosted by Distillation: When cross-stage knowledge distillation is activated, StructRTL achieves an exceptional $R^2$ score of 0.8676 for area and 0.8872 for delay, significantly outperforming graph and LLM baselines.
- Data Efficiency: With only 20% of the training data, StructRTL achieves performance competitive with LLM baselines trained on the full dataset.
- Industrial Viability: On large-scale industrial designs, StructRTL achieves 82.35% accuracy for area ranking and 88.23% accuracy for delay ranking. Crucially, it takes only 0.096 seconds per design on average compared to 13.97 seconds for actual logic synthesis—representing a 145× speedup.
Limitations and Future Work
Despite its strong performance, the authors note a few limitations:
- Sequential Circuit Complexity: StructRTL performs slightly worse on sequential circuits than combinational ones due to complex inter-cycle data dependencies and stateful behaviors. Future work will explore sequential-specific pretraining objectives.
- Technology Node Migration: Post-synthesis area and delay distributions shift drastically when changing technology nodes (e.g., migrating from 130nm to 7nm). Developing a universal predictor that generalizes seamlessly across nodes remains an open challenge.
- Scalability to Massive Graphs: Memory and latency scale with graph size. While the authors proposed a preliminary "register-boundary partitioning strategy" to break large designs into subcircuits, more work is needed to scale the framework to designs exceeding 100,000 nodes.
Summary updated