36

I've recently realized that I can't do everything easily in ngspice, mainly because analysis has to be performed through the interpreter. I'm considering switching to a new SPICE simulator.

I'd like a list the advantages and disadvantages of the following SPICE simulators as well as experiences with the various simulators:

HSPICE
LTspice
ngspice
PSpice

I'm well aware HSPICE is an expensive proprietary simulator, but I am able to get access to it, problem is I'd have to access it on a sever via SSH.

LTspice is already free, but not installed on my Windows 7 machine.

Already using ngspice in Fedora Linux.

PSpice available to me on my university's computers. I refuse to install it on my own computer, because it messes with the registry a bit too much.

sj755
  • 889
  • 3
  • 11
  • 18

7 Answers7

29

My short answer is to just go with LTSpice, it is one of the best simulators on the market and it is free. You can't really beat that. But if you would like a breakdown feel free to read my personal opinions.

HSPICE:

  • Advantages: HSPICE is widely considered one of the most accurate simulators on the market. However I have no actual experience using it.
  • Disadvantages: As you said, it is expensive, proprietary, and as far as I know has no schematic capture features.
  • Overall: If you REQUIRE reliable results (Military or high end industrial) then HSPICE is the way to go. Otherwise, I would avoid it.

LTSpice:

  • Advantages: If you are doing power electronics this simulator is tuned for simulating switching events, as well as some other things which make it perfect for this field. Additionally, it has (IMO) an intuitive interface and doesn't try to hide the netlist from you. Plus, it is FREE.
  • Disadvantages: ? I haven't been made aware of any, it isn't considered quite as accurate as HSPICE, but it isn't inaccurate by any means.
  • Overall: This is the simulator I would suggest. It is easy to use, it is free, and it is supported by a much larger company. (Linear Technology)

ngspice:

  • Overall: I don't know enough about ngspice to give a full overview. I only recently downloaded it and am still working on compiling it for my system. Obviously you have found one of the drawbacks is being limited to the command line.

PSPICE:

  • Advantages: Well this is as close as you can get to the original SPICE. PSPICE is powerful, has a well established simulator, built in results viewer, and an extensive model library.
  • Disadvantages: Unfortunately it has become so bloated in recent years that it is difficult to recommend. And as you would probably like to have it on your computer, I would bet this one is out of your price range unless you have $20,000 laying around.
  • Overall: Powerful and well established, but going downhill fast. Expensive.
dim
  • 15,845
  • 3
  • 39
  • 84
Michael Leonard
  • 520
  • 4
  • 10
  • 2
    Note that Ngspice is incorporated into the free and open source KiCad 5 now. See here: http://ngspice.sourceforge.net/ngspice-eeschema.html. – Gabriel Staples Nov 19 '18 at 19:53
  • For anyone on Linux, LTspice installs great so far using PlayOnLinux (which relies on Wine). By opening PlayOnLinux in Linux and using it to do the install, you can install the LTSpice .exe file through a series of very intuitive GUI prompts, even making a desktop shortcut in the end. This makes installing Windows programs in Linux super easy. Install playonlinux in Ubuntu with `sudo apt install playonlinux`. See (https://askubuntu.com/questions/233782/how-does-one-install-playonlinux) and (https://help.ubuntu.com/community/PlayOnLinux). – Gabriel Staples Nov 19 '18 at 20:09
20

I would say that depends heavily on what you need it for. Often the expensive spices are part of some e.g PCB design tool. I'm just trying out MultiSIm from NI (expensive orcad type tool), and it has lots of pretty virtual instruments (e.g scope, distortion analyser, etc) and monte carlo analysis (which LTspice does not have a "convenient" version of - it does have some functions you can use though as Vlad points out, here is a link on using them) but to be honest I find that 99% of things I could do on LTspice.
I find the LTspice setup is by far the quickest out of any spice I have tried, once you get used to the key commands. R for resistor, D for diode, is much easier than clicking the picture (or even selecting from a pop up box in MultiSims case, arghh) and dragging to the right place every time.
You can have a circuit done in seconds this way.

The manual is not as pretty either, but all the info you need is there regarding how to use, eg. the .param, .step and .measure commands for doing things like running an analysis many times and varying parameters. I just tried to run a transfer function analysis in MultiSim in this manner (i.e. run may times and vary a parameter then plot results) but despite reading/wrestling for hours with it, I couldn't manage it, but a quick addition of .step V2 -15 15 1 to the sheet made it possible in LTspice.
I'm sure some of the above is simply as I'm new to MultiSim, and no doubt I am missing something (as the above example simply must be possible in a tool like that) and no I don't work for LT :-) but it has been the only spice that I have used regularly for the last few years. The main point is that it will do all the normal stuff as good (and probably faster) than the expensive tools, but if you need the extras (e.g. monte carle, PCB level anaysis based on actual routing/IBIS models - Altium does this excellently) and all wrapped up in one design tool then you may need more than if can offer.
In my view it can't hurt much to have around even if you do need a more powerful tool anyway.

Oli Glaser
  • 54,990
  • 3
  • 76
  • 147
  • 6
    LTspice does have Monte-Carlo and Worst-case analysis, but, true, it's not something that can be readily found. Here's a link with more details, it covers up more than I could in this comment: http://k6jca.blogspot.ro/2012/07/monte-carlo-and-worst-case-circuit.html . @sj755: For my part, I'd recommend LTspice for it's speed and malleability. If, however, you want prettyness, LTspice is not the tool. – Vlad Oct 11 '12 at 08:48
  • 1
    @Vlad - thanks, I actually know about the functions (I use them myself) so I should have mentioned them (will add the link now). I guess the point is more that they are not as convenient as other simulators to use. Having said that, LTSpice is by far my favourite simulator, once you get to know it properly it's very powerful, and you can do things very quickly and easily. – Oli Glaser Oct 11 '12 at 15:47
  • 2
    My comment was supposed to add up to your response, but sometimes I can be quite spartan, I still don't know whether I should feel prowd or not :) – Vlad Oct 12 '12 at 10:36
  • 2
    @Vlad - It's definitely good you pointed this out, as it is an important bit of info, and silly of me to have missed it out in the first place. – Oli Glaser Oct 12 '12 at 10:59
11

I don't have experience with HSPICE, but use LTspice and NGSPICE very frequently. In my field (power electronics), I have observed fellow engineers actively refuse to work with the company-supplied Pspice after being exposed to LTspice.

Unfortunately, LTspice is closed source, has no scripting possibility, and you can't add (your own) code models to it. When you need these more advanced options (not many people do or care) NGSPICE is the way to go. It's open source, incorporates XSPICE, KLU, open-mp and CUA, and has a C-shell type interpreter with very advanced possibilities (but IMHO a horrible user interface). It does not have schematic entry but there are solutions for that (e.g. LTspice). NGSPICE can be used with gnuplot for very nice, programmable, graphical output.

Marcel Hendrix
  • 176
  • 1
  • 6
  • 1
    Note that the free and open source PCB design tool, KiCad 5, now incorporates NgSpice under the hood too. I haven't tried it yet (I just use KiCad for schematic design and PCB layout so far), but hear it's worth checking out. KiCad Ngspice turorial and getting started: http://ngspice.sourceforge.net/ngspice-eeschema.html. – Gabriel Staples Nov 19 '18 at 19:52
2

I recently fought with the same battle as you trying to get a decent spice package and being on a Linux machine definitely does not help matters.

I used NI Multisim in school and its a fantastic interactive SPICE package. I love the fact you can watch a virtual scope and turn pot's to see real responses. The downside with it is I found it to be less than accurate when dealing with small signals and waveform performance in general. I still use it when coming up with circuit ideas until I have a pretty good idea of the design then I move to a better package for fine tuning things.

The best package I have used for hardcore SPICE has been SIMetrix. They have a free version that works on Linux too. Its the most accurate package I have used so far and has all the complicated options that require reading the manual quite a few times over to understand.

Here are examples of how I use both packages. In Multisim, I was making a transistor tester and needed to create a square wave with 0deg, 120deg, 240deg output via a schmitt hex buffer. Multisim did a swell job and visually lit up LED's like it would in real life when a transistor was put in the circuit. I used SIMetrix when I was making an amp for sound system that required a noise floor of >100dB.

Kevin Vermeer
  • 19,989
  • 8
  • 57
  • 102
uMinded
  • 427
  • 3
  • 10
1

As an addition to the previous answers, LTspice is a great freeware with limited possibilities on the digital parts: ibis models are not considered at the exception if you own/develop/find a software.

ngspice handles ibis file as well as mixed mode simulation (Verilog-AMS + Spice) if you install ADMSXml components. Unfortunately, this extension is tough to install and use (create a component/compile it/refresh/use it).

Pspice as a daughter of Cadence is very powerful and well known. Nevertheless, the free version allows a limited number of component, and quite slow in everyday use.

XSpice is ngspice like with multi threaded and shared processes possibilities to speed up simulations.

Then you can also use TINA from Texas Instrument which is free and allows as LTspice a bit of extra digital and ibis model. As a designer you should oftenly pay attention to the noise of your circuit and sadly only commercial one support well the noise consideration (Cadence, HSpice, UltraSim, ... and Xspice).

Ludwig CRON
  • 106
  • 3
1

Ngspice is not limited to the command line. One may include a scripting block in the netlist which is quite powerful.

Clyde
  • 11
  • 1
0

The Ltspice display is inferior to orcad. The parameter steps are hard to distinguish from different voltages.

On the good side, the hierarchy navigation is straightforward. LTspice uses an old system, which is easy to understand and gives you fairly good flexibility. Making a part from a schematic is very quick in LT spice.

Bryan
  • 1
  • "The parameter steps are hard to distinguish from different voltages." They fixed that in LTspiceXVII, you can now see what color corresponds to what step. Unfortunately, in the process they messed up some things that didn't need fixing. – Marcel Hendrix May 14 '21 at 16:06