home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
SCIENCE
/
SPCTR3E2.ZIP
/
SPICE3.DOC
< prev
Wrap
Text File
|
1992-12-11
|
38KB
|
877 lines
An abridged spice3 manual, it might even be useful. This manual
covers basic spice syntax and commands for using Spice TR3e2 in both
interactive and batch modes. It may not be complete, but a more
complete version is being worked on.
SPICE (simulation program with integrated circuit emphasis) was
developed in the Electronics Research Laboratory at the University of
California at Berkeley. Spice3 is based on spice2. When used in batch
mode, most of the syntax and commands are the same, but there are
changes. For example, the output can be similar, using the -o option,
or the may be written in a "RAW" file format (the raw file format must
be used if it is to be plotted with Spice TR3e2's graphics capability).
Polynomial non-linear sources are replaced by a General non-linear
source (NOTE: most opamp libraries are made for spice2g6 and use
polynomial non-linear sources-> exception: most of Linear Technology
Corporation's models will work with either spice2 or spice3).
Polynomial nonlinear capacitors are not supported in Spice3.
*************** input format ****************************
A circuit to be analyzed by Spice is described by a netlist which
defines the circuit topology, element (or part) values, and may
include the type of analysis to be run.
Spice uses ASCII input files. The input format for Spice is of the
free format type. Fields on a line are separated by one or more
blanks, a comma, an equal (=) sign, or a left or right parenthesis;
extra spaces are ignored. A line may be continued by entering a "+" in
column one of the following line. Comments can be included in the
listing-just place a "*" in column one of the line (a space will also
work for Spice3).
The first line in a Spice input file is assumed to be the circuit
title. The last line must be the ".END" line. Between are the parts,
type of analysis, and any subcircuits or models. The order of these
statements is arbitrary (except [of course], that continuation lines
must immediately follow the line being continued, and element lines
belonging to a subcircuit must be between the ".SUBCKT" and ".ENDS"
lines for that subcircuit). Other files may be added by using the
".include file_name" command.
Spice is not case-sensitive most of the time (the ".include" command
must be lower case).
In Spice2, nodes must be labeled as number, in Spice3 they may be may
be arbitrary character strings, except for the ground node which must
be named "0". All nodes must have a dc path to ground. The circuit
cannot contain a loop of voltage sources and/or inductors and cannot
contain a series connection of current sources and/or capacitors.
Every node must have at least two connections, except for transmission
line nodes (to permit unterminated transmission lines) and MOSFET
substrate nodes (which have two internal connections anyway).
Numbers may be interred directly, followed by a integer exponent, or a
scale factor. 6000, 6e3, and 6k all have the same value. The scale
used are: T=e12 G=e9 Meg=e6 K=e3 mil=25.4e-6
m=e-3 u=e-6 n=e-9 p=e-12 f=e-15
Letters immediately following a number that are not scale factors are
ignored, and letters immediately following a scale factor are ignored.
Hence, 10, 10V, 10VOLTS, and 10hz all represent the same number, and M,
MA, MSEC, and MMHOS all represent the same scale factor.
Each element in the circuit is specified by an element line that
contains the element name, the circuit nodes to which the element is
connected, and the values of the parameters that determine the
electrical characteristics of the element. The first letter of the
element name specifies the element type. The format for the SPICE
element types is given in what follows. The strings XXXXX, YYYYY, and
ZZZZZ denote arbitrary alphanumeric strings. For example, a resistor
name must begin with the letter `R' and can contain one or more
characters. Hence, R, R1, RSE, ROUT, and R3AC2ZY are valid resistor
names.
******* Command line Usage ************
spice [ -n ] [ -b ] [ -o outfile ] [ -r rawfile ] [ input_file ]
-n (or -N)
Don't try to source the file "spice.rc" upon startup.
Normally Spice tries to find this file in the current
directory.
-b (or -B)
Run in batch mode. Spice will read the specified input
file and do the simulation.
-r rawfile (or -R rawfile)
Use rawfile as the default file into which the results of
the simulation are saved. If the -r option is used, the
.print and .plot commands will be ignored.
-o outfile (or -O outfile)
Print analysis time and memory usage to a file, and if the
-r option is not used, use the .print and .plot commands to
make a Spice2 type output file.
Further arguments are taken to be Spice input files, which are read and
saved. (If batch mode is requested then they are run immediately.)
Spice files specified on the command line are read in before the
"spice.rc" file is read. Thus if you define aliases there, any that
are used in a Spice source file mentioned on the command line won't be
recognized.
**************** Parts ******************************
Data fields that are enclosed in less than and greater than signs ("<"
or ">") are optional.
resistor
Format: Rname Node1 Node2 value
Examples: R1 32 45 1k
rload 8 0 200
The name must start with the letter R. The value may be
positive or negative, but not zero.
capacitor
Format: Cname Node1 Node2 value
Examples: C1 32 45 1uf
cload 8 0 200pf
The name must start with the letter C.
inductor
Format: Lname +Node -Node value
Examples: L1 32 45 1uh
lload 8 0 200uh
The name must start with the letter L.
mutual inductor
Format: Kname Lname1 Lname2 value
Example: k1 L5 L9 .987
The name must start with the letter K. Two inductors are
referenced. The standard dot convention determines polarity-
with the positive node on the inductors having the dot. Value
is the coefficient of coupling, which must be between 0 and 1.
Lossless Transmission Lines
Format: Tname N1 N2 N3 N4 Z0=value TD=value
Tname N1 N2 N3 N4 Z0=value F=freq NL=nrmlen
Example: t1 1 0 2 0 z0=75 td=15ns
The name must start with the letter T. N1 and N2 are the nodes
at port one; N3 and N4 are the nodes at port two. Z0 is the
characteristic impedance. The length of the line must be
expressed in either one of two forms : the delay may be specified
directly (TD=value) or a frequency (F=freq) must be given. If
the frequency is given, the normalized electrical length
(NL=value) may be given (the default is NL=.25).
NOTE1: This models only one propagating mode. If all four nodes
are distinct in the actual circuit, then two modes may be
excited. To simulate this, two transmission line elements
are required.
NOTE2: The lossy transmission line with zero loss may be more
accurate due to implementation details.
sources
independent source
Format: _name +node -node [dc value] [ac value] [tran_value]
Examples: Vcc 10 0 15
Icc 2 5 1ma
vin 1 0 dc 0 ac 1 pulse(-0.5 0.5 20us 20us 20us 200us 400us)
If the name starts with a V it is a voltage source and if it
starts with an I it is a current source. The transient value
may have the following values:
PULSE(v1 v2 pulse_delay [rise_time fall_time pulse_width period])
SIN(offset_voltage amplitude frequency [start_delay damping_coef])
PWL(time_point1 volt_or_amp1 [t2 v_or_a2 ...])
linear dependent sources
Format: _name +nodeOut -nodeOUT +nodeIN -nodeIN value
Examples: G1 10 0 5 0 15mmho
E1