SPICE 2 POLY CODEMODEL

WARNING!

The text in this document has been prepared in 2003 and is outdated. It is
provided here only for reference and may provide some (historical)
information.

SPICE2 POLY attributes are now available for controlled sources.  To
use POLY attributes, configure tclspice/ngspice with the
--enable-xspice flag set as described above.  After compilation of
ngspice, cd into $(top_srcdir)/src/xspice/icm and read the README file
there for instructions about how to get POLY support.  (Hint: you have
to download some stuff from http://www.fe.uni-lj.si/ and edit the
Makefiles before you can do "make && make install" of the codemodel
stuff.)

-- SDB 6.22.2003.

--------------------------------------------------------------------
COMPILING XSPICE CHANGES

The dependencies in the Makefile don't seem to work when you are
compiling changes in the xspice stuff.  Obviously, the best thing to
do is fix Makefile.am, but since I am not an expert at this, I have
been using the following workaround when making:

touch src/main.c && make && make install

I recommend you also do this if you hack anything under src/xspice.

-- SDB 6.19.2003.

---------------------------------------------------------------------
DEBUGGING SPICE

To avoid a segmentation fault in the initial run, use the following
command in gdb:

        setenv SPICE_NO_DATASEG_CHECK "1"

Or, the comparable command in your shell before running gdb.  This
disable accurate tracking of how much memory is used.

----------------------------------------------------------------------
USING A GARBAGE COLLECTOR

Get the Boehm-Weiser conservative garbage collector at the following
address:

 http://www.hpl.hp.com/personal/Hans_Boehm/gc/

Compile it with 'make liblinuxgc.so' and install libgc.so and gc.h
where the compiler can find them (i.e., /usr/local/lib and
/usr/local/include).  Run configure and compile.


----------------------------------------------------------------------
CREATING PATCHES

If you don't have access to anonymous CVS:

  # extract the differences
  $ diff -ruN ng-spice-rework-x ng-spice > my.patch

where ng-spice-rework-x is the snapshot you used to base your changes
on.

If you do have access to anonymous CVS:

  $ cvs diff -u > my.patch

Note: this only works if you haven't added any files.  Otherwise, the
first method is better.

Now, send your patch to ng-spice mailing list.


----------------------------------------------------------------------
INCORPORATING PATCHES

  # apply the patch
  $ patch -p1 < my.patch

  # update the automatically generated files
  $ sh autogen.sh

----------------------------------------------------------------------
INCOMPATIBILITIES BETWEEN SPICE3 AND SPICE2

The output format of spice3 is slightly different for .print and .plot
lines.  Most notably, different traces on plots are not scaled
independently.  This is most noticeable on phase/magnitude plots from
an AC analysis (also, phase is displayed in radians).  Finally,
frequency for ".PRINT AC" lines is displayed as a complex quantity
with an all-zero imaginary component.

For input, "POLY( )" sources are not supported (the non-linear
dependent source provides a more general replacement).  Also, the
".ALTER" line is not supported.  The Spice3 parser may be slightly
different on subtle points of reading input (lines need not start at
column 1 for instance).

