Abstract
LLM-based RTL generation holds the potential to automate the least automated stage in chip design. However, semantic gaps between high-level specifications and RTL, along with data scarcity, hinder accuracy. Existing models struggle to align high-level functional semantics with low-level hardware details. We propose Faver (Function Abstracted Verifiable Middleware), a framework that streamlines RTL verification by mixing LLM-friendly code structures with rule-based templates. Faver decouples circuit verification details, allowing LLMs to focus on functionality. Experiments show Faver improves generation accuracy by up to 14% on open-source and fine-tuned models.
Introduction
Automating Register Transfer Level (RTL) design—the process of writing the code that defines digital circuit behavior—is a critical challenge in chip design. While Large Language Models (LLMs) have revolutionized software coding, they face significant hurdles in hardware generation due to the "spatiotemporal" nature of hardware (clocks, resets, parallel execution) compared to the event-driven nature of software. Furthermore, high-quality Verilog data is scarce, and writing testbenches for verification is often more complex than the design itself. Existing approaches using LLMs as judges or direct testbench generators often fail to catch subtle timing or bit-width errors.
Methods
Faver introduces a "design-with-verification" loop that leverages the LLM's proficiency in high-level languages like Python to bridge the semantic gap. The workflow consists of four main stages:
- Verification Specification Generation: The LLM translates hardware requirements into a high-level functional specification, ensuring a conceptual understanding of the logic (e.g., identifying a convolution function) before writing code.
- Function Abstraction (The Python Bridge): Faver provides a Python class template that maps hardware concepts (like clock edges and resets) into Python-friendly structures. The LLM generates a Python reference model that acts as the "ground truth."
- Hierarchical Test Stimuli: The LLM plans high-level test cases, while a rule-based engine handles low-level constraints like reset signal duration and bit-width masking to ensure rigorous verification.
- Closed-Loop Iteration: A co-simulation engine (Verilator/Picker) runs the generated Verilog against the Python reference model. Error reports are fed back to the LLM for iterative refinement.
Results
The framework was evaluated using the RTLLM and Verilog-Eval benchmarks across multiple models, including DeepSeek-R1 and Kimi K2. Faver consistently outperformed baselines where LLMs acted as judges (baseline-L) or wrote Verilog testbenches directly (baseline-V).
On the RTLLM benchmark, Faver improved the pass@1 rate by up to 14%. The iterative feedback loop proved highly effective; designs that failed initially were often able to self-correct within five iterations once provided with co-simulation error reports. This demonstrates that the Python middleware effectively abstracts away hardware complexity, allowing the LLM to focus on logical correctness.
Conclusion
Faver demonstrates that leveraging software expertise (Python) through a verifiable middleware layer can significantly enhance hardware code generation. By decoupling logic from timing and using rule-based engines for precise constraints, it addresses the core semantic gap in RTL design. While currently limited by toolchain dependencies and iteration caps, future work will explore extending Faver to complex System-on-Chip (SoC) designs.
Summary updated