NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Using LLMs to Facilitate Formal Verification of RTL

Marcelo Orenes-Vera, Margaret Martonosi, David WentzlaffarXiv 2023

Abstract

Formal property verification (FPV) has existed for decades and has been shown to be effective at finding intricate RTL bugs. However, formal properties, such as those written as SystemVerilog Assertions (SVA), are time-consuming and error-prone to write, even for experienced users. Prior work has attempted to lighten this burden by raising the abstraction level so that SVA is generated from high-level specifications. However, this does not eliminate the manual effort of reasoning and writing about the detailed hardware behavior. Motivated by the increased need for FPV in the era of heterogeneous hardware and the advances in large language models (LLMs), we set out to explore whether LLMs can capture RTL behavior and generate correct SVA properties. First, we design an FPV-based evaluation framework that measures the correctness and completeness of SVA. Then, we evaluate GPT-4 iteratively to craft the set of syntax and semantic rules needed to prompt it toward creating better SVA. We extend the open-source AutoSVA framework by integrating our improved GPT-4-based flow to generate safety properties, in addition to facilitating their existing flow for liveness properties. Lastly, our use cases evaluate (1) the FPV coverage of GPT-4-generated SVA on complex open-source RTL and (2) using generated SVA to prompt GPT-4 to create RTL from scratch. Through these experiments, we find that GPT-4 can generate correct SVA even for flawed RTL, without mirroring design errors. Particularly, it generated SVA that exposed a bug in the RISC-V CVA6 core that eluded the prior work's evaluation.

Introduction

As hardware designs grow increasingly complex, verification has become the primary bottleneck in chip development. Formal Property Verification (FPV) offers a mathematically rigorous way to prove a design is bug-free, but it relies heavily on SystemVerilog Assertions (SVA). Writing these assertions is often considered a "dark art"—it is time-consuming, requires specialized expertise, and is highly error-prone. While previous automation attempts relied on high-level specifications, such specifications are rarely available or sufficiently precise in real-world projects. This research explores whether Large Language Models (LLMs), specifically GPT-4, can analyze raw Register Transfer Level (RTL) code to autonomously generate high-quality assertions.

Methodology: AutoSVA2

The researchers developed AutoSVA2, a framework that integrates GPT-4 into the hardware verification pipeline. The approach is built on two main pillars: iterative rule refinement and an automated generation framework.

Iterative Rule Refinement

Initial experiments revealed that "out-of-the-box" LLMs struggle with the specific syntax and timing semantics of SVA. To address this, the team implemented a feedback loop where LLM-generated assertions were tested in a formal verification engine (JasperGold). Failures were analyzed to manually craft a set of guiding "rules"—such as proper handling of internal signals and clock cycle delays. This process spanned 24 iterations, eventually resulting in a robust rule set that significantly improved assertion quality.

Iterative refinement process showing the evolution of SVA generation rules across 24 trials.

The AutoSVA2 Framework

AutoSVA2 extends the open-source AutoSVA tool by leveraging GPT-4 for two primary tasks: generating "safety" properties (ensuring "nothing bad happens") and automating the annotations required for "liveness" properties (ensuring "something good eventually happens").

The AutoSVA2 framework architecture integrating GPT-4 for safety and liveness property generation.

Key Insights

Reasoning Over Mirroring

A significant finding was that GPT-4 does not simply "mirror" bugs present in the RTL it reads. Instead, the model appears to reason about the intent of the design. It successfully generated correct assertions even when the underlying RTL was flawed, effectively acting as an independent auditor.

Handling Timing and Coverage

The most difficult hurdle was teaching the LLM timing concepts, such as the difference between immediate checks and those occurring on subsequent clock cycles. Refined rules for operators like $past and implication (|-> vs |=>) were crucial. Furthermore, the researchers found that generating multiple "batches" of assertions allowed the LLM to explore different parts of the design space, leading to much higher coverage than a single-pass approach.

Results and Evaluation

The framework was evaluated on real-world hardware, including a FIFO buffer and complex modules from the industry-grade CVA6 (Ariane) RISC-V Core, specifically the Page-Table Walker (PTW) and Translation Look-aside Buffer (TLB).

  • Bug Discovery: AutoSVA2 uncovered a real, recently fixed bug in the CVA6 core that had eluded previous automated tools.
  • Coverage Gains: Compared to the original AutoSVA, the GPT-4-powered flow increased statement coverage by 1.25x for the PTW and 6x for the TLB.
  • RTL Generation: In a secondary use case, the researchers used refined SVA as a "specification" to prompt GPT-4 to write RTL from scratch. This resulted in a bug-free FIFO module in just two iterations.

Conclusion and Future Work

AutoSVA2 demonstrates that LLMs can significantly lower the barrier to formal verification. While human oversight is still required to audit final assertions and context window limits remain a challenge for monolithic designs, the results are promising. Future work aims to "close the loop" with auto-prompting, where FPV error reports are fed directly back into the LLM to automatically fix syntax and semantic errors.

Summary updated

BibTeX
@misc{orenesvera2023using,
  author = {Marcelo Orenes-Vera and Margaret Martonosi and David Wentzlaff},
  title = {{Using LLMs to Facilitate Formal Verification of RTL}},
  year = {2023},
  eprint = {2309.09437},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.09437},
}
Figure