AutoC2V: Synthesis-Guided LLM Training for QoR-Optimized C++-to-Verilog Generation

Guanqi Lyu, Fei Zhao, Zhaojun Lu, Jiaji He, Yongqiang LyuarXiv 2026 · arXiv

TL;DR

AutoC2V is a framework that trains Large Language Models (LLMs) to directly generate optimized Verilog RTL from C++ code. By using reinforcement learning guided by a fast hardware-performance "reward model," it produces hardware designs that are significantly more functional and efficient than those from general-purpose models or traditional automated tuning tools.

What Problem Does This Paper Address?

In the world of hardware design, High-Level Synthesis (HLS) is a major productivity booster. It allows engineers to write algorithmic descriptions in C/C++ and automatically translate them into Register-Transfer Level (RTL) code (Verilog). However, getting high-quality hardware out of HLS usually requires a human expert to manually tune "pragmas"—directives that tell the compiler how to unroll loops or pipeline operations.

This process is a slow, iterative "guess-and-check" loop. While LLMs have shown promise in generating code, they often struggle with the strict functional requirements of hardware and have no inherent "intuition" for what makes a design fast or small. Existing LLM-based tools mostly try to guess the best pragmas for a traditional HLS compiler rather than learning to generate the optimized hardware architecture themselves.

Methods

The authors propose AutoC2V, a two-stage training pipeline designed to turn an LLM into a synthesis-aware hardware generator.

  1. Supervised Fine-Tuning (SFT): The model is first trained on a dataset of C++ kernels paired with their corresponding Verilog implementations and optimization objectives (e.g., "make this fast" or "make this small").
  2. Reinforcement Learning with GRPO: To move beyond simple imitation, the authors use Group Relative Policy Optimization (GRPO). The model generates multiple RTL candidates for a given C++ kernel and is rewarded based on two factors:
  3. Functionality Gate: If the generated RTL fails a simulation check (i.e., it doesn't do what the C++ code says), it gets zero reward.
  4. QoR Prediction Reward Model (QoR RM): Real hardware synthesis takes minutes or hours—too slow for reinforcement learning. The authors built a "proxy" reward model that uses Dewey long-context embeddings to "read" the generated Verilog and XGBoost to instantly predict its Quality of Results (QoR), such as latency and resource usage (DSPs, LUTs, etc.).
Fig. 1. Overview of the AutoC2V workflow.

Datasets

The authors constructed a specialized dataset to bridge the gap between high-level code and hardware performance:

  • Source Data: They started with the HLStrans dataset and used GPT-5.5 to decompose complex kernels into 201 independently synthesizable regions.
  • Synthesis-Annotated Training Set: By exploring the "pragma space" and running real synthesis tools (Vitis HLS and Vivado), they generated 34,078 design samples. Each sample includes C++ source, Verilog RTL, and real-world QoR metrics.
  • Evaluation: They used 59 held-out kernels from the HLS-Eval benchmark to test the model's ability to generalize to unseen problems.
Fig. 3. Pipeline for data preprocessing and training-set construction.

Key Insights and Ideas

  • Direct Generation is Better than Tuning: Instead of just suggesting pragmas for an HLS tool to use, AutoC2V learns to generate the final RTL directly. This allows the model to learn coordinated architectural choices that traditional compilers might miss.
  • The "Correctness First" Constraint: The functionality gate is crucial. Without it, reinforcement learning tends to find "hacks" that look efficient on paper but don't actually work. By zeroing out rewards for broken code, the model learns that correctness is a prerequisite for optimization.
  • RTL as Semantic Text: One of the most surprising findings is how well a language-based reward model (QoR RM) can predict hardware performance. By treating Verilog as a long-context document, the model captures structural features that correlate strongly with final hardware area and speed.

Key Results

AutoC2V significantly outperformed both general-purpose LLMs and specialized HLS optimization tools:

  • Functional Correctness: It achieved a 66.9% functional pass rate (Func@1), a massive leap over the SFT-only baseline (22%) and more than double the performance of Claude Opus 4.8 (30.5%).
  • Synthesis Success: It reached an 80.5% synthesis pass rate, meaning the code it generates is almost always valid, synthesizable Verilog.
  • Superior Optimization: In head-to-head comparisons on common kernels, AutoC2V consistently achieved better latency and resource scores than representative HLS optimization approaches like AutoDSE, HLSPilot, and LLM-DSE.

Limitations and Future Work

While AutoC2V is a major step forward, the authors note several areas for improvement:

  • Complexity Scaling: The current evaluation focuses on relatively small kernels. Scaling to massive, multi-kernel System-on-Chip (SoC) designs remains a challenge.
  • Control Logic: The model is currently best at data-heavy kernels; more complex control-flow logic may require further refinement.
  • Hardware Portability: The training was specific to a Xilinx Alveo U280 FPGA. Future work will explore "cross-FPGA" generation to see if the model can adapt its architectural choices for different hardware targets.

Summary updated

Abstract

High-level synthesis (HLS) can translate C/C++ kernels into register-transfer level (RTL) designs, yet generating high-quality hardware still relies heavily on manual pragma tuning and repeated synthesis evaluation. We propose AutoC2V, a C++-to-Verilog generation framework driven by real synthesis feedback that enables large language models (LLMs) to directly generate RTL with improved quality of results (QoR) from synthesizable C++ kernels. We construct training data from real synthesis results, including synthesizable C++ source code, the corresponding Verilog RTL, QoR metrics, and optimization objectives. Using this dataset, we align the model toward synthesis-aware RTL generation through Supervised Fine-Tuning (SFT) and Group Relative Policy Optimization (GRPO). To reduce the high cost of repeatedly invoking real synthesis during GRPO, we design the QoR Prediction Reward Model (QoR RM), which predicts latency and resource metrics by encoding RTL into long-context semantic representations, thereby providing low-cost and continuous QoR reward signals for policy optimization. Experimental results demonstrate that AutoC2V not only substantially improves RTL functional pass rates, but also achieves superior latency and resource optimization compared to the unfine-tuned base model, representative HLS optimization approaches (HLSPilot, LLM-DSE, and AutoDSE), and advanced general-purpose commercial models (Claude Opus 4.8, GPT-5.5, Gemini 3.1 Pro, DeepSeek v4 Pro, and GLM-5.2). These results indicate that combining real synthesis data with efficient QoR reward modeling can further improve the ability of LLMs to generate high-quality RTL.
BibTeX
@misc{lyu2026autoc,
  author = {Guanqi Lyu and Fei Zhao and Zhaojun Lu and Jiaji He and Yongqiang Lyu},
  title = {{AutoC2V: Synthesis-Guided LLM Training for QoR-Optimized C++-to-Verilog Generation}},
  year = {2026},
  eprint = {2611.10824},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.10824},
}
Figure