Table of Contents
Fetching ...

AnalogCoder: Analog Circuit Design via Training-Free Code Generation

Yao Lai, Sungyoung Lee, Guojin Chen, Souradip Poddar, Mengkang Hu, David Z. Pan, Ping Luo

TL;DR

AnalogCoder presents a training-free LLM agent that designs analog circuits by generating executable Python code via PySpice. It combines domain-tailored prompts, a feedback-enhanced design flow, and a circuit tool library to autonomously correct errors and reuse successful subcircuits, achieving superior performance on a 24-task analog benchmark with $20$ solved tasks. The work introduces a scalable, open benchmark and demonstrates how prompting choices and modular tools can unlock LLMs for sophisticated analog design without data-intensive fine-tuning. This approach reduces manual design effort and broadens accessibility for non-experts while highlighting remaining challenges in scaling to highly complex analog architectures.

Abstract

Analog circuit design is a significant task in modern chip technology, focusing on the selection of component types, connectivity, and parameters to ensure proper circuit functionality. Despite advances made by Large Language Models (LLMs) in digital circuit design, the complexity and scarcity of data in analog circuitry pose significant challenges. To mitigate these issues, we introduce AnalogCoder, the first training-free LLM agent for designing analog circuits through Python code generation. Firstly, AnalogCoder incorporates a feedback-enhanced flow with tailored domain-specific prompts, enabling the automated and self-correcting design of analog circuits with a high success rate. Secondly, it proposes a circuit tool library to archive successful designs as reusable modular sub-circuits, simplifying composite circuit creation. Thirdly, extensive experiments on a benchmark designed to cover a wide range of analog circuit tasks show that AnalogCoder outperforms other LLM-based methods. It has successfully designed 20 circuits, 5 more than standard GPT-4o. We believe AnalogCoder can significantly improve the labor-intensive chip design process, enabling non-experts to design analog circuits efficiently.

AnalogCoder: Analog Circuit Design via Training-Free Code Generation

TL;DR

AnalogCoder presents a training-free LLM agent that designs analog circuits by generating executable Python code via PySpice. It combines domain-tailored prompts, a feedback-enhanced design flow, and a circuit tool library to autonomously correct errors and reuse successful subcircuits, achieving superior performance on a 24-task analog benchmark with solved tasks. The work introduces a scalable, open benchmark and demonstrates how prompting choices and modular tools can unlock LLMs for sophisticated analog design without data-intensive fine-tuning. This approach reduces manual design effort and broadens accessibility for non-experts while highlighting remaining challenges in scaling to highly complex analog architectures.

Abstract

Analog circuit design is a significant task in modern chip technology, focusing on the selection of component types, connectivity, and parameters to ensure proper circuit functionality. Despite advances made by Large Language Models (LLMs) in digital circuit design, the complexity and scarcity of data in analog circuitry pose significant challenges. To mitigate these issues, we introduce AnalogCoder, the first training-free LLM agent for designing analog circuits through Python code generation. Firstly, AnalogCoder incorporates a feedback-enhanced flow with tailored domain-specific prompts, enabling the automated and self-correcting design of analog circuits with a high success rate. Secondly, it proposes a circuit tool library to archive successful designs as reusable modular sub-circuits, simplifying composite circuit creation. Thirdly, extensive experiments on a benchmark designed to cover a wide range of analog circuit tasks show that AnalogCoder outperforms other LLM-based methods. It has successfully designed 20 circuits, 5 more than standard GPT-4o. We believe AnalogCoder can significantly improve the labor-intensive chip design process, enabling non-experts to design analog circuits efficiently.
Paper Structure (37 sections, 10 figures, 11 tables)

This paper contains 37 sections, 10 figures, 11 tables.

Figures (10)

  • Figure 1: Leaderboard of LLM analog circuit design. LLMs are ranked by the number of analog circuits they design successfully. Design tasks are classified as easy, medium, or hard based on component count and connection complexity. It displays several designs from our benchmark (Task ID=1, 5, 10, 9, 11, 16) and lists the LLMs that successfully created them. Results are from Table \ref{['main_result']} and \ref{['ablation']}.
  • Figure 2: Representations of designed circuit. We input the design task description into the LLM, which outputs the design in Python. Three interconvertible representations of the designed circuit: (1) Circuit diagrams, typically take human experts several days to design due to the intricate and demanding process of selecting and connecting components. (2) SPICE code, which represents circuits through formatted netlists. (3) Python code with the PySpice library, achieving circuits equivalent to those generated by SPICE code. However, due to the coding's complexity and non-intuitive nature, experts typically sketch circuit diagrams manually and then generate the codes using design tools. More code samples are in Appendix Sec. \ref{['example_generated_circuits']}.
  • Figure 3: Method Overview.(a) Standard method. By converting circuit design tasks into prompts and inputting the LLM's outputs into the normal flow, the correctness of the circuit is verified. (b) Our method for basic circuit design. Input the design prompts to the feedback-enhanced design flow, enabling the automated error fix with LLMs. Successfully designed circuits are added to the circuit tool library, while failed designs are returned to the LLM for automatic fixing. (c) Our method for composite circuit design. The process adds a step of querying the library to retrieve invocation methods for subcircuits, which are then integrated into the design prompt to facilitate the design of composite circuits.
  • Figure 4: Feedback-Enhanced Design Flow. The flow facilitates autonomous error correction in designs by the LLM agent without human intervention. Error messages identified during the checking process are returned to the LLM to assist in refining the design. The entire flow is adaptable to nearly all categories of analog circuits.
  • Figure 5: Circuit Tool library.Top: Addition of new tools derived from successfully designed basic circuits. Here, descriptions and specifications are keys, while design codes are stored as values. Bottom: Retrieval of tools from the library for designing composite circuits. The process begins with the LLM querying necessary tools using the task description. Subsequently, the keys and values of the retrieved tools, with the task description, are employed as prompts for circuit design.
  • ...and 5 more figures