# SPICE仿真

SPICE仿真是一种电路仿真方法，它从用户编写的网表描述出发，对电子电路的非线性微分方程进行数值求解，以预测其完整的大信号行为。该名称代表“集成电路重点仿真程序”（Simulation Program with Integrated Circuit Emphasis），该方法可计算模拟与混合信号电路的直流工作点、瞬态波形和小信号交流响应。<sup>[1](https://www.egr.msu.edu/classes/ece445/mason/Files/KSU_short_spice_tutorial.pdf)</sup> 由于能够计算任意电路的完整大信号行为，它成为模拟设计事实上的标准引擎<sup>[2](https://www.analog.com/en/resources/technical-articles/spice-differentiation.html)</sup>，电子产业的相当一部分都在使用它。<sup>[3](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1975/9602.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 计算内容 | 从网表进行非线性直流、非线性瞬态和线性交流分析<sup>[4](http://bear.ces.cwru.edu/eecs_cad/man_spice2_sec1.html)</sup> |
| 核心数值方法 | 改进节点分析、隐式积分（梯形法或Gear法）、牛顿–拉夫逊迭代、稀疏高斯消元<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup><sup> • </sup><sup>[6](https://designers-guide.org/analysis/dg-spice/ch1.pdf)</sup> |
| 默认容差 | RELTOL = 0.001，ABSTOL = 1 pA，VNTOL = 1 µV，TRTOL = 7，CHGTOL = 0.01 pC<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup><sup> • </sup><sup>[7](https://ymkei.org/docs/ngspice-html-manual/manual.xhtml)</sup> |
| 起源 | 加州大学伯克利分校，1970年代；SPICE2记录于Larry Nagel 1975年的博士论文<sup>[3](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1975/9602.html)</sup> |
| 规模限制 | 直接求解器的复杂度为 \( O(n^{1.3-1.8}) \)；传统SPICE在未知量超过数万时难以应对<sup>[8](https://link.springer.com/article/10.1186/s13362-017-0042-z)</sup><sup> • </sup><sup>[9](https://www.osti.gov/servlets/purl/1592255)</sup> |
| 主要衍生版本 | HSPICE、Spectre、ELDO、ngspice、Xyce<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup> |

## 工作原理

SPICE分三步进行。<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup> 首先，它使用改进节点分析建立电路方程，求解节点电压，并在需要时把选定的支路电流（例如流经电压源的电流）作为额外未知量加入。<sup>[11](https://www.ecircuitcenter.com/SpiceTopics/Overview/Overview.htm)</sup> 其次，它在时间上对非线性微分方程进行离散化。第三，它在每个时间点上通过牛顿–拉夫逊迭代求解非线性方程，即基于初始估计用线性系统近似这些方程，并反复迭代直到满足收敛判据。<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup><sup> • </sup><sup>[12](https://kenkundert.com/docs/eda+t93-preso.pdf)</sup> 所得的线性方程由稀疏[高斯消元法](https://www.edgepedia.org/zh/gaussian-elimination)求解。<sup>[6](https://designers-guide.org/analysis/dg-spice/ch1.pdf)</sup>

三种分析类型的工作方式各不相同。<sup>[13](https://www.eng.biu.ac.il/temanad/files/2022/04/Lecture-3-Behind-the-scenes-of-SPICE.pdf)</sup> 直流分析将非线性代数系统线性化，并用[牛顿法](https://www.edgepedia.org/zh/newtons-method)迭代求解。瞬态分析对时间进行离散化，在每个时间步上进行一次直流分析。交流分析先求出直流工作点，然后假定小信号下系统为线性。

在时间离散化方面，大多数实现遵循伯克利SPICE的做法，提供两种二阶隐式积分形式：Gear法和梯形法。<sup>[2](https://www.analog.com/en/resources/technical-articles/spice-differentiation.html)</sup> 在SPICE中，二阶Gear公式采用步长比 \( r = 1 \)，使其具有A稳定性。<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup> 收敛容差默认为RELTOL = 0.001、ABSTOL = 1 pA、TRTOL = 7、CHGTOL = 0.01 pC。<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup>

## 使用方法

使用者编写网表，描述电路拓扑与元件数值，并加上指定分析和输出的控制行。<sup>[1](https://www.egr.msu.edu/classes/ece445/mason/Files/KSU_short_spice_tutorial.pdf)</sup> 电路可以包含电阻、电容、电感、传输线、开关，以及二极管、BJT、JFET、MESFET和MOSFET。<sup>[7](https://ymkei.org/docs/ngspice-html-manual/manual.xhtml)</sup> 分析类型由控制卡选择：瞬态分析使用`.TRAN tstep tstop`，从时间0运行到tstop秒，每隔tstep秒记录一个值；交流分析使用`.AC DEC pointsperinterval fstart fstop`。<sup>[14](https://web.mit.edu/6.012/www/SPICEtutorial.pdf)</sup>

## 起源

SPICE由伯克利的一系列程序发展而来：BIAS、SLIC、TIME和CANCER。<sup>[15](https://omega-enterprises.net/The%20Origins%20of%20SPICE.html)</sup> CANCER（Computer Analysis of Nonlinear Circuits, Excluding Radiation，即“非线性电路计算机分析，不含辐射”）引入了稀疏矩阵求解器、隐式积分、内置半导体器件模型，以及用于灵敏度和噪声分析的伴随方法。<sup>[15](https://omega-enterprises.net/The%20Origins%20of%20SPICE.html)</sup> CANCER从未公开发布；SPICE作为其继任者被开发出来，于1972年底至1973年初首次公开可用。<sup>[16](http://r6.ieee.org/scv-sscs/wp-content/uploads/sites/80/2018/12/The-Life-of-SPICE.pdf)</sup><sup> • </sup><sup>[15](https://omega-enterprises.net/The%20Origins%20of%20SPICE.html)</sup>

CANCER被更名为SPICE1，代码经过重写产生了SPICE2，记录于1975年伯克利的一篇博士论文中。<sup>[15](https://omega-enterprises.net/The%20Origins%20of%20SPICE.html)</sup><sup> • </sup><sup>[3](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1975/9602.html)</sup> SPICE2于1975年首次进入公有领域，包含约8000行FORTRAN代码，采用动态内存分配改造了数据结构，并升级了直流收敛与瞬态数值积分算法。<sup>[16](http://r6.ieee.org/scv-sscs/wp-content/uploads/sites/80/2018/12/The-Life-of-SPICE.pdf)</sup> SPICE 2B经改进成为业界标准的SPICE 2G6。<sup>[15](https://omega-enterprises.net/The%20Origins%20of%20SPICE.html)</sup> SPICE3于1989年进入公有领域。<sup>[16](http://r6.ieee.org/scv-sscs/wp-content/uploads/sites/80/2018/12/The-Life-of-SPICE.pdf)</sup>

SPICE的成功有三个原因：它为集成电路仿真而设计，内置了所有需要的模型，比早期的仿真器更易使用<sup>[6](https://designers-guide.org/analysis/dg-spice/ch1.pdf)</sup>；其源代码可以低价获得；伯克利的毕业生将其传播开来。<sup>[13](https://www.eng.biu.ac.il/temanad/files/2022/04/Lecture-3-Behind-the-scenes-of-SPICE.pdf)</sup>

## 变体

SPICE2的工业衍生版本包括[贝尔实验室](https://www.edgepedia.org/zh/bell-labs)的ADVICE、德州仪器的TISPICE、摩托罗拉的MCSPICE，以及Meta Software的[HSPICE](https://www.edgepedia.org/zh/hspice)（源自SPICE 2E）。<sup>[16](http://r6.ieee.org/scv-sscs/wp-content/uploads/sites/80/2018/12/The-Life-of-SPICE.pdf)</sup> 所有SPICE变体都处于相同的晶体管级抽象层次，区别在于求解器方法上的改进，影响吞吐量、收敛可靠性和容量。<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup>

在当前工具中，HSPICE（Synopsys）被描述为模拟精度的黄金标准，带有专有的收敛增强功能。<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup> Xyce（桑迪亚国家实验室）面向基于MPI的HPC并行计算，可扩展至数千个核心。<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup> Ngspice是主要的开源SPICE<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup>；它是基于Spice3f5、Cider1b1和Xspice的混合层次/混合信号仿真器<sup>[17](https://github.com/imr/ngspice/blob/master/FAQ)</sup>，自版本42起提供两种矩阵求解器：原始的Sparse 1.3，以及面向数千晶体管大电路的可选KLU求解器。<sup>[7](https://ymkei.org/docs/ngspice-html-manual/manual.xhtml)</sup>

## 应用

Spectre（Cadence）凭借包括PSS、PAC、PXF和Pnoise在内的全面射频分析，主导定制模拟/射频设计。<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup> ELDO（Siemens EDA）凭借可靠性仿真和[ISO 26262](https://www.edgepedia.org/zh/iso-26262)合规性在汽车应用中表现出色。<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup> Ngspice服务于教育和原型开发。<sup>[10](https://www.mdpi.com/2079-9292/15/8/1687)</sup>

## 局限与替代方案

**规模扩展。** SPICE仿真器中的直接线性求解器随电路规模 \( n \) 的复杂度为 \( O(n^{1.3-1.8}) \)，而矩阵构建及其他牛顿循环步骤为 \( O(n) \)，但由于工业半导体模型的计算，其常数因子可达 \( 10^{3} - 10^{5} \) 量级。<sup>[8](https://link.springer.com/article/10.1186/s13362-017-0042-z)</sup> 传统SPICE方法在未知量超过数万时扩展性不佳，因为它们依赖单个大矩阵并由直接求解器处理，因此模拟运行时间随电路规模超线性增长。<sup>[9](https://www.osti.gov/servlets/purl/1592255)</sup>

**收敛失败。** 牛顿–拉夫逊迭代只有在初始猜测足够接近解时才能保证收敛。<sup>[18](https://vbn.aau.dk/ws/portalfiles/portal/489168449/pkubulus_ltspicematlab_convergence_postprint.pdf)</sup> 在瞬态仿真中，失败大多表现为时间步反复削减后出现的“时间步过小”情形，因为电容和电感矩阵元素与 \( 1/h \) 成正比，随着 \( h \) 缩小方程组变得病态；这通常表明电路或器件模型不切实际。<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup> 当器件电流在迭代之间变化足够缓慢、虽未满足基尔霍夫电流定律却能通过收敛测试时，可能出现假收敛。<sup>[18](https://vbn.aau.dk/ws/portalfiles/portal/489168449/pkubulus_ltspicematlab_convergence_postprint.pdf)</sup>

**缓解措施。** SPICE在静息电路的每个节点与地之间接入默认值为1 pS的电导GMIN，以确保牛顿–拉夫逊收敛，并反复将其减小到零以精化直流解（Gmin步进）。<sup>[5](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)</sup> 直流迭代上限ITL1默认为100次迭代；超过时，仿真器采用Gmin步进，必要时采用源步进。<sup>[19](https://www.electronicdesign.com/technologies/industrial/boards/article/21774425/taking-a-peek-under-the-hood-of-your-spice-circuit-simulation-engine)</sup> 源步进、Gmin步进和伪瞬态分析常被采用，但除了扩展性不佳的Gmin步进外，它们都不能保证得到有效的直流解。<sup>[18](https://vbn.aau.dk/ws/portalfiles/portal/489168449/pkubulus_ltspicematlab_convergence_postprint.pdf)</sup> 直流不收敛通常源于电路连接、元件数值或模型参数的错误。<sup>[4](http://bear.ces.cwru.edu/eecs_cad/man_spice2_sec1.html)</sup>

**替代方案。** 快速SPICE（Fast-SPICE）算法在大电路上可比SPICE快10–100倍，但精度差得多，且在默认设置下产生错误结果的概率很高；对于大电路和长瞬态仿真，它们是唯一可行的模拟仿真途径。<sup>[8](https://link.springer.com/article/10.1186/s13362-017-0042-z)</sup> FastSPICE通过将单个巨大的求解矩阵划分为许多较小的矩阵来加速仿真，其相对于SPICE的优化包括近似器件模型、RC网络约简、无全局收敛的事件驱动仿真、多速率仿真，以及分区/层次化矩阵。<sup>[20](https://www.mdpi.com/2674-0729/3/3/13)</sup>

## References

1. [A Short SPICE Tutorial](https://www.egr.msu.edu/classes/ece445/mason/Files/KSU_short_spice_tutorial.pdf)
2. [SPICE Differentiation (Analog Devices)](https://www.analog.com/en/resources/technical-articles/spice-differentiation.html)
3. [SPICE2: A Computer Program to Simulate Semiconductor Circuits (Nagel dissertation, 1975)](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1975/9602.html)
4. [SPICE Version 2G User's Guide (official documentation; merged with the 10 Aug 1981 guide copy at ece.umn.edu)](http://bear.ces.cwru.edu/eecs_cad/man_spice2_sec1.html)
5. [Overview of SPICE-like circuit simulation algorithms (IEE Proceedings Circuits, Devices and Systems)](https://forum.qorvo.com/uploads/short-url/7FxQ25NhphlGWXWr6dW6AT1XlW9.pdf)
6. [The Designer's Guide to SPICE and Spectre (Chapter 1, Kundert)](https://designers-guide.org/analysis/dg-spice/ch1.pdf)
7. [Ngspice User's Manual, Version 44plus](https://ymkei.org/docs/ngspice-html-manual/manual.xhtml)
8. [A holistic fast and parallel approach for accurate transient simulations of analog circuits (Journal of Mathematics in Industry)](https://link.springer.com/article/10.1186/s13362-017-0042-z)
9. [Xyce: Open Source Simulation for Large-Scale Circuits](https://www.osti.gov/servlets/purl/1592255)
10. [A Systematic Taxonomy and Comparative Analysis of Mixed-Signal Simulation Methods: From Classical SPICE to AI-Enhanced Approaches](https://www.mdpi.com/2079-9292/15/8/1687)
11. [SPICE Algorithm Overview](https://www.ecircuitcenter.com/SpiceTopics/Overview/Overview.htm)
12. [Achieving Accurate Results With a Circuit Simulator (Kundert)](https://kenkundert.com/docs/eda+t93-preso.pdf)
13. [Behind the scenes of the SPICE Circuit Simulator (lecture slides, Bar-Ilan University)](https://www.eng.biu.ac.il/temanad/files/2022/04/Lecture-3-Behind-the-scenes-of-SPICE.pdf)
14. [Brief Introduction to HSPICE Simulation](https://web.mit.edu/6.012/www/SPICEtutorial.pdf)
15. [The Origins of SPICE (Larry Nagel retrospective)](https://omega-enterprises.net/The%20Origins%20of%20SPICE.html)
16. [The Life of SPICE (Larry Nagel, IEEE SSCS presentation slides)](http://r6.ieee.org/scv-sscs/wp-content/uploads/sites/80/2018/12/The-Life-of-SPICE.pdf)
17. [Ngspice FAQ](https://github.com/imr/ngspice/blob/master/FAQ)
18. [LTspice/MATLAB convergence postprint (Aalborg Universitet)](https://vbn.aau.dk/ws/portalfiles/portal/489168449/pkubulus_ltspicematlab_convergence_postprint.pdf)
19. [Taking A Peek Under The Hood Of Your Spice Circuit-Simulation Engine (Electronic Design)](https://www.electronicdesign.com/technologies/industrial/boards/article/21774425/taking-a-peek-under-the-hood-of-your-spice-circuit-simulation-engine)
20. [A Comprehensive Analog–Mixed Signal (AMS) Simulations Environment](https://www.mdpi.com/2674-0729/3/3/13)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Semiconductor devices & fabrication › Device modeling and Technology CAD

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/spice-simulation

English original: https://www.edgepedia.org/spice-simulation
