SPICE3 Model debugging

Hi All,

I am trying to understand the spice3 programming model

I have added new parameters to existing jfet model by making changes to over 20 files. I wish to know if there are debugging functions provided inside spice3 which I can use during simulation to show these variables.

Thanks in advance Rahul

Reply to
rahul
Loading thread data ...

Spice 3 has nothing. It is the compiler that has the debugging features. This question concerns me. How can you be compiling this without understanding even the most basic feature of all compilers?

For example, in VC++ you simple right click and "add watch" to popup a display of program variables.

Kevin Aylward snipped-for-privacy@anasoft.co.uk

formatting link
SuperSpice, a very affordable Mixed-Mode Windows Simulator with Schematic Capture, Waveform Display, FFT's and Filter Design.

Reply to
Kevin Aylward

I have added my version of amorphous Si TFT model I was looking for error checking functions. I have added fprintfs for now. I was looking for something like cdump which I can type on the spice prompt.

I use linux ....

-Rahul

Kev>

Reply to
rahul

rahul is, and always will be:

I don't know any debugger for C++ on Linux. (probably, there are various debuggers... I just no know the name). If there is, use one.

Maybe GDB is what you need, but i've used it only for analyzing core dumps.

[]s
--
Chaos Master®, posting from somewhere near Porto Alegre, Brazil.
"... one either has a shit, or not. Do you have yours?"
     ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
http://marreka.blogspot.com --> news, hotter than high-power transistors!

To reply remove "DEAD-SPAM" from address.
Reply to
Chaos Master

Thanks Chaos. I will try your suggestion.

I am using vi on linux. I need a better ide and have been exploring kdevelop on the side.

-Rahul

Chaos Master wrote:

Reply to
rahul

What characteristics of JFET operation do you hope to be able to encompass that the existing model(s) don't?

--

"What is now proved was once only imagin\'d." - William Blake, 1793.
Reply to
Paul Burridge

"ddd" can be made to fire up you favorite editor and remake the program. It is a shell for "gdb". I like it based on the limitted amoung of debugging I've had to do.

I could not get the kdevelope tools to work. It seems way too complex for the job its doing.

You could run the "Borland Turbo C" under "dosemu" It had about the best IDE ever created.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

I have added atft (amorphous Si TFT transistor) model which is based on the spice3 JFET model. However the device characteristics are quite different. An amorphous-Si process has very low mobility, high leakage and high capacitance. Mostly used in LCD for driver circuits.

-Rahul

Paul Burridge wrote:

Reply to
rahul

Actually, raw Spice3/XSpice code jfets don't have the PSpice temperature dependence in them, i.e Betatce (gm) and Vtotc (Vt) temp co's. I had to add these in.

Kevin Aylward snipped-for-privacy@anasoft.co.uk

formatting link
SuperSpice, a very affordable Mixed-Mode Windows Simulator with Schematic Capture, Waveform Display, FFT's and Filter Design.

Reply to
Kevin Aylward

Thanks stuart, I am using ngspice. I generate an atft.log file and dump my results from the atftload.c. I have problems with DC convergence which is giving x440 as ckt->Mode. I was hopeing if I could actually see the G,C and w matrices (ie. Gx + Cx' = w) so that I can add some gmin resistors to gnd on the nodes to get around the singularity.

Thanks again

-Rahul

PS: ngspice is w> rahul wrote:

Reply to
rahul

rahul wrote: : Hi All,

: I am trying to understand the spice3 programming model

: I have added new parameters to existing jfet model : by making changes to over 20 files. I wish : to know if there are debugging functions provided inside : spice3 which I can use during simulation to show : these variables.

Are you using ngspice? I suggest you do so because it has an active developer community. Ngspice is basically SPICE3f5 cleaned up with all sorts of bugfixes, and ported to build under the usual GNU makefile system. The latest is available for (free, unrestricted) download at:

formatting link

If you are, I have put in a call to memcheck (currently commented out) into the ngspice.c. I have also used a DEBUG flag which -- when set -- will allow you to do things like this:

#ifdef DEBUG printf("In fcn foo, variable bar = %sn", bar); #endif

Setting DEBUG = 1 in config.h will allow you to trace the programs operation through netlist input and parsing. (I haven't done anything with analysis.) Look at the parsing functions in the frontend directory for hints.

BTW: If you're not using ngspice, then you're on your own, and will need to fix a lot of other bugs. The random SPICE3f5 code which is floating around the web is in bad shape because it's unmaintained. Ngspice is the way to go.

Stuart

Reply to
Stuart Brorson

rahul wrote: : Thanks stuart, : I am using ngspice. I generate an atft.log file and dump : my results from the atftload.c. : I have problems with DC convergence which is : giving x440 as ckt->Mode. I was hopeing if I could actually see : the G,C and w matrices (ie. Gx + Cx' = w) so that I can : add some gmin resistors to gnd on the nodes to get around the : singularity.

Sorry, I am not that familiar with the analysis part of the code. I would like to be, however. It would take time, however, to come up to speed. . . .

My suggestion: put #ifdef DEBUG directives [1] into your code along with printfs showing the matricies you want. Also, please submit those changes to Paolo (the project leader) as patches and he can incorporate them so we can all benefit!

Someday I will write a fcn called "debug_spew" for ngspice which you can pass a string and some variables and it will conditionally print out the stuff if you have defined DEBUG. Right now the code is messy with all the debug #ifdefs, along with all the other #ifdefs.

Thanks,

Stuart

[1] Actually, I may have used #ifdef TRACE (instead of DEBUG) in ngspice. Take a look at the parser stuff to see what I did and just use it.
Reply to
Stuart Brorson

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.