Beyond Tokens: Enhancing RTL Quality Estimation via Structural Graph Learning

Yi Liu, Hongji Zhang, Yiwen Wang, Dimitris Tsaras, Lei Chen, Mingxuan Yuan, Qiang Xu

The Bottleneck in Hardware Design

In the Electronic Design Automation (EDA) workflow, hardware engineers write code in languages like Verilog (Register Transfer Level, or RTL). To evaluate a design's physical quality—specifically its area and delay—engineers typically rely on logic synthesis. Unfortunately, synthesis is a computational bottleneck that can take minutes or hours for a single iteration, creating a painfully slow feedback loop.

Recent attempts to bypass this bottleneck have utilized Large Language Models (LLMs) to estimate metrics directly from the code. However, LLMs treat hardware code like natural language text. While they excel at syntax, they often miss the underlying structural semantics—the complex web of data and control flows that ultimately dictate a circuit's physical properties.

Enter StructRTL: A Graph-Based Approach

To address these limitations, researchers have introduced StructRTL, a novel framework that treats hardware design as a structural learning problem rather than a text translation task. By shifting from text-based "tokens" to structural "graphs," StructRTL achieves state-of-the-art accuracy and a massive speedup over traditional tools.

1. CDFG Construction

Instead of reading raw text, StructRTL converts Verilog into a Control Data Flow Graph (CDFG). In this graph, nodes represent operations (e.g., addition, multiplexing) or storage (registers), and edges represent data movement. This graph view remains consistent regardless of coding style, providing a much clearer signal for quality estimation.

2. Hybrid Architecture

The model employs a two-stage architecture to process the CDFG:

  • Graph Isomorphism Network (GIN): A Graph Neural Network (GNN) captures local neighborhood information for every node.
  • Transformer Encoder: To handle long-range dependencies across the design, GNN outputs are fed into a Transformer. Global Positional Embeddings, derived from the graph's Laplacian eigenvectors, are injected to keep the Transformer aware of the graph's overall shape.

3. Self-Supervised Pretraining

To understand hardware without relying on millions of labeled examples, StructRTL uses self-supervised pretraining with two key tasks:

  • Structure-Aware Masked Node Modeling: The model hides certain nodes and guesses their type based on surrounding structure. Crucially, StructRTL masks the post-GNN embeddings rather than raw data, preserving the computational integrity of the graph during training.
  • Edge Prediction: The model learns to reconstruct the graph's connectivity.

4. Knowledge Distillation (KD)

To ground the model in physical reality, the researchers trained a "Teacher" model on post-synthesis netlists, which contain perfect physical information. This knowledge is distilled into the "Student" RTL model, transferring low-level physical insights (like mapping to a 130nm technology node) into the high-level RTL predictor.

Key Innovations

  • Handling Class Imbalance: In hardware graphs, basic "Wire" nodes are ubiquitous, while complex nodes like "Dividers" are rare but heavily impact delay. StructRTL uses stratified masking and a class-balanced focal loss to ensure the model learns to identify these critical bottleneck components.
  • Physical Grounding: By distilling knowledge from the gate-level netlist stage, the model learns to foresee how high-level code will map to specific physical cells.

Datasets and Evaluation

The framework was trained on a massive dataset of 13,200 RTL designs sourced from open-source repositories, textbooks, and LLM-generated designs. It was also tested on an industrial benchmark of 102 real-world modules, each containing over 10,000 nodes, to evaluate its handling of complex, out-of-distribution designs.

Results and Impact

StructRTL establishes new state-of-the-art results for RTL quality estimation:

  • Massive Speedup: The model provides feedback in just 0.096 seconds per design, compared to nearly 14 seconds for traditional synthesis—a 145x speedup.
  • State-of-the-Art Accuracy: StructRTL achieved an $R^2$ score of 0.887 for delay prediction, significantly outperforming LLM-based baselines like CodeV (which scored around 0.76).
  • Industrial Generalization: On complex industrial designs, the model achieved 88.23% accuracy in ranking which of two functionally equivalent designs would have a shorter delay.
  • Data Efficiency: StructRTL outperformed LLMs trained on the full dataset using only 20% of the training data.

Limitations and Future Work

While StructRTL marks a significant leap forward, it has a few limitations. The model performs slightly better on combinational circuits than sequential ones, as sequential designs feature inter-cycle dependencies that are harder for standard GNNs to resolve. Additionally, the current model is calibrated for the SkyWater 130nm library; moving to a different node (like 7nm) requires recalibration. Finally, while it handles 10k+ node designs well, scaling to "mega" designs with hundreds of thousands of nodes will require advanced partitioning strategies, which the authors are currently exploring.

Summary updated

BibTeX
@inproceedings{liu2026beyond,
  author = {Yi Liu and Hongji Zhang and Yiwen Wang and Dimitris Tsaras and Lei Chen and Mingxuan Yuan and Qiang Xu},
  title = {{Beyond Tokens: Enhancing RTL Quality Estimation via Structural Graph Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=n86vBxkWIt},
}
Figure