[Paper Review] Using LLMs to Facilitate Formal Verification of RTL
The paper investigates using GPT-4 to generate correct SystemVerilog Assertions (SVA) from RTL without predefined specifications, and integrates this flow into AutoSVA to improve FPV coverage and even aid RTL generation.
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 GPT4 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 GPT4-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 GPT4-generated SVA on complex open-source RTL and (2) using generated SVA to prompt GPT4 to create RTL from scratch. Through these experiments, we find that GPT4 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.
Motivation & Objective
- Address the challenge that writing formal properties is time-consuming and error-prone.
- Explore whether LLMs can capture RTL behavior and generate correct SVA from RTL alone.
- Develop an iterative rule-refinement workflow to train GPT-4 to produce valid and complete SVA properties.
- Extend AutoSVA with a GPT-4 based SVA generation flow and evaluate on complex RTL modules.
Proposed method
- Design an FPV-based evaluation framework to judge correctness and completeness of SVA.
- Iteratively refine GPT-4 prompting rules to generate syntactically and semantically correct SVA from RTL.
- Integrate the improved GPT-4 flow into an extended AutoSVA framework (AutoSVA2) to generate safety and liveness properties.
- Evaluate GPT-4 generated SVA on complex RTL modules (PTW and TLB in CVA6) and compare RTL coverage.
- Use GPT-4 generated RTL from scratch with an iterative RTL/SVA loop guided by FPV feedback.

Experimental results
Research questions
- RQ1Can LLMs generate correct SVA properties from RTL without explicit high-level specifications?
- RQ2How can prompting rules be engineered to teach an LLM the semantics and timing of SVA?
- RQ3Does integrating an LLM-based SVA flow into AutoSVA improve RTL property coverage and fault detection?
- RQ4Can GPT-4 generate RTL from scratch when guided by SVA prompts, and can FPV feedback improve RTL quality?
Key findings
- GPT-4 can generate correct SVA from buggy RTL without mirroring design errors.
- The quality of SVA improves as the rule set guiding GPT-4 is refined, achieving full syntax correctness after 23 iterations for the FIFO module in T23.
- AutoSVA2 substantially increases RTL behavior coverage over AutoSVA alone, with up to 6x improvements in toggle coverage for certain modules.
- GPT-4 uncovering a bug in the RISC-V CVA6 PTW by producing a failing assertion that corresponds to a known RTL bug after multiple batches.
- Using multiple batches of GPT-4 generated SVA yields greater RTL coverage (e.g., PTW: up to ~1.25x statement coverage with six batches; TLB: up to ~6x).
- The combination of AutoSVA assertions and GPT-4 generated ones provides complementary coverage for some modules.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.