Generic, flat SPICE format netlists have the following characteristics:
- Part names, module names, reference strings, node names, and pin numbers are not checked for length.
- Node numbers are limited to five characters.
- If the Use net names option is selected, legal characters for node names are limited to:
0..9 A..Z a..z $ _ (underscore)
If you select this option, Capture uses the node names you placed on the schematic page (via aliases and hierarchical ports), where available. Not all versions of SPICE support alphanumeric node names. Check your SPICE manual for details. If your version of SPICE does not allow alphanumeric node names, you can still give them numeric names such as "17." These numeric names do not interfere with the ones generated by Capture, since the node numbers it generates begin at 10000 (except GND, which is always 0).
- All ASCII characters are legal except as noted for node names.
For more information on flat SPICE netlists, see the flat SPICE netlist example.
The Spice formats
Capture provides two SPICE netlist formats. The first format produces either hierarchical or flat netlist output, depending on your project structure and the active view. It is accessible from the SPICE tab on the Create Netlist dialog box. The second format produces only flat netlists, and is accessible through the Other tab on the Create Netlist dialog box.
Use the SPICE tab if:
- You want to include net, part, and pin properties.
- You want a hierarchical netlist.
Use the Other tab if: - You want a flat netlist of a simple hierarchical design.
Hierarchical designs in SPICE
For hierarchical designs, the SPICE format produces netlists with subcircuit (.SUBCKT) definitions for schematic pages in the hierarchy. These subcircuits are called by the X command (subcircuit call). Since SPICE does not require subcircuits to be defined before use, the hierarchy appears in normal form in the netlist with the root page at the top of the file.
According to the PSPICE manual, the X subcircuit general form is:
X name [nodes] subcircuit-name
where:
name Specifies a unique name for the device
nodes Specifies the list of nets that attach to the device in the same order as the .SUBCKT definition used by the device
subcircuit-name Specifies the name of a .SUBSCKT definition that the X device uses
The following is an example of an X subcircuit call:
XBUF 13 15 UNITAMP
For more information on hierarchical SPICE netlists, see the hierarchical SPICE netlist example.
SPICE netlist constraints
- Capture can create netlists larger than what most PC-based SPICE programs accept. Consult your SPICE manual for the limits. If your PC meets SPICE's memory requirements, you can generate the largest allowed netlist.
- The part value is used to pass modeling information to the netlist. For instance, resistor RS1 in the example flat schematic folder has a value of 1K Ohms; in the example hierarchical schematic folder R1 has a value of 6.8K Ohms.
- Use the special PSPICE.OLB or SPICE.OLB libraries supplied by OrCAD when generating a SPICE netlist. These libraries already have pin numbers on the parts and are compatible with most versions of SPICE. The PSPICE.OLB contains many specific part types, such as a 2N2222 NPN transistor, that are not provided in the generic SPICE.OLB.
- All library part pin names should be changed to reflect the model node index. To find out the proper node ordering, see your SPICE manual.
As an example of what to change, the OrCAD-supplied NPN transistor has the pin names defined as base, emitter, and collector in the DEVICE.OLB library. For SPICE to understand the nodal information, the pin names must be changed from base, emitter, and collector to 2, 3, and 1 (as defined in the SPICE manual). Therefore, the library source file for an NPN transistor that is compatible with the SPICE pin numbering convention is as follows:
'NPN' REFERENCE 'Q' {X Size =} 2 {Y Size =} 2 {Parts per Package =} 0 L1 SHORT IN '2' B2 SHORT IN '3' T2 SHORT IN '1' { 0}..##.# { 1} ## # . . .
SPICE map files
In addition to the netlist file, Capture also creates a map file when you select the SPICE format. The node numbers created by Capture are placed in the .MAP file so you can cross-reference the SPICE node numbers with the node names that you specified on your schematic page. You must enter the map filename in the Map File text box in the Create Netlist dialog box.
If you select the Use net names option, the map file may contain erroneous results.
For more information on SPICE map files, see the flat and hierarchical map file examples.
SPICE pipe commands
You can place lines of text on your schematic page to be included in the SPICE netlist. Select the Text command on the Place menu to place the text on your schematic page.
Each line of text must start with the pipe character (|). The first line must be:
|SPICE
This tells Capture to extract the information in the following lines of text when generating a SPICE netlist. The remaining lines can contain any information you want to include in the netlist. The lines following |SPICE are placed at the top of the netlist.