Skip to main content
QUICK REVIEW

[论文解读] SPICEPilot: Navigating SPICE Code Generation and Simulation with AI Guidance

Deepak Vungarala, Saman Alam|arXiv (Cornell University)|Oct 27, 2024
Real-time simulation and control systemsEngineering被引用 3
一句话总结

SPICEPilot 引入了一个基于 Python 的框架和开源数据集,利用大语言模型(LLMs)自动化模拟电路的 SPICE 代码生成与仿真。通过使用 PySpice 生成标准化、可验证的 SPICE 网表,并引入基准评估指标,该框架实现了对 LLM 性能的可靠评估,在复杂电路任务中,GPT-4o 和 Claude 模型的通过率最高达到 85.5%。

ABSTRACT

Large Language Models (LLMs) have shown great potential in automating code generation; however, their ability to generate accurate circuit-level SPICE code remains limited due to a lack of hardware-specific knowledge. In this paper, we analyze and identify the typical limitations of existing LLMs in SPICE code generation. To address these limitations, we present SPICEPilot a novel Python-based dataset generated using PySpice, along with its accompanying framework. This marks a significant step forward in automating SPICE code generation across various circuit configurations. Our framework automates the creation of SPICE simulation scripts, introduces standardized benchmarking metrics to evaluate LLM's ability for circuit generation, and outlines a roadmap for integrating LLMs into the hardware design process. SPICEPilot is open-sourced under the permissive MIT license at https://github.com/ACADLab/SPICEPilot.git.

研究动机与目标

  • 解决 LLM 在缺乏硬件特定知识的情况下生成准确 SPICE 代码的能力有限的问题。
  • 通过使用 LLM 自动生成开源、标准化的 SPICE 代码数据集,克服模拟电路设计中的数据稀缺问题。
  • 建立可复现的基准评估框架,并引入定量指标,以评估 LLM 在电路生成与仿真中的表现。
  • 通过实现 SPICE 仿真脚本的自动生成和波形验证,将 LLM 集成到硬件设计工作流中。
  • 为未来模拟设计自动化提供路线图,以增强 LLM 的领域特定推理能力和电路智能。

提出的方法

  • 使用 PySpice 生成全面的基于 Python 的 SPICE 代码数据集,以模拟各种晶体管模型和电路配置。
  • 开发一个框架,利用 PySpice 自动化 SPICE 仿真脚本生成、网表创建和波形输出。
  • 实施标准化的基准评估指标(如 Pass@1、Pass@5),以在不同复杂度水平下评估 LLM 在电路生成任务中的表现。
  • 通过提示工程和思维链(chain-of-thought)技术提升 LLM 的可靠性,特别是在处理复杂电路时。
  • 实现对生成的网表和仿真结果的自动化验证,以确保功能正确性和参数合规性。
  • 通过基于类的电路构建方式支持可扩展性,并支持未来与多模态 LLM 的集成,例如以电路图为输入。
Figure 1: Illustration of the errors generated by LLM for hardware in SPICE. (a) Incorrect W:L ratio, (b) Inability to perform circuit analysis, (c) incorrect input signals.
Figure 1: Illustration of the errors generated by LLM for hardware in SPICE. (a) Incorrect W:L ratio, (b) Inability to perform circuit analysis, (c) incorrect input signals.

实验结果

研究问题

  • RQ1LLM 在生成模拟电路的准确 SPICE 代码方面有多可靠?其在该领域中的核心局限性是什么?
  • RQ2需要采取哪些步骤来开发一个针对模拟电路设计进行微调的专用 LLM,以融入领域特定知识?
  • RQ3如何通过 LLM 驱动的自动化数据集生成来缓解模拟电路设计中的数据稀缺问题?
  • RQ4LLM 能否通过自验证和迭代提示技术,自主生成或增强模拟电路设计的数据集?
  • RQ5如何为 LLM 赋予针对电路行为、参数调节和功能验证的逻辑推理能力?

主要发现

  • SPICEPilot 在使用 GPT-3.5 的增强基准测试中,Pass@1 达到 63.5%,Pass@5 达到 68.6%;GPT-4o 在中等和复杂电路中分别达到 80.0% Pass@1 和 88.0% Pass@3。
  • Claude 模型在完整基准测试中实现了 79.8% Pass@1 和 85.5% Pass@5,优于 CodeLlama-70B 和 WizardCoder-33B 在复杂电路生成中的表现。
  • 对于复杂电路(14–24 个元器件),GPT-4o 的 Pass@1 为 20.0%,表明在模块定义和参数调节方面仍存在挑战,但可通过思维链提示技术缓解。
  • 该框架成功实现了 SPICE 网表生成和波形可视化自动化,支持电路设计的快速验证与迭代。
  • 人工参与的评估确认,LLM 生成的电路需要对电阻和耦合电容进行微调,才能满足增益等功能规格要求。
  • 开源数据集和基准评估框架已公开发布于 https://github.com/ACADLab/SPICEPilot.git,支持可复现的评估和未来模型开发。
Figure 2: SPICEPilot Framework.
Figure 2: SPICEPilot Framework.

阅读本论文

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

在 Nubint 中阅读本论文

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