TL;DR
VeriDistill is a novel machine learning framework that predicts post-synthesis circuit quality (area and delay) directly from raw Verilog code, bypassing the need for slow, computationally expensive logic synthesis tools. By combining the semantic power of Large Language Models (LLMs) with structural insights distilled from a low-level Graph Neural Network (GNN), it delivers instant, highly accurate feedback to chip designers.
What Problem Does This Paper Address?
Designing modern electronic chips is a slow, multi-stage process. It starts with an architect writing code in a Hardware Description Language (HDL) like Verilog. To find out if this code will result in an efficient chip, the design must undergo logic synthesis—a computationally heavy process that transforms high-level code into an optimized netlist of gates.
Because logic synthesis takes so long, designers cannot easily iterate and tweak their code to see how it impacts physical metrics like circuit area or path delay. While previous machine learning approaches have tried to predict these Quality-of-Result (QoR) metrics early, they usually rely on hand-crafted graph statistics or require intermediate synthesis tools (like Yosys) to generate bit-level representations. This defeats the purpose of getting instant feedback directly from the raw source code.
Methods
The authors introduce VeriDistill, an end-to-end framework that takes raw Verilog code and outputs area and delay predictions instantly.
The architecture relies on a clever two-part training strategy:
- The LLM Encoder: Raw Verilog code is fed into a frozen code-based LLM (such as CodeV or DeepSeek-Coder). The hidden states of the tokens are averaged into a single vector and passed to a small Feedforward Neural Network (FNN) to predict the QoR metrics.
- Low-Level Knowledge Distillation (KD): High-level code lacks explicit structural information about the final circuit. To fix this, the authors pretrain an auxiliary "teacher" GNN on Look-Up Table (LUT) graphs—an intermediate, highly structural circuit representation generated during synthesis. During training, they regularize the LLM's predictor network by forcing its final-layer embeddings to match the embeddings of the teacher GNN using a mean-squared error loss ($\mathcal{L}_{KD}$).
Crucially, the GNN and LUT graphs are only used during training. During inference, the model requires nothing but the raw Verilog code.
Datasets
The model was trained and evaluated on two primary datasets:
- Customized Dataset: A dataset of 16k functionally correct Verilog examples compiled from recent literature. The authors used the open-source EDA platform OpenROAD (with a 7nm technology library) to generate the true ground-truth labels for area and delay, as well as the intermediate LUT graphs.
- OpenABCD: An established, highly diverse benchmark used strictly for out-of-distribution (OOD) testing. It contains large, complex circuit designs like bus communication protocols, processors, and cryptographic accelerators, which are significantly larger than the training instances.
Key Insights and Ideas
- Synergy is Mandatory: One of the most striking findings was that using an LLM representation alone with a simple decoder actually performed worse than traditional baselines. Similarly, applying knowledge distillation to simpler abstract syntax tree (AST) models yielded almost no benefit. The magic happens exclusively when the rich semantic space of the LLM is aligned with the structural space of the GNN.
- Bypassing LLM Fine-Tuning: Knowledge distillation acts as a shortcut for domain adaptation. Incorporating the GNN teacher allowed a base model (DeepSeek-Coder) to perform nearly as well as a model explicitly fine-tuned on massive Verilog corpora (CodeV). This means VeriDistill can easily scale to other open-source code LLMs without expensive fine-tuning.
- Visualizing the Alignment: t-SNE projections of the hidden layers show that VeriDistill successfully inherits a highly organized, continuous left-to-right gradient of circuit sizes from the GNN teacher, whereas standard LLM-plus-decoder models look like an unorganized mass.
Key Results
VeriDistill dramatically outperformed state-of-the-art baselines on the test dataset:
- Area Prediction: VeriDistill achieved an $R^2$ score of 0.872 (using CodeV), compared to just 0.255 for an AST-XGBoost baseline and 0.661 for an AST-GNN.
- Delay Prediction: VeriDistill reached an $R^2$ score of 0.781, outperforming the AST-GNN baseline (0.604).
On the challenging out-of-distribution OpenABCD benchmark, the knowledge distillation component proved vital. Because the benchmark contains circuits much larger than those in the training set, standard models failed to generalize. VeriDistill with knowledge distillation systematically lowered the Mean Absolute Error (MAE) across almost all circuit types, proving that low-level structural insights help the model generalize to complex, unseen architectures.
Limitations and Future Work
While VeriDistill marks a major step toward instant RTL feedback, some limitations remain:
- Syntax Dependency: The preprocessing pipeline requires functionally and syntactically correct Verilog code to map to valid labels. In real-world IDE scenarios, code is often incomplete or temporarily broken.
- Context Window Constraints: Extremely massive chip designs with millions of lines of code may still hit the context window limits of standard LLMs, though the authors mitigated this by using models with 128k token windows.
- Future Directions: The authors suggest exploring end-to-end fine-tuning of the LLM parameters alongside the distillation loss, and expanding the framework to support other HDLs like VHDL or Chisel.
Summary updated