TL;DR
OpenRTLSet is the largest fully open-source, permissively licensed dataset for LLM-based hardware design, containing over 131,000 diverse Verilog modules. By pairing these modules with high-quality natural language descriptions generated by DeepSeek-R1, the dataset enables state-of-the-art performance in automated hardware generation without commercial or proprietary restrictions.
What Problem Does This Paper Address?
While Large Language Models (LLMs) excel at generating software code (like Python or C++), their performance drops significantly when tasked with writing Hardware Description Languages (HDLs) like Verilog. The root cause is data scarcity: unlike software, high-quality hardware code is typically locked away as proprietary industrial intellectual property (IP).
Existing attempts to bridge this gap suffer from two major flaws. First, they are often too small to effectively train robust models. Second, many existing datasets rely on restrictive licensing or utilize commercial LLM outputs (like ChatGPT) for data labeling, which explicitly violates terms of service if used to train competing commercial models. This creates a massive barrier for both open academic research and commercial hardware automation.
Methods
The authors built an entirely open-source pipeline to collect, translate, clean, and label hardware design data:
- Multi-Language Scraping & Translation: The team scraped GitHub for permissively licensed code across three domains: native Verilog, VHDL, and C/C++. They used open-source tools (
vhd2vl) to translate VHDL to Verilog, and Vitis HLS to convert synthesizable C/C++ code into Verilog modules. - Module Decomposition & Structuring: Multi-module files were broken down into individual, isolated modules to improve learning granularity. The data was structured into a clean JSONL format separating metadata (like I/O pins) from functional code.
- Reasoning-Driven Labeling: To generate natural language descriptions for each module, the authors leveraged DeepSeek-R1 70B, a powerful open-source reasoning model. They also experimented with an innovative twist: using Verilator to compile Verilog into C++ code, providing the labeling LLM with cross-language contextual clues to improve description accuracy.
Datasets
- OPENRTLSET (New): The primary contribution, consisting of 131,000+ modules (102k native Verilog, 5k translated from VHDL, and 24k generated from synthesizable C/C++).
- MG-Verilog: An existing multi-granularity Verilog dataset used as a baseline for comparative benchmarking.
- VerilogEval (Machine & Human): The standard benchmark used to evaluate the functional correctness and syntax compliance of the fine-tuned models.
Key Insights and Ideas
- Data Volume Trumps Strict Filtering: In ablation studies, the authors tested whether filtering out modules that failed Verilator compilation improved model performance. Surprisingly, keeping the full dataset (even with uncompilable modules) yielded better results, proving that sheer dataset volume and diversity matter more than flawless compilation filtering.
- Reasoning Models Generate Superior Training Labels: Re-labeling existing datasets (like MG-Verilog) using DeepSeek-R1's reasoning capabilities significantly boosted downstream model performance compared to older LLaMA-series generated labels. Better prompt engineering and reasoning models directly translate to better fine-tuning data.
- Open Source Can Beat Closed Source: Small, domain-specific open-source models fine-tuned on this dataset (like the 8B Granite model) managed to outperform massive, closed-source general models like Claude 3.7 and GPT-3.5 on Verilog generation tasks.
Key Results
The authors fine-tuned several open-source model families (Qwen2.5-Coder and Granite) on OPENRTLSET and evaluated them using the Pass@k metric (the probability that at least one of the top $k$ generated code samples is correct).
- New State-of-the-Art: When fine-tuned on the full 131k dataset, Qwen2.5-32B achieved a remarkable 89.3% Pass@10 on the VerilogEval-Machine benchmark, and 64.2% Pass@10 on the tougher VerilogEval-Human benchmark.
- Consistent Scaling Gains: Moving from a downsampled 11k subset to the full 131k dataset provided absolute performance gains of up to 5.4% on machine benchmarks and 6.1% on human benchmarks, demonstrating that the dataset scales effectively.
Limitations and Future Work
While OPENRTLSET represents a massive leap forward, some limitations remain:
- Translation Failures: A significant portion of the scraped C/C++ code (around 11k out of 12k repositories) failed to synthesize into Verilog via Vitis HLS due to non-synthesizable constructs like standard library calls (
std::map). Refining the pre-filtering of software code could unlock even more data. - Alternative HDLs Ignored: The dataset completely bypassed emerging but less common hardware description languages/tools like Chisel, Veryl, and Spade due to low repository counts on GitHub. Future iterations could expand to include these modern HDLs as their ecosystems grow.
Summary updated