2003-07-08 Stefan Jones * quote.c: return the pointer to the start of malloced memory so it can be freeded 2003-05-02 Stuart Brorson * Major changes in subckt.c to handle POLY attributes in dependent sources. Added new case to switch in "translate" to handle E, F, G, H sources. Many other fixes. * Moved location of call to ENHtranslate_poly in inp.c. This was necessary to correctly process POLY attributes and the associated netlists and voltage sources. 2003-04-10 Stuart Brorson * modified inp_readall (inpcom.c) to ignore blank lines terminated by \r\n *and * \n. This fixes problems associated with importing files from Windozeland. * Added explanatory comments to many modules. 2002-01-03 Paolo Nenzi * wdisp: added an entire directory containing windows frontend code (Holger Vogt patch). Files in wdsip: ftegraf.h, makedefs, Makefile.am, windisp.c and winprint.c. * Makefile.am: Windows code compilation rules added to makefile. * display.c, outitf.c, rawfile.c, resource.c, runcoms.c: added defines for Windows (Holger Vogt patch). 2001-12-14 Paolo Nenzi * control.c, control.h, com_cdump.c, com_cdump.h, variable.c, variable.h: Patched the code with the one contributed by Charles Williams. The patches addresses some memory leaks. 2001-11-25 Emmanuel Rouat * circuits.h: transfered definition of structure 'circ' to ftedefs.h 2001-02-07 Paolo Nenzi * outitf.c: From a message Alan sento to the mailing list: ---------- Forwarded message ---------- Date: Tue, 6 Feb 2001 11:11:56 -0000 From: "Gillespie, Alan" Reply-To: ng-spice-devel@ieee.ing.uniroma1.it To: "Ng-Spice-Devel (E-mail)" Subject: [ng-spice-devel] Reference variable update in interactive mode I've tweaked outitf.c so that the reference variable value is updated to the screen in interactive mode. I forgot to save the old version first, though, so I couldn't do a diff, so I'm just attaching the whole new outitf.c file. Also, I've updated the documentation as follows :- Modifications to "outitf.c" --------------------------- A number of modifications have been applied to outitf.c in order to achieve the following "improvements" :- 1) Spice3, by default, saved all node voltages, including nodes internal to the devices. These extra nodes add dramatically to the amount of data saved, but don't add significantly to the useful information about the circuit. So, instead of saving these nodes, a "hack" has been introduced which checks a new spice option, and either discards the internal node, or saves some device currents instead. 2) During long simulations, spice would sit "staring back blankly", giving no clue as to how well the simulation was, or wasn't, proceeding. In order to give a little more feedback, another "hack", in the data writing routine, writes the value of the reference variable to the error stream, which is usually the screen. In order to minimize the CPU time "wasted" doing this, the routine will only reprint the value if more than a quarter of a second since the last screen update. The result is that this feedback adds no significant extra time to performance of the simulation. 3) The original file writing routines used to write each data value to the file individually. A buffering scheme was added, which collects each row of data in a buffer, and the writes the whole buffer in one call. This gave a significant performance improvement (up to 20%) on HPUX, with all currents saved in large circuits, although there was no significant difference on Windows 95. The improvement has not been measured on Linux. 4) A check was added to make sure the file write was successful. Spice3 could easily fill the hard disk, but would continue to churn away, producing no more useful data. Now it will exit gracefully. I can't remember why I thought this was important, but at least it means that a PC with power management will be able to power down after a long overnight simulation has ceased to produce any more useful data. Changes ------- The routine beginPlot is called at the beginning of the simulation to select which nodes and variables will be saved. The first modification is at the point where it checks the "save" list. This is the list of tokens attached to the .save lines read from the spice source file. The routine now checks for "allv" and "alli" as well as "all". "allv" is treated as a synonym for "all". If "all" or "allv" is found, then a saveall flag is set, and if "alli" is found then a new savealli flag is set. Next, the addDataDesc routine is called for every variable to be saved. This is done by stepping through an array called dataNames[]. I'm not quite sure where this array comes from, but it was quite easy to add an if statement to stop it calling addDataDesc if dataNames[i] points to a string containing any of the following - #internal #source #drain #collector #emitter #base That seems to catch all the internal device nodes. The next addition is a new pass through the dataNames[] array specifically looking for those strings. (This pass is only performed if the savealli flag has been set). When one of the strings is found, a bunch of if-then-else statements creates a corresponding string which is submitted to the add addSpecialDesc routine. This saves the relevant device current. Note that since mosfets have only two internal nodes, but four terminal currents, and bipolars have three internal nodes and four terminal currents, some internal nodes have to save more than one terminal current. This last change is a clumsy hack, and only works if the devices in question actually have internal nodes. Resistors and capacitors, for instance, never have internal nodes, and so their terminal currents will not cannot be saved with the .save alli card. Also, any bipolar, mosfet or diodes with zero valued parasitic resistances (rd, rs, rc, rb, re) will not be allocated internal nodes, and so their terminal currents will not be saved by this hack, either. Further down outitf.c, the OUTpData routine is called whenever a new row of data is ready to be written to file. Near the top of this, the reference variable is written to file separately from the rest of the variables. This is a convenient point for a couple of statements which check the elapsed time since the last update, and write the reference value to stderr if it's time. Slightly further down the routine is the section for writing data to a "plot", i.e. retaining it in memory. A similar statement or two writes the reference value to the screen for this case, i.e. interactive mode. At the end of the OUTpData routine, a new check has been added to see if there was an error writing to the rawfile. If so, the shouldstop flag is set to TRUE, and the simulation will abort. Scanning down outitf.c, the next modification is in the fileInit routine. The first statement initialises the lastclock variable. This is used later when deciding if it's time to write the reference value to the screen. Next, the fileInit_pass2 routine writes the name strings to the start of the rawfile. At the end of this routine there is now a statement which checks if this will be a binary rawfile, and if so, it allocates a row buffer of the correct length. The fileStartPoint routine seems to be called before each row of data is written, and so this is a convenient point to reset the buffer pointer to zero. The fileAddRealValue and fileAddComplexValue routines now simply write the relevant values to the buffer, and increment the buffer pointer. Previously they called the fwrite library routine to actually write the data. If the rawfile is not a binary one, however, they just write the text as before. The fileEndPoint routine was previously empty. Now it actually calls fwrite to write the whole buffer to the file (if it's a binary file). Finally the fileEnd routine prints the total number of data points to the screen, and de-allocates the row buffer (if it was a binary rawfile). Congratulations to whoever put these dummy routines in in the first place, since that allowed the buffering to be added very easily. 2001-01-23 Paolo Nenzi * subckt.c: added some code (very, very experimental) to support mos devices with variable number of nodes (5 to 7) in subcircuit expansion. This hack is necessary since SOI devices can have up to 7 nodes. 2000-11-07 Arno W. Peters * com_history, com_alias, parser/cshpar.c, parser/complete.c: Applied patch by Michael Widlok. It fixes command completion and history list. In the process, Michael also fixed a memory leak. 2000-09-09 Arno W. Peters * commands.c: Use fourier.h. * dotcards.c: Update to prevent segfault. * fourier.c, fourier.h: com_fourier is now calling fourier(), a function with more parameters. * dotcards.c: Added assertions to guard a double indirection, now ngspice will bomb out on an assertion instead of a segfault. 2000-07-18 Arno W. Peters * com_ahelp.c, com_help.c, com_plot.c, com_set.c, com_unset.c: Updated header file includes. * quote.c: Code formatting changes. 2000-07-16 Arno W. Peters * com_set.h: New header file. * com_state.c, com_state.h: Separated from debugcom.c. * com_dump.c, com_dump.h: Separated from debugcom.c. * debugcom.c, debugcom.h: Removed. * Makefile.am: Updates for added/removed files. 2000-03-22 Paolo Nenzi * rawfile.c: Applied Michael Widlok patch. * spiceif.c: Applied Michael Widlok patch. 2000-03-12 Paolo Nenzi * x11.c: Cleared the code. Rewmoved some empty return on void functions. 1999-12-20 Paolo Nenzi * outif.c: To fix various "save"-related segmentation faults, make this one-line patch to outitf.c: line 356, change unique = devname; to unique = copy(devname); 1999-12-20 Paolo Nenzi * subckt.c: Bug: Current controlled switch subcircuit does not expand the controlling source correctly: vsrc expands to name:vsrc, not to v:name:src. Fix: changed this file to indicate that w device has only 2 not 3 nodes and 1 not zero controlling sources. 1999-09-07 Emmanuel Rouat * *.c: put back static functions declarations back in the .c files (shouldn't be in .h files!) 1999-09-07 Arno * aspice.c: template to fprintf now conform to argument types. * cmath1.c: * cmath2.c: removed most warnings about possible use of uninitialized variables. Only two remain in cx_sqrt(). 1999-09-06 Arno Peters * dotcards.c: Put proper braces around an ambiguous if/else construct. * postcoms.c: * postsc.c: Removed unused variables. 1999-09-04 Emmanuel Rouat * Makefile.am (libfte_a_SOURCES): forgot display.h in list * typesdef.c: moved types.c to typesdef.c * signal_handler.c: moved signal.c to signal_handler.c * *.c: added header file for all .c files 1999-09-01 Emmanuel Rouat * *.c: removed lots of unnecessary HAS_XX tests and code * Makefile.am (libfte_a_SOURCES): removed mfb.c from sources * signal.c (ft_sigintr): removed HAS_MFB test 1999-08-30 Paolo Nenzi * Removed #include "suffix.h" and replaced GENERIC with void. 1999-08-28 Emmanuel Rouat * Makefile.am (libfte_a_SOURCES): removed x10.c from source files * clip.c: removed MAX/MIN #defines * Removed all #includes of misc.h and util.h (now in spice.h) 1999-08-19 Paolo Nenzi * Makefile.am: added spec.c. * spcmdtab.c: added code for spec command support. The original patch came from ftp.mpce.mq.edu.au. * spec.c: added this file containing the spec command code. 1999-08-08 Emmanuel Rouat * Makefile.am (DEFS): removed -DWANT_MFB (don't need it) * resource.c : removed HAS_RLIMIT_ tests * error.c: removed HAS_VAXFPERROR code * cmath3.c: removed HAS_SHORTMACRO code * display.c : removed HAS_X10 code * mfb.c (Mfb_Init): removed HAS_PCTERM code * resource.c: removed all code related to HAS_MEMAVL 1999-08-06 Emmanuel Rouat * resource.c: removed tests on HAS_UNIX_SEGMENT_HACK * xgraph.c (ft_xgraph), options.c (cp_usrset), misccoms.c: removed tests on HAS_SYSTEM * nutinp.c, inp.c (com_source, doedit): removed tests on HAS_SYSTEM (always true?) * doplot.c (com_hardcopy): removed tests on HAS_UNLINK (always true), removed tests on HAS_SYSTEM (always true?) * signal.c: * evaluate.c (doop): * error.c (fatal): * aspice.c: removed test on HAS_UNIX_SIGS (always true) * signal.c: * evaluate.c: removed test on HAS_LONGJUMP (always true) 1999-08-04 Emmanuel Rouat * aspice.c: changed HAS_WAIT into HAVE_SYS_WAIT_H * inpcom.c, breakp.c: changed HAS_CTYPE into HAVE_CTYPE_H 1999-08-03 Emmanuel Rouat * signal.c, resource.c, evaluate.c, aspice.c: changed SIGNAL_TYPE into RETSIGTYPE 1999-07-31 Emmanuel Rouat * Makefile.am: added @X_CFLAGS@ (X11 header files) to INCLUDES and removed unused LIBS list. 28-07-1999 emmanuel.rouat@wanadoo.fr (Manu Rouat) * graf.c, display.c, doplot.c, x11.c: changed HAS_X11 define to X_DISPLAY_MISSING, which is supplied by autoconf in config.h * Makefile.am: removed -DWANT_X11