Author Topic: Can Ngspice simulate ICs  (Read 2341 times)

0 Members and 1 Guest are viewing this topic.

Offline help_me_pick_usernameTopic starter

  • Contributor
  • Posts: 36
  • Country: au
Can Ngspice simulate ICs
« on: February 03, 2021, 12:56:30 am »
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.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11638
  • Country: us
    • Personal site
Re: Can Ngspice simulate ICs
« Reply #1 on: February 03, 2021, 01:22:30 am »
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.
Alex
 

Offline help_me_pick_usernameTopic starter

  • Contributor
  • Posts: 36
  • Country: au
Re: Can Ngspice simulate ICs
« Reply #2 on: February 03, 2021, 04:07:18 am »
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?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11638
  • Country: us
    • Personal site
Re: Can Ngspice simulate ICs
« Reply #3 on: February 03, 2021, 04:20:28 am »
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.
Alex
 
The following users thanked this post: help_me_pick_username

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Can Ngspice simulate ICs
« Reply #4 on: February 03, 2021, 10:33:33 pm »
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.

He 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 stuff
to 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 have
proper (proprietary)  far better models..
(delay parasitics.. etc..)


Very interesting exercise..

Paul
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Can Ngspice simulate ICs
« Reply #5 on: February 03, 2021, 10:41:48 pm »
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.

Another 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
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27641
  • Country: nl
    • NCT Developments
Re: Can Ngspice simulate ICs
« Reply #6 on: February 03, 2021, 11:27:35 pm »
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?
You 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15127
  • Country: fr
Re: Can Ngspice simulate ICs
« Reply #7 on: February 04, 2021, 04:51:31 pm »
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.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Can Ngspice simulate ICs
« Reply #8 on: February 04, 2021, 05:56:35 pm »
(..)
I suggest reading Ngspice's documentation, particularly its support of Xspice and Cider. Note that LTSpice also has a mixed-signal simulation engine.

Holger 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/10

Paul
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf