Chapter IX: TOOLS

icon

Simulation

icon


The Simulation command of the Tools menu controls the internal simulator, which can simulate schematics, IC layout, and VHDL specifications. Chapter 10 discusses this simulator more fully.

The Simulation Interface command of the Tools menu is able to produce input specifications for a number of different simulators. All these commands work on the current facet and require that all named points be exported. It is also necessary to export power and ground ports.

The possible simulators include circuit-level (SPICE), switch-level (ESIM, RSIM, RNL, COSMOS, and MOSSIM), gate-level (ABEL-PAL), and functional (TEGAS, SALT, and SILOS). To produce an input deck for any of these simulators, use the Write XXX Deck command (where XXX is the simulator's name).

On UNIX systems, there is an additional subcommand of the Simulation Interface command of the Tools menu. The subcommand > Execute Deck < indicates that the default state for certain simulators (SPICE, ESIM, RSIM, RNL) is to run the simulator once the deck has been written. Select this subcommand to toggle the state and disable simulator execution.

SPICE

SPICE circuit simulation is a special case in Electric. Since the simulator is not interactive, all input and output must be specified graphically in advance. Users unfamiliar with SPICE will probably not be interested in the rest of this section. Note that the example shown here is available in the "samples.txt" library as facet "tool-SimulateSPICE" (you can read the library with the Readable Dump subcommand of the Import command of the File menu).

All input values to SPICE are controlled with Source nodes, found in the New SPICE Part command of the Edit menu. There are both voltage and current sources. For example, to create a 5-volt supply, use the Voltage Source subcommand, provide the SPICE fragment "DC 5", and connect it to the power and ground ports of the circuit. To create a piecewise linear input signal, use the same component, connected between ground and the input port, and provide the SPICE fragment, for example "PWL(0NS 0 5NS 0 6NS 5)" (this sets the input to 0 volts from 0 to 5 nanoseconds, and ramps it up to 5 volts from 5 to 6 nanoseconds).

All output values requested of SPICE are controlled with Meter nodes. The Voltage Meter subcommand of the New SPICE Part command will place a node that can be wired between an output port and ground to measure the difference. The Current Meter is also a source that records the current output.

It is possible to specify transient, DC, or AC analysis. For transient analysis, use the Transient Analysis subcommand of the New SPICE Part command to create a special Transient node, and provide the "TRAN" card fragment, for example ".5NS 20NS 0NS .1NS". Use the DC Analysis subcommand to place a node that can be connected to the loop points. It is given a SPICE fragment, for example "0V 5V .1V".

Figure 9.6

Transistors sometimes require special care when modeling them in SPICE. This is because they not only have connections to a source, gate, and drain, but also have substrate connections (or "body" or "well", depending on the usage). Typically this is connected to power or ground (P-transistors have their substrate connected to power, and N-transistors have their substrate connected to ground). This can be overridden by using the Bulk Declaration subcommand of the New SPICE Part command to create a special Bulk node. The two ports on the Bulk node must be exported or connected so that they define two networks. The network connected on top (the + side) will be used as the substrate in P-transistors (it is the N-well substrate). The network on the bottom (the - side) will be used as the substrate in N-transistors (it is the P-well substrate). There can be only one Bulk node in any facet.

Bipolar transistors have their substrate connected to ground by default. If a Substrate node is encountered, its network will be used for the substrate connection of these transistors instead.

Some nongraphical information can also be given to the SPICE simulator with special commands. The SPICE Options... subcommand of the Simulation Interface command of the Tools menu allows you to control many of the SPICE deck parameters such as the SPICE format (SPICE 2, SPICE 3, or HSPICE), the SPICE level (1, 2, or 3), whether to use parasitics in the deck, whether to use actual node names in the deck (HSPICE only), and whether to run SPICE automatically after deck generation (UNIX systems only).
Figure 9.3
This dialog also allows you to specify a disk file of model cards that will be used instead of any built-in cards associated with the current technology. Note that the disk file override applies only to the current technology. To edit the built-in model cards for the current technology, use the Built-in Model Cards subcommands. These commands invoke an editing window (more information on text editing can be found in the "Text Windows" section of Chapter 4).

The SPICE options dialog also allows you to specify a disk file with trailer cards that will be appended to the SPICE deck (useful only in HSPICE). Finally, you can specify a disk file of SPICE cards that will be used to describe any facet. This disk file replaces the any SPICE description that may be derived from the circuitry.

Once SPICE has been run, you can see a plot of the simulation by reading the SPICE output file back into Electric. Make sure that the SPICE format is properly set (SPICE 2, SPICE 3, or HSPICE) and use the Plot SPICE Listing command to read the file. The waveforms will appear in a window:

Figure 9.4

You can do a number of special commands in this simulation window. Two vertical cursors appear in the window, called "main" and "extension". You can click over the cursors and drag them to different time locations. You can also click over signal names to select them for appropriate operations. Use "i" to print the value of the selected signal at the location of the main cursor.

Use "r" to remove the selected signal from the display. Use "o" to overlay a signal on top of the selected one (in the above example, there are two signals overlaid on each other). Use "a" to add a signal to the display in a separate location (not overlaid, but with its own area for values).

The time axis of the simulation window can be controlled with the appropriate Windows menu commands. Use Zoom Out and Zoom In to scale the time axis by a factor of two. Use Focus on Highlighted to display the range between the main and extension cursors. Use Right and Left to shift the time axis forward and backward.

Some miscellaneous commands are also available. Use "s" to save a snapshot of the simulation window in the database (a facet is created with artwork components). Use the Resume Simulation subcommand of the Simulation command of the Tools menu to restore this window if it has been closed.

Here is a summary of the single-key commands available in SPICE simulation windows:

i   Show value of selected signal at main cursor
aAdd signal to simulation window
oOverlay signal on top of currently selected signal line
rRemove selected signal from simulation window
sSave snapshot of simulation window in database
?Print this listing of single-key commands


Prev Previous     Contents Table of Contents     Next Next