用开源工具链+大模型自动修复硬件代码错误并证明正确性
Open-Source LLM-Driven Formal Verification: A Multi-Agent Pipeline for RTL Repair

- 大模型结合Yosys等开源工具,通过反例迭代修复RTL代码
- 在6个测试用例中成功修复1个设计,验证了形式化证明可行性
- 适合关注开源硬件验证与大模型应用的研究者
验证占现代芯片设计的大部分工作量,而提供数学正确性保证的形式化验证工具昂贵且许可受限。尽管大语言模型在硬件设计中展现出潜力,现有RTL修复方法多依赖仿真(仅覆盖部分输入)或商用工具,鲜有将形式化证明与完全开源工具链结合。本文提出一个多智能体流水线,将大模型与开源形式化后端(Yosys、SymbiYosys、Z3)结合,通过反例引导迭代修复RTL:框架生成形式化属性,验证设计,并将反例反馈给大模型,直至通过k-归纳法证明正确或达到迭代预算。在ALU案例研究中,该流程成功检测并修复了一个真实功能缺陷,且获得形式化证明。在六个基准测试中,一个设计被可靠修复,我们识别出四种失效模式:有限覆盖空洞、规范模糊、时序逻辑错误和多属性压力。本工作为可行性研究,附详细失败分析,并报告了Yosys bind指令对开源形式化验证社区的实际限制。
原文摘要 · Abstract (English)
Verification consumes the majority of modern chip design effort, yet the formal verification tools that provide mathematical guarantees of correctness remain expensive and restrictively licensed. While large language models (LLMs) have shown promise for hardware design, existing approaches to RTL repair validate their results through simulation - which exercises only a subset of inputs - or rely on commercial tools, and few combine formal proof with an entirely open-source toolchain. In this paper, we present a multi-agent pipeline that couples an LLM with an open-source formal backend (Yosys, SymbiYosys, and Z3) to repair RTL through counterexample-guided iteration: the framework generates formal properties, verifies the design, and feeds counterexamples back to the LLM until the design is proved correct by k-induction or an iteration budget is exhausted. Through an ALU case study, we show that the pipeline can detect and repair a real functional bug with a formal proof of correctness. Across a six-benchmark suite, one design is repaired reliably, and we characterize four distinct failure modes: bounded-cover vacuity, specification ambiguity, temporal-logic bugs, and multi-property pressure. We frame this work as a feasibility study with a detailed failure analysis, and additionally report a practical limitation of the Yosys bind directive relevant to the open-source formal verification community.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。