ngspice/src/xspice
rlar 97cc400efb ngspice/evt.h, ngspice/enh.t, reduce scope of these include files 2016-05-07 15:36:43 +02:00
..
cm ngspice/evt.h, ngspice/enh.t, reduce scope of these include files 2016-05-07 15:36:43 +02:00
cmpp xspice/cmpp/*.l, flex file cleanup and use %option noinput, nounput 2016-04-01 19:36:51 +02:00
enh everywhere, use `TMALLOC()' instead of `alloc()' 2016-03-21 21:22:07 +01:00
evt ngspice/evt.h, ngspice/enh.t, reduce scope of these include files 2016-05-07 15:36:43 +02:00
examples src/xspice/examples/io_types.deck, bug fix, instance name 2016-02-07 17:33:25 +01:00
icm xspice/icm/digital/d_osc/cfunc.mod, swallow a warning 2016-03-22 15:24:53 +01:00
idn remove all .cvsignore files 2012-10-26 18:30:14 +02:00
ipc xspice/ipc/ipcsockets.c, choke some warnings 2016-03-22 15:24:41 +01:00
mif ngspice/evt.h, ngspice/enh.t, reduce scope of these include files 2016-05-07 15:36:43 +02:00
.gitignore .gitignore files 2012-02-26 16:19:58 +01:00
Makefile.am fix `make dist' 2012-11-16 22:29:55 +01:00
README fix file modes 2012-06-12 21:26:29 +02:00
xspice.c new callback function cm_get_path, which makes the global 2014-01-18 19:14:42 +01:00

README

ngspice Xspice code model support.
2012 05 06
--------------------------------------

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/ngspice/analog.cm /usr/lib/ngspice/spice2poly.cm"

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

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

To create your own codemodels:

* Unpack the ngspice 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


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

SPICE2 POLY attributes are now available for controlled sources.  

To use POLY attributes, configure and install ( make install ) 
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 the ngspice user's list 
or forum.