ngspice/src/xspice
dwarning b051567069 no c++ comments 2007-11-14 20:30:37 +00:00
..
cm Fixed bug in memory management when xspice codemodels are used. 2005-08-04 08:23:32 +00:00
cmpp Check for flex and yacc moved out of XSPICE for making distributions (Stuart Brorson) 2005-08-27 20:45:20 +00:00
enh Added .cvsignore files 2005-05-10 21:49:35 +00:00
evt Added .cvsignore files 2005-05-10 21:49:35 +00:00
examples First batch of added file. 2003-07-23 19:59:53 +00:00
icm allow different mingw versions 2007-11-14 15:08:19 +00:00
idn Added .cvsignore files 2005-05-10 21:49:35 +00:00
ipc Changes supplied bt Hitoshi Tanaka to allow XSpice to compile using MinGW in Windows. 2005-06-16 00:28:16 +00:00
mif no c++ comments 2007-11-14 20:30:37 +00:00
.cvsignore Added .cvsignore files 2005-05-10 21:49:35 +00:00
Makefile.am Trimmed Makefiles.am for "make dist" and added tests placeholders. 2004-02-14 19:19:23 +00:00
README Codemodel support update. 2004-01-10 17:01:39 +00:00
xspice.c Fixed bug in memory management when xspice codemodels are used. 2005-08-04 08:23:32 +00:00

README

Spice Opus / XSpice code model support.
--------------------------------------

Use configure the flag --enable-xspice to compile xspice support in,
when you run the ./configure script.
This creates a new command, "codemodel", which you can 
use to load a codemodel. 

The command codemodel attempts to load all the codemodels specified in the
arguments, eg 
"ngspice 1 ->codemodel /usr/lib/spice/analog.cm /usr/lib/spice/spice2poly.cm"

( note: the codemodel path must begin with ./ or / to work )

The codemodels are automatically compiled and then installed in
${prefix}/lib/spice/ when spice is installed.

To create your own codemodels:

* Unpack the tclspice source and compile as normal.

* cd src/xspice/icm

* make the directory structure for the new library:
 Create the nested library_name and module_name directories and copy the
 source code to the module_name directories

        src/xspice/icm/ <library_name> /
                modpath.lst udnpath.lst
                <module_name> / 
                        files:
                         cfunc.mod  ifspec.ifs ( for a device )
                         or
                         udnfunc.c ( or a user defined node )

* For each library create the files modpath.lst and udnpath.lst, which 
  contain a list of the user devices and nodes respectivily, in the location
  shown above.

* Edit src/xspice/icm/makedefs.in and alter the CMDIRS line to include
  your library directory.

* Run make in the src/xspice/icm directory. ( the makefile does the rest )

The codemodel can be then found in 
  src/xspice/icm/<library_name>/<library_name>.cm

Stefan Jones 
	20020219
        Edited 20030831

-----------------------------------------
SPICE2 POLY codemodel support.

SPICE2 POLY attributes are now available for controlled sources.  

To use POLY attributes, configure and install ( make install-tcl ) 
tclspice/ngspice with the --enable-xspice flag set as described above.  

After compilation of ngspice edit 
${prefix}/share/tclspice/scripts/spinit or 
${prefix}/share/ngspice/scripts/spinit 
( depending if you included tcl support or not )

and uncomment the 
"* codemodel /usr/lib/spice/spice2poly.cm" 
line and edit as required. ( the path to spice2poly.cm may be wrong )
( alternativily create a ~/.spiceinit file with the above codemodel line )

Then read in your SPICE netlist.  SPICE 2 POLY attributes in
controlled sources will be translated into .models invoking the
spice2poly codemodel.  You should be able to run ngspice and simulate
in the usual way!

Please direct questions/comments/complaints to mailto:sdb@cloud9.net.

6.22.2003 -- SDB.

Edited on 20030831 by Stefan Jones