Introduction
Automating hardware design, specifically for FPGAs and ASICs, remains a significant hurdle in the semiconductor industry. While Large Language Models (LLMs) have revolutionized software engineering, their application to traditional Hardware Description Languages (HDLs) like Verilog has been limited. This paper presents a novel framework that shifts the paradigm from low-level HDL generation to High-Level Synthesis (HLS) based on C/C++, leveraging the pre-existing software knowledge of LLMs to streamline hardware design.
The Challenge: Why Verilog Struggles
The difficulty in using LLMs for traditional hardware design stems from three primary factors: data scarcity, semantic mismatch, and verbosity.
Data Scarcity: Training effective code models requires massive datasets. As shown in Figure 1, the volume of available HDL code in major datasets like StarCoder is negligible compared to software languages like Java or C. This lack of data prevents models from learning the intricate syntax and timing requirements of Verilog.
Semantic Mismatch and Verbosity: Hardware logic is inherently parallel and timing-sensitive, contrasting with the sequential nature of software. Furthermore, Verilog is extremely "wordy," requiring many more tokens to describe a design than a high-level language. This verbosity increases inference costs and slows down the design cycle.
The HLS Solution
The authors propose using HLS as a "sweet spot." By describing hardware logic in C or C++, designers can utilize the vast software-centric training data already ingested by LLMs. HLS allows the model to "recycle" its programming knowledge, focusing on hardware-specific pragmas rather than learning an entirely new, data-poor language.
Methodology: A Robust Generation Pipeline
The researchers developed an end-to-end pipeline to ensure the reliability of generated HLS code:
- Supervised Fine-Tuning (SFT): Models like Code-Llama-7B and StarCoder were fine-tuned using QLoRA on a specialized dataset of 42,000 HLS programs.
- Structured Chain-of-Thought (CoT): A guided prompting strategy forces the LLM to reason through FPGA characteristics and program structure before generating code.
- Iterative Feedback Loops: The system employs a two-step verification process. First, a syntax check via GCC identifies compilation errors for self-repair. Second, a functionality check against unit tests identifies logic defects, which are then fed back to the model for refinement.
Key Results and Efficiency Gains
The framework demonstrates significant improvements in both accuracy and efficiency. Fine-tuning alone boosted syntax correctness from roughly 55% to over 88%. When combined with CoT and feedback loops, syntax accuracy reached 94.33%, with a functional pass rate of 61.45% (pass@3).
As illustrated in Figure 6, the HLS-based approach is not only more concise but also more efficient. The normalized token usage for HLS is less than half that of Verilog, leading to a 3–4x reduction in computational costs for hardware generation. Furthermore, the generated designs were successfully synthesized on a Xilinx VCU118 FPGA, proving their real-world viability.
Conclusion and Future Work
By bridging the gap between software-trained LLMs and hardware requirements through HLS, this research provides a scalable path toward automated chip design. While challenges remain—particularly regarding the sensitivity of models to human-style prompts and the need for Power, Performance, and Area (PPA) optimization—the HLS-centric approach offers a clear advantage in design speed and cost-efficiency. Future efforts will focus on integrating PPA metrics into the feedback loop to optimize the quality of the synthesized hardware.
Summary updated