Modifying Spice Source Code

Aug 22, 2006 16 Replies

Hi,



I have to modify the spice source code. To be more spcific I need to change the way in which spice computes the poles and zeros of the tansfer function of the circuit under being simulated. I have not found any material on the web regarding the organisation of the spice source code and how it is organised.



Could anybody advise me on where to start. Is there any resource availble on the inetrenet which explains what the functions of the files in the source code are? I have no familiarity with the basic code structure of spice. I have to start from scratch. I would be grateful if anybody could advise me on this issue.



Regards, Balaji.



I think you have to find a consultant.

If you insist on this foolishness, search the Berkeley library for appropriate doctoral dissertations. Maybe a search on Stanford's socrates will turn up something. Their is also google scholar.

You can *purchase* it from Berkeley.

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Is it impossible to modify the spice source code. I have to use a new algorithm to speed up spice execution time. This is a part of my masters thesis. Could you please be more specific why you said that it would be foolishness. I have almost 6 months to work on this.

Regards, Balaji

snipped-for-privacy@sushi.com wrote:

In message , dated Tue, 22 Aug 2006, snipped-for-privacy@gmail.com writes

Now you have explained a bit more, we can help. It appeared that you might have been an inexperienced hacker, with no idea of the magnitude of the task you were attempting.

Since you are in academia, you should definitely approach the relevant people at Berkeley, who will no doubt provide all the support you require.

OOO - Own Opinions Only. Try www.jmwa.demon.co.uk and www.isce.org.uk 2006 is YMMVI- Your mileage may vary immensely. John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK

Hi,

First take a look at the following sites:

formatting link

formatting link

formatting link

Then maybe you could read Al Davis dissertation at

formatting link

Sven Wilhelmsson http://home.swipnet.se/swi

...Jim Thompson

Used to. It's free now. Here's the software license:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RESEARCH SOFTWARE LICENSE AGREEMENT (revised October 1994)

This agreement was originally found at

formatting link

It is no longer necessary to sign the agreement.

Software that was originally distributed by the Industrial Liason Project is covered by this agreement. Those packages include Spice and Magic. (7/01)

formatting link

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The source for spice3f5.tar.gz and other versions are available at

formatting link

The ILP Description includes a more complete description of the package.

Please ignore the prices and email addresses, this file is made available for historical reasons only.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Looks like fun. It might take a while to go through 6 megabytes of code. I understand there are some bugs. Regards,

Mike Monett

Antiviral, Antibacterial Silver Solution:

formatting link
SPICE Analysis of Crystal Oscillators:
formatting link
Noise-Rejecting Wideband Sampler:
formatting link

No; many people do.

Do you have to support fancy non-linear devices? (E.g., BSIM3 models?) If not, it's probably faster to just write your own SPICE simulator supporting R, L, C, and low-end (e.g., Ebers-Moll) transistors, diodes, etc. than to try to modify the "real SPICE." If such a simulator is sufficient to demonstrate your reduction in execution time, it's the route I'd take.

What kind of analysis are you trying to speed up? I'd perform a thorough literature search before you embark on your quest, since unfortunately many professors are rather out of touch with what's already been done in the area of circuit simulation (it's a very mature topic) and it's often easy for them to suggest you go and spend six months doing something that has been done many times before. (For instance, you'll find that many commercial simulators already incorporate numerous improvements to SPICE that make it markedly faster than the Berkeley version.)

---Joel

I run ngspice. BTW, you don't need to purchase the source code as it is supplied in source. It really kicks ass under 64 bit linux (suse), probably due to the double precision now fitting in one word.

Your explanation of the task is so vague that it is hard to tell what you are doing. This doesn't give me the warm and fuzzies. Nothing personal here.

skrev i en meddelelse news: snipped-for-privacy@74g2000cwt.googlegroups.com...

SPICE is old numeric code. It is likely bummed into peak performance over many years and one suspects that it is brittle and relies on very specific compile options and tools - maybe some of it is hand-tuned fortran-to-c (f2c) (gackkk). It might be much harder than you seem to think. Or not!

SPICE 3 is written in C (a complete re-write, rather than a conversion of the Fortran source for SPICE 2).

David, VA3DKS

Frithiof Andreas Jensen wrote:

That is correct. But all I've ever dared twiddle with was the device code for the BJT, in the late '80's. The emitter current crowding and capacitance were not correct back then, and I had a GenRad software gal patch it for me.

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Actually SPICE 3 series is a complete rewrite from scratch in C.

JosephKK Gegen dummheit kampfen die Gotter Selbst, vergebens.   --Schiller

Absolutely.

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

In article , joseph2k wrote: [....]

Yes, complete with the dereferencing of uninitialized pointers. For certain syntax errors, it did a seg-fault. Somewhere out there you may even find "kensmith" if you grep through the source code of a spice version. I spent several days feeding it mistakes and tracking down the bad dereferences.

-- kensmith@rahul.net forging knowledge

And for your work improving spice we thank you.

JosephKK Gegen dummheit kampfen die Gotter Selbst, vergebens.   --Schiller

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required