There are many powerful facilities for running Spice with Electric. The example shown here illustrates some of these facilities. This example is available in the Samples library as cell "tool-SimulateSpice" (you can read the library with the Load Samples Library command, in menu Help).

All input values to Spice are controlled with special nodes, found in the "Spice" component menu entry. Note that the first time any Spice node is placed, the library of Spice parts is loaded into Electric, so there may be a delay. |

The Spice primitives described here are for Electric's default set. However, additional sets can (and have) been written. To choose another set, use the "Spice" preferences (in menu File / Preferences..., "Tools" section, "Spice" tab). Under the setting "Spice primitive set", choose another set. A second set, called "SpicePartsS3", is tailored towards special Spice3 primitives.

In this example, there is a 5-volt supply on the left. It was created by using the "DC Voltage" entry under "Spice" entry of the component palette. Once placed, the text that reads "Voltage=0V" can be selected and modified (either with Object Properties... or by double-clicking on it). The Pulse input signal on the right is created with the "Pulse" entry under "Spice" (it has 7 parameters).

There are both voltage and current sources, in AC and DC form. The pulse input sources are available as voltage and current. A set of "two-gate" devices are also available: "CCCS", "CCVS", "VCCS", "VCVS", and "Transmission".

It is possible to specify Transient, DC, or AC analysis by using the "Transient Analysis", "DC Analysis", and "AC Analysis" subcommands. Only one such element may exist in a circuit.

For advanced users, there are two special Spice nodes: "Node Set" and "Extension". The Node Set may be parameterized with an arbitrary piece of Spice code. Truly advanced users may create their own Spice nodes by modifying the cells in the Spice library.

This example also shows the ability to add arbitrary text to the Spice deck, as shown in the lower-right. To create this text, use the "Add Spice Card" under the "Misc." button in the component palette. The command creates a piece of text that can be modified arbitrarily. Whatever the text says will be added to the Spice deck.

Another option that can be used when modeling transistors and other component is to set a specific Spice model to use for that component. To set a node's model, select it and use the Set Spice Model... command (in menu Tool / Simulation (Spice) ).

The Add Multiplier subcommand places a multiplier on the currently selected node. Multipliers (also called "M" factors) scale the size of transistors inside of them.

Some nongraphical information can also be given to the Spice simulator with the "Spice" preferences (in menu File / Preferences..., "Tools" section, "Spice" tab).

The top part of this dialog allows you to control many of the Spice deck parameters such as:

- Spice Engine Can be Spice 2, Spice 3, HSpice, PSpice, Gnucap, or SmartSpice.
- Spice Level Can be 1, 2, or 3.
- Output format The format to expect when reading Spice output.
- Use Parasitics Whether to include simple parasitics in the deck.
- Use Node Names Whether to use actual node names in the deck (Spice 2 can only handle numbers).
- Force Global VDD/GND Whether to force power and ground to be global signal names.
- Use Cell Parameters" When set, any parameters defined on the cell will appear in the Spice deck. When not checked, each parameterized cell appears multiple times in the deck, once for each different parameter combination. See Section 6-8-6 for more on parameters.
- Write Trans Sizes in Units Requests that the Spice deck contain scalable size information instead of absolute size information.
- Run Program Lets Electric run Spice automatically after the deck has been written.
- Spice Primitive Set Switches between Spice primitive sets. Currently there are only two: "spiceparts" and "spicepartsG3".

Running Spice: Electric can create an exteral process as specified by the user to run spice on the generated netlist. If the pull-down box is set to "Don't Run", nothing is done. If the pull-down box is set to "Run, Ignore Output", the external process is run, and the user is notified when it is finished. If set to "Run, Report Output", a dialog box is opened to show the user the output produced by the process. Please note that this is a *process*, and not a command line command.

There are several options for the process:

- Use Dir if specified, this is the working directory of the process .
- Overwrite existing file this will overwrite the existing netlist without prompting the user .
- Run probe this will run the waveform viewer on the output of the spice run .
- Help tells which environment variables are exported to be used by the process .
- Run program the name of the executable to run .
- with arg the arguments passed to the executable .

The middle section of the Spice Options dialog controls technology-specific information. Each layer of the technology can have a different resistance, capacitance, and edge-capacitance. You can also set the minimum resistance and capacitance for the entire technology. The "Gate Length Shrink" is a compensation factor for gate lengths. Some process technologies shrink the gate length by a fixed amount. To let Spice know the true gate length, this shrinkage can be entered here.

The lower-middle section controls header and trailer cards (placed at the start and end of the Spice deck). This dialog allows you to specify a disk file with cards to be used instead of the built-in set. You can specify a particular file or request that the system search for files with the cell's name and a given extension.

Note that the header, trailer, and parasitic information is specific to a particular technology. If you set this information for one technology, but then use another technology when generating the Spice deck, the information that you set will not be used. Note also that schematics, although a technology in Electric, are not considered to be Spice technology. You can set the proper layout technology that you want to use when dealing with schematics by using the "Use Scale values from this Technology" popup. This popup can be found in the "Technology" preferences (in menu File / Preferences..., "Technology" section, "Technology" tab).

The bottom section of the dialog allows you to specify a disk file of Spice cards that will be used to describe any cell. This disk file replaces the any Spice description that may be derived from the circuitry.