arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2309.09437cs.ARcs.SE
收藏

利用大语言模型促进 RTL 的形式化验证

Using LLMs to Facilitate Formal Verification of RTL

Marcelo Orenes-Vera, Margaret Martonosi, David Wentzlaff

AI总结:

本文提出基于 GPT4 的 SVA 生成与 FPV 评估流程,扩展 AutoSVA 以生成安全性和活性属性,并在开源 RTL 上验证其覆盖率及反向生成 RTL 的能力,发现了 RISC-V CVA6 的隐藏缺陷。

摘要:

形式化属性验证(FPV)已经存在数十年,并已被证明能有效发现复杂的 RTL 缺陷。然而,形式化属性(例如以 SystemVerilog Assertions(SVA)编写的属性)编写起来既耗时又容易出错,即使对经验丰富的用户也是如此。先前工作曾尝试通过提高抽象层级来减轻这一负担,即从高层规范生成 SVA。但这并未消除推理并编写详细硬件行为所需的人工工作。受异构硬件时代对 FPV 需求增长以及大语言模型(LLM)进展的推动,我们着手探索 LLM 是否能够捕捉 RTL 行为并生成正确的 SVA 属性。首先,我们设计了一个基于 FPV 的评估框架,用于衡量 SVA 的正确性和完整性。随后,我们迭代评估 GPT4,以制定一组合法性和语义规则,从而通过提示引导其创建更好的 SVA。我们扩展了开源 AutoSVA 框架:除了增强其既有的活性属性流程外,还集成了我们改进的、基于 GPT4 的流程以生成安全性属性。最后,我们的用例评估了:(1)在复杂开源 RTL 上,GPT4 生成的 SVA 的 FPV 覆盖率;(2)使用生成的 SVA 提示 GPT4 从头创建 RTL。通过这些实验,我们发现 GPT4 即使针对存在缺陷的 RTL 也能生成正确的 SVA,而不会照搬设计错误。特别是,它生成的 SVA 暴露了 RISC-V CVA6 核心中的一个缺陷,而该缺陷在先前工作的评估中未被发现。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑