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