Can Ngspice simulate ICs - Page 1
Forum section: electronics / general

author: help_me_pick_username
author_rank: Contributor
timestamp: February 03, 2021, 12:56:30 am
content: Quick question, can Ngspice simulate Integrated circuits? If so, how simple/complex of ICs can be simulated? I wasn't able to find this info on google.

author: ataradov
author_rank: Super Contributor
timestamp: February 03, 2021, 01:22:30 am
content: It can simulate anything you can assemble from resistors, capacitors, inductors, transistors, diodes, voltage and current sources.This includes integrated circuits. But the quality of simulation would depend on the quality of your model, of course.And at some level of complexity simulation would take a lot of time, so simulating complex devices, like MCUs is not practical.

author: help_me_pick_username
author_rank: Contributor
timestamp: February 03, 2021, 04:07:18 am
content: Thanks for the info! Does the software come with any included ICs at all? Or are the configurations (the list of components that make up the IC) on common ICs available on the internet?

author: ataradov
author_rank: Super Contributor
timestamp: February 03, 2021, 04:20:28 am
content: There is a limited library of digital circuits in the examples (74hcng.lib). But it is far from complete.It is not really the point of SPICE to simulate compete logic circuits. It is more for simulating subtle interactions between the components. If you are just simulating digital circuit, where you don't care about analog behaviour of the signals, then use HDLs, like Verilog.The models you will find on the internet will have various levels of accuracy. Often IC vendors provide SPICE models for their ICs.

author: PKTKS
author_rank: Super Contributor
timestamp: February 03, 2021, 10:33:33 pm
content: Quote from: ataradov on February 03, 2021, 01:22:30 amHe is absolute right...There is no need to re-invent the wheel...But all IC models are proprietary and require some sort of spice extension..Nevertheless YOU CAN AND SHOULD craft some basic stuffto see how damn powerful that is..Here my simple LOGIC GATES implemented in NGSPICE..using KiCAD as front end they were included in my private libs..So I have simple FLIP-FLOP.s... counters... etc..They work.. although the manufact. already haveproper (proprietary) far better models..(delay parasitics.. etc..)Very interesting exercise..Paul

author: PKTKS
author_rank: Super Contributor
timestamp: February 03, 2021, 10:41:48 pm
content: Quote from: help_me_pick_username on February 03, 2021, 12:56:30 amAnother interesting example...A Type3 compensation network implemented using a typical die-hard 741..In KiCAD simulated via NGSPICE.. PSPICE MODEL of 741 is widely available..You can obviously attach the network at will..Paul

author: nctnico
author_rank: Super Contributor
timestamp: February 03, 2021, 11:27:35 pm
content: Quote from: help_me_pick_username on February 03, 2021, 04:07:18 amYou can often find PSpice models for analog chips. I don't know if ngspice can use these. Be aware though that most of these models are behavioural models and not actual implementations (the latter would take too long to simulate). And simulators can be optimised as well.Simulators geared towards digital IC design for example can be told to just simulate the logic and skip the analog behaviours. Once the logic behaviour is OK, you move on to the analog behaviours. LTSpice is again a different optimisation; more geared towards simulating circuits with switching power supply chips.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 04, 2021, 04:51:31 pm
content: Spice was absolutely designed to simulate integrated circuits. This was even its whole initial purpose. SPICE = "Simulation Program with Integrated Circuit Emphasis".DIfferent Spice-based simulators have different performances. Some high-end commercial ones, highly parallel, are pretty fast and can be used reasonably to simulate relatively complex circuits.NGspice is rather good, but not the fastest out there. It can certainly be used to simulate large designs. It may take time.Regarding purely digital circuits, you need to know that most Spice-based simulators these days, including Ngspice, support mixed-signal simulation. So, unless you have very specific reasons for simulating digital circuits down to the transistor level, you can simulate the digital parts of a circuit purely with digital simulation, which interfaces seemlessly with the analog simulation and is MUCH faster.I suggest reading Ngspice's documentation, particularly its support of Xspice and Cider. Note that LTSpice also has a mixed-signal simulation engine.

author: PKTKS
author_rank: Super Contributor
timestamp: February 04, 2021, 05:56:35 pm
content: Quote from: SiliconWizard on February 04, 2021, 04:51:31 pmHolger and folks at ngspice added some very cool XSPICE state machine support...already working.https://forum.kicad.info/t/is-binary-counter-spice-model-available/23777/10Paul