[ Introduction ] [ Files ] [ Source File ] [ Devices ] [ Commands ] [ Notes ]
The HSPICE source file consists of five parts.
- Title statement: the first line is the circuit's title; it
may be anything, but not neglected.
- Data statements: description of the components and the
interconnections.
- Control statements: tells SPICE what type of analysis to
perform on the circuit.
- Output statements: specifies what outputs are to be printed
or plotted.
- End statement: on the very last line: .END followed by a
carriage return.
Although statements 2,3, and 4 may appear in any order, it is recommended that
they be given in the above sequence.
-
- TITLE STATEMENT
- ELEMENT STATEMENTS
- .
- .
- COMMAND (CONTROL) STATEMENTS
- OUTPUT STATEMENTS
- .END <CR>
You can insert comment statements anywhere in the source file:
-
"*" - indicates a full line comment
-
"$" - indicates an end-of-line comment
Furthermore, it is useful to know that:
-
"+" - indicates a continuation of the previous line.
An example of these statements can be found in the BJT amplifier example bjtamp.sp.
Here the .OPTION command is extended for four lines and the end of line comment
is used after the .MEASURE commands. Notice that by using tabs for the elements
and their nodes, it makes the netlist much easier to read. It is not required
that tabs be used, but it is very helpful.
NOTATION
HSPICE notation is relatively simple. Both upper and lower case letters are
allowed, but no distinction is made (HSPICE converts everything to upper-case
characters before any interpretation is attempted). The statements have a
free format and consist of fields separated by a blank. Each line is
interpreted as a separate statement, i.e., unless "+" is the first
character (see above).
- All statements beginning with a "." are commands (e.g. .OPTION,
.PRINT, .AC, etc.) Commands are used to change the behavior of
HSPICE:
-
Request that a specific type of simulation be performed (.AC, .DC,
.TRAN, .FOUR, etc.)
-
Set various parameters, such as voltage or charge accuracy (.OPTION)
-
Specify what circuit nodes that are of interest (.PRINT, .PLOT, etc.)
- Statements that begin with an alphabetic character are treated as elements
(e.g. r51, cc, load, etc). The first character determines the type of
element:
-
R for resistors: (R1, Rload, Rin, Rcapacitor, Rdummy, Rain, etc.)
-
C for capacitors: (C1, Cload, Cin, Csomename, Cinductor, Cello, etc.)
-
L for inductors: (L1, Lload, Lin, Lmutual, Ldummy, Larry, etc.)
-
D for diodes: (D1, Dummy, Dsubstrate, etc.)
-
Q for bipolar junction transistors (Q1, Q32apq, Qdiff1, Question,
etc.)
-
M for MOS transistors (M1, M12, Mary, Mozart, etc.)
-
V for voltage sources
-
I for current sources
-
G for voltage-controlled current sources (transconductance amplifiers)
-
F for current-controlled current sources (current amplifiers)
-
E for voltage-controlled voltage sources (voltage amplifiers)
-
H for current-controlled voltage sources (transresistance amplifiers)
-
X for subcircuits (hierarchical circuit structure)
Each element is subject to a specific notation. See [Commands]
and [Devices] for details.
HSPICE will (fortunately) only run if the circuit topology fulfill certain
criteria. Mostly, these criteria are the same as those known from basic
circuit analysis:
-
Every node must have a DC path to ground.
-
No dangling nodes (i.e. all nodes must have at least two connections).
-
No loops of only ideal voltage sources and capacitors.
-
No nodes connected to only ideal current sources and inductors.
Every node and element within the HSPICE netlist must have its own unique
name. You are advised to use the following rules (although they are not strictly
necessary):
-
Node Identification:
-
0 is ALWAYS ground
-
To avoid an old bug, it is best to start all node names (besides
ground) with an alphabetic character (in1, in2, out1, out2,
n1, n2, n3,
n4, etc.)
-
Allowable Characters and Conventions:
-
Max of 16 characters (warning: the rest are silently ignored)
-
May contain: +-*/:;$#.[]!<>_%
(but it is better not to use them)
-
May not contain: (),=<space>
HSPICE will automatically assign ohms to resistors, Farads to capacitors, and
Henries to inductors. Hence, you need only provide the numeric value.
The scaling for the all units in HSPICE is done by:
- F=1e-15
- P=1e-12
- N=1e-9
- U=1e-6
- M=1e-3 ***************
- K=1e3
- MEG=X=1e6 **************
- G=1e9
- T=1e12
Note: Capitals do not matter (e.g. F=f and M=m), therefore many people have
problems with M and MEG. Please be careful with these two units! Of this
reason, I personally never use any of these abbreviations; I prefer the
floating-point notation: 1.234e5=0.1234e6.
- Syntax
- .GLOBAL node1 node2 node3 .........Globally defined nodes
- .GLOBAL VBIAS VCC .................Globally defined sources
- Usage
- When subcircuits are included in the data file.
- Assigns common node name to subcircuit nodes
- Power supply connection of all subcirsuits is often
done this way:
- .GLOBAL VCC:
Connects all nodes named VCC
(all circuits have a common node)
Essentially globals are used most often for subcircuits, though they are great
for sources. This way all power sources do not have to be separately defined.
Notice that ground (node 0) always is a global node.

The material in this website is an expanded version
of material presented by Dr. J. Steensgaard.
This website is maintained by Shouri
Chatterjee. This page was last updated on
02/11/2003