Developing a Circuit Simulator from Scratch

I don't agree with you, Kevin... the course I took teaches, I dunno, 40 or so students how to write a SPICE simulator every other year by having the students write their own (and I'm sure there are other such courses around the country), and I think the average student coming out of that 12-week course ends up with a much better understanding of how a SPICE simulator works than someone who just spent 12 weeks examining the source code for SPICE 3f5, reading Nagels' thesis, etc.

Define "useful?" Our final projects were to implement some "interesting" extension to SPICE, and some of the students chose challenging projects, such as harmonic balance simulation, "shooting method" simulations, etc. Yes, obviously the results weren't anything you could start selling commercially, but in the span of 12 weeks going from knowing nothing about SPICE engines to being on the verge of being able to write a research paper on some improved method of simulation that could be implemented commercially or in an open-source program is pretty impressive, in my book.

Keep in mind that our SPICEs were not very big -- maybe a few thousand lines at most; I expect commercial SPICEs are tens or hundreds of times larger for the "core."

Oh yeah, absolutely. I'm suggesting that, just as many people are made to design their own op-amps in their EE courses (I took another 12 week course which was largely about building op-amps, starting from very simple-minded approaches and ending up with fancy fully-differntial folded-cascode topologies with specifications that, while not the fastest/lowest power/best in any particular leading-edge spec, were just as good as many "jellybean" commercial offerings), designing your own SPICE based on the traditional methods is a useful exercise.

---Joel

Reply to
Joel Kolstad
Loading thread data ...

I went through the exercise of modifying a public domain simulator some years ago. It took about 5 years of spare time to get 5000 lines added to a 20000 line program (this was in turbo pascal,) my additions work but this had simple linear s-parameter internals. (Algorithmically very fast, unlike SPICE.) Doing the same thing in C++ would be a very difficult exercise. Their is the ASME (American Society of Mechanical Engineers) Website

formatting link

which has source and executables of various SPICE versions and other simpler simulators.

Next question is what are you hoping to achieve? SPICE is a kludge of translated C from fortran which is pretty much unreadable by humans. Goodluck?

Andrew

Reply to
Andrew Tweddle

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.