Enhancing Large Language Models for Hardware Verification: A Novel SystemVerilog Assertion Dataset

Anand Menon, Samit Shahnawaz Miftah, Shamik Kundu, Souvik Kundu, Amisha Srivastava, Arnab Raha, Gaberiel Sonnenschien, Suvadeep Banerjee, Deepak A. Mathaikutty, Kanad Basu · DOI

Abstract Hardware verification is crucial in modern SoC design, consuming around 70% of development time. SystemVerilog assertions (SVA) ensure correct functionality; however, existing industrial practices rely on manual efforts for assertion generation, which becomes increasingly untenable as hardware systems grow in complexity. Recent research shows that Large Language Models (LLMs) can automate this process. However, proprietary state-of-the-art models like GPT-4o often generate inaccurate assertions and require expensive licenses, while smaller open-source LLMs need fine-tuning to manage hardware description language (HDL) code complexities. To address these issues, we introduce VERT, an open-source dataset designed to enhance SystemVerilog assertion generation using LLMs. VERT enables researchers to fine-tune open-source models, outperforming larger proprietary ones in both accuracy and efficiency while ensuring data privacy through local fine-tuning. The dataset is curated by systematically augmenting variables from open-source HDL repositories to generate synthetic code snippets paired with corresponding assertions. Experimental results demonstrate that fine-tuned models like Deepseek Coder 6.7B and Llama 3.1 8B outperform GPT-4o, achieving up to 96.88% improvement over base models and 24.14% over GPT-4o on platforms including OpenTitan, CVA6, OpenPiton, and Pulpissimo.

Introduction

In the contemporary System-on-Chip (SoC) design landscape, verification has emerged as the primary bottleneck, frequently accounting for 70% of the total development cycle. Engineers rely on SystemVerilog Assertions (SVA) to serve as formal "sanity checks" embedded within the code to ensure hardware behaves according to specification. Despite their importance, writing these assertions manually is a tedious, time-consuming process prone to human error.

While general-purpose Large Language Models (LLMs) like GPT-4o have demonstrated proficiency in software engineering tasks, they struggle with the specific nuances of hardware description languages (HDLs). These models often misinterpret clock cycles, fail to navigate complex nested logic, and oversimplify logical expressions. Furthermore, the use of proprietary models introduces significant data privacy risks for semiconductor firms protecting sensitive intellectual property (IP). To bridge this gap, we present VERT, the first large-scale, open-source dataset specifically engineered to train LLMs for SVA generation.

The VERT Dataset and Methodology

The VERT dataset comprises 20,000 samples categorized by logical structure (52% if-else, 28% case, 20% combined) and timing characteristics (synchronous vs. asynchronous). The creation of VERT followed a systematic pipeline designed to ensure both realism and technical accuracy.

Synthetic Generation with Real-World Roots

Rather than relying solely on scraped code, VERT utilizes variable names extracted from high-quality open-source RISC-V projects, including OpenTitan, Rocket-Chip, BOOM-core, and XiangShan. These variables were used to programmatically generate synthetic code snippets paired with correct SVAs. This approach ensures that the fine-tuned models encounter naming conventions and signal structures typical of industrial hardware designs.

Targeted Error Correction

The dataset was specifically structured to mitigate common LLM biases. For instance, general-purpose models often default to checking assignments in the following clock cycle (|=>). VERT standardizes the use of overlapping implication symbols (|->) to correct clock-cycle misinterpretations, forcing models to recognize when logic is combinatorial or requires same-cycle verification.

Fine-Tuning and Verification

We employed Low-Rank Adaptation (LoRA) to fine-tune Llama 3.1 8B and DeepSeek Coder 6.7B. This method allowed for the update of only 4-6% of the models' parameters, ensuring computational efficiency. To validate the generated assertions, we implemented a rigorous verification pipeline using industrial-grade tools such as Cadence JasperGold and Xilinx Vivado. We utilized mutation testing—intentionally introducing bugs into the design—to confirm that the generated assertions could successfully detect functional failures.

Key Insights and Results

Our evaluation across major open-source SoC platforms (OpenTitan, CVA6, OpenPiton, and Pulpissimo) yielded several critical insights:

  1. Small Models Outperform Proprietary Giants: Fine-tuned 7B and 8B parameter models outperformed GPT-4o by up to 24.14% in functional correctness. This demonstrates that domain-specific fine-tuning on high-quality data can compensate for smaller parameter counts, enabling secure, local deployment for engineering teams.
  2. The Impact of Data Cleaning: An ablation study revealed that refining variable names (removing special characters and duplicates) boosted syntactic correctness from approximately 34% to over 94%. This suggests that for hardware tasks, the quality of the naming convention is as vital as the underlying logic.
  3. Significant Performance Gains: Compared to their "out-of-the-box" base versions, the fine-tuned models showed a staggering 96.88% improvement in generating valid assertions. Furthermore, the models achieved up to 100% Complete Path Coverage (CPC) for several benchmarks, indicating that the generated assertions covered every logical branch in the design.

Limitations and Future Work

While VERT significantly advances the state of automated hardware verification, certain challenges remain. The current dataset focuses on logic nested up to two levels, whereas real-world hardware can feature deeper nesting. Additionally, the presence of "extraneous" code components, such as ifdef commands or complex module instantiations, can cause a slight degradation in performance (approximately 3%).

Future iterations of VERT will aim to include more intricate design patterns, complex asynchronous reset conditions, and power-aware verification scenarios. By providing an open-source foundation for SVA generation, we hope to accelerate the integration of AI into the hardware verification workflow.

VERT is available on GitHub: https://github.com/AnandMenon12/VERT

Summary updated

BibTeX
@article{menon2025enhancing,
  author = {Anand Menon and Samit Shahnawaz Miftah and Shamik Kundu and Souvik Kundu and Amisha Srivastava and Arnab Raha and Gaberiel Sonnenschien and Suvadeep Banerjee and Deepak A. Mathaikutty and Kanad Basu},
  title = {{Enhancing Large Language Models for Hardware Verification: A Novel SystemVerilog Assertion Dataset}},
  journal = {ACM Transactions on Design Automation of Electronic Systems},
  year = {2025},
  doi = {10.1145/3764934},
}
Figure