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.
- 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").
- 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:
- 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.
- 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.).
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.
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