5. SPICE netlist generation

5.1. Using gnetlist

Once the schematic is captured, a SPICE netlist can be generated running gEDA's command-line program gnetlist on the schematic files. Gnetlist is architected in two sections: a front-end processor written in C which reads in the .sch file and creates from it an internal, generic representation of your design, and a back-end netlister written in SCHEME. Using this architecture, gnetlist is highly customizable; different SCHEME backends are used to write out different netlist formats. The beauty of this scheme (pun intended) is that gEDA users can easily write their own netlisters to suit their own applications. The back-end Scheme file which implements advanced SPICE netlisting is called gnet-spice-sdb.scm, and it lives in the ${PREFIX}/geda/share/gEDA/scheme directory.

Gnetlist with spice-sdb is invoked from the command line in the following way: “gnetlist [OPTIONS] -g spice-sdb filename1 ... filenameN” . The following command-line options are available with spice-sdb:

-i Interactive scheme mode

-I Put .INCLUDE <filename> in output file instead of model file's contents

-q Quiet mode

-l filename Load scheme file before loading backend

-m filename Load scheme file after loading backend, but still before executing procedure

-g proc Scheme procedure to execute (i.e. spice-sdb)

-o filename Output netlist filename

-c string Execute string as a scheme script

-v Verbose mode on

-s Sort output netlist (for Gnucap)

5.2. Creating the netlist using gnetlist and spice-sdb

Creating a netlist from a schematic is easy. To generate a SPICE netlist, just do the following:

5.3. Common netlisting problems

The following list attempts to catalog common problems with the netlist and the associated fixes.

Finally, remember that it is important to manually inspect your SPICE netlist prior to using it in simulation. Please keep in mind that the netlister is still “beta” quality, and some problems may still exist in netlist generation.