Skip to main content
QUICK REVIEW

[论文解读] AutoChip: Automating HDL Generation Using LLM Feedback

Shailja Thakur, Jason Blocklove|arXiv (Cornell University)|Nov 8, 2023
Software Engineering ResearchComputer Science被引用 17
一句话总结

AutoChip 自动通过向 LLMs 提供编译器和模拟器反馈来迭代 Verilog 代码生成,在零-shot 生成基础上功能正确性提升约 24.2%,在 HDLBits 上用多种 LLM 进行评估。

ABSTRACT

Traditionally, designs are written in Verilog hardware description language (HDL) and debugged by hardware engineers. While this approach is effective, it is time-consuming and error-prone for complex designs. Large language models (LLMs) are promising in automating HDL code generation. LLMs are trained on massive datasets of text and code, and they can learn to generate code that compiles and is functionally accurate. We aim to evaluate the ability of LLMs to generate functionally correct HDL models. We build AutoChip by combining the interactive capabilities of LLMs and the output from Verilog simulations to generate Verilog modules. We start with a design prompt for a module and the context from compilation errors and debugging messages, which highlight differences between the expected and actual outputs. This ensures that accurate Verilog code can be generated without human intervention. We evaluate AutoChip using problem sets from HDLBits. We conduct a comprehensive analysis of the AutoChip using several LLMs and problem categories. The results show that incorporating context from compiler tools, such as Icarus Verilog, improves the effectiveness, yielding 24.20% more accurate Verilog. We release our evaluation scripts and datasets as open-source contributions at the following link https://github.com/shailja-thakur/AutoChip.

研究动机与目标

  • 推动自动化 HDL 代码生成,以减少 Verilog 设计的时间和错误。
  • 评估迭代的、基于工具信息的反馈是否能够提升 LLM 生成的 Verilog 相对于零样本方法的表现。
  • 评估反馈类型和上下文窗口对代码质量与成本的影响。
  • 探索多 LLM 集成和迭代次数,以在最大化功能正确性的同时限制上下文大小和成本。

提出的方法

  • 在迭代轮中将 Verilog 编译和仿真输出与 LLM 驱动的代码生成结合起来。
  • 使用系统提示与每次迭代的反馈(包括编译器/仿真错误和测试基准结果)作为输入给 LLM。
  • 将上下文限制为最近一次迭代,以适应令牌约束并引导修正。
  • 在 HDLBits 的多种问题类别和多种 LLM 上进行评估。
  • 对比零样本生成与反馈驱动生成,并分析随迭代次数和上下文策略的性能。

实验结果

研究问题

  • RQ1相比于零样本输出,反馈是否能提升 Verilog 生成的质量?
  • RQ2迭代次数和上下文策略如何影响生成的 RTL 代码的成功率和错误类型?
  • RQ3最近上下文的反馈是否比全上下文反馈更有效且成本更低?
  • RQ4将多种 LLM 的集成是否能在单模型基础上进一步提升结果?
  • RQ5迭代的、以反馈为驱动的 HDL 生成的成本与延迟影响是什么?

主要发现

  • Incorporating compilation and simulation feedback into the LLM prompt substantially improves Verilog correctness over zero-shot generation.
  • Across LLMs, iterative feedback enhances Pass@k metrics, e.g., Claude 2 and GPT-3.5 show gains with iterations.
  • Using most-recent-context feedback yields better results and lower context size costs than full-context feedback.
  • An ensemble of LLMs (GPT-3.5 and GPT-4) further boosts success rates on many problems compared to single-model runs.
  • AutoChip achieves up to 89.19% success (Pass@10) on GPT-3.5 and GPT-4 together for HDLBits problems.
  • Even with iterative feedback, certain problem classes (e.g., cellular automata and certain testbench Generation tasks) remain challenging without human input.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。