用大模型+参考模型定位并修复Verilog代码中的复杂错误
VeriPilot: An LLM-Powered Verilog Debugging Framework
- 通过对比设计与参考模型的内部变量语义,精准定位错误区域
- 在NVIDIA基准测试中将GPT-4o修复成功率从54.3%提升至85.71%
- 适合需要高精度调试数字电路的工程师和自动化工具开发者
Verilog调试仍是数字电路设计中最耗时的环节。尽管大语言模型(LLMs)已用于自动化调试,但现有方法多依赖测试输出和编译器反馈,难以处理复杂错误。因错误根源可能远离可观测输出,且大型代码库中上下文过长影响推理效率,传统方法效果受限。为此,我们提出VeriPilot,一个基于大模型的调试框架,利用黄金参考模型实现细粒度错误定位与修复。该框架不局限于输出对比,而是通过大模型分析设计代码与对应黄金模型之间的内部变量语义一致性,并结合静态分析生成的控制-数据流图(CDFGs),逐步追踪信号路径,识别出最小可疑代码区域及其在黄金模型中的正确对应部分。这些结构化信息随后引导大模型进行推理与自动修复。在NVIDIA提供的综合Verilog设计问题(CVDP)基准测试中,VeriPilot将GPT-4o的修复成功率从54.3%提升至85.71%,显著提升了复杂Verilog设计的错误定位准确率与修复有效性。项目源码与基准数据已公开于GitHub:https://github.com/YihanWn/VeriPilot.git。
原文摘要 · Abstract (English)
Verilog debugging remains one of the most time-consuming stages in digital circuit design. Recent advances in Large Language Models (LLMs) have enabled automated debugging; however, most existing approaches rely solely on test outputs and compiler feedback in an end-to-end manner, limiting their effectiveness on complex bugs. A key challenge is that the root cause of an error may be far removed from its observable outputs, making it difficult for LLMs to trace long dependency chains in code. This challenge is further exacerbated in large codebases, where long context lengths hinder efficient reasoning. To address these limitations, we propose VeriPilot, an LLM-powered debugging framework that leverages golden reference models to enable fine-grained bug localization and repair. VeriPilot goes beyond output-level comparison by aligning internal variable semantics between the Verilog design and its corresponding golden model through LLM-based analysis. It then performs step-by-step signal tracing using Control-Data-Flow Graphs (CDFGs) derived from static analysis, identifying a minimal set of suspicious code regions along with their correct counterparts from the golden model. These structured insights are subsequently provided to the LLM to guide reasoning and automated code repair. Experimental results on the Comprehensive Verilog Design Problems (CVDP) benchmark from NVIDIA demonstrate that VeriPilot improves the repair success rate of GPT-4o from 54.3\% to 85.71\%, significantly enhancing both bug localization accuracy and repair effectiveness for complex Verilog designs. The source code and benchmark are publicly available at Github https://github.com/YihanWn/VeriPilot.git.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。