arXiv:2411.11856cs.ARcs.AI2024-11中稿 · publication in TOD…被引 31

用EDA工具反馈自动修复大模型生成的Verilog代码,提升成功率并大幅降本。

Automatically Improving LLM-based Verilog Generation using EDA Tool Feedback

  • 通过EDA工具反馈循环迭代修正大模型生成的Verilog代码。
  • 最佳情况下设计成功率达5.8%提升,成本降低34.2%。
  • 小模型+大模型混合使用可实现同等效果,成本再降41.9%。

传统数字硬件设计依赖工程师手动编写与调试Verilog代码,复杂设计下耗时且易出错。大语言模型(LLMs)有望自动生成功能完整的HDL代码,但现有工作多为单次生成与评估,未体现真实开发中的调试流程。本文提出开源可定制框架AutoChip,将对话式LLM与Verilog编译器及仿真输出结合,实现代码的迭代生成与修复。基于VerilogEval基准测试集,评估四种主流商用对话式LLM。结果显示,除GPT-4o外,其他模型仅靠零样本提示无法有效利用反馈;而借助反馈后,最优案例中成功设计数提升5.8%,成本下降34.2%。在反馈末期融合较小模型,可达到与GPT-4o相当的成功率,但成本降低41.9%(相比零样本整体降本89.6%)。

原文摘要 · Abstract (English)

Traditionally, digital hardware designs are written in the Verilog hardware description language (HDL) and debugged manually by engineers. This can be time-consuming and error-prone for complex designs. Large Language Models (LLMs) are emerging as a potential tool to help generate fully functioning HDL code, but most works have focused on generation in the single-shot capacity: i.e., run and evaluate, a process that does not leverage debugging and, as such, does not adequately reflect a realistic development process. In this work, we evaluate the ability of LLMs to leverage feedback from electronic design automation (EDA) tools to fix mistakes in their own generated Verilog. To accomplish this, we present an open-source, highly customizable framework, AutoChip, which combines conversational LLMs with the output from Verilog compilers and simulations to iteratively generate and repair Verilog. To determine the success of these LLMs we leverage the VerilogEval benchmark set. We evaluate four state-of-the-art conversational LLMs, focusing on readily accessible commercial models. EDA tool feedback proved to be consistently more effective than zero-shot prompting only with GPT-4o, the most computationally complex model we evaluated. In the best case, we observed a 5.8% increase in the number of successful designs with a 34.2% decrease in cost over the best zero-shot results. Mixing smaller models with this larger model at the end of the feedback iterations resulted in equally as much success as with GPT-4o using feedback, but incurred 41.9% lower cost (corresponding to an overall decrease in cost over zero-shot by 89.6%).

Verilog生成大模型EDA工具自动化调试

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。