Using Netlist Input Files
This section describes how to use standard Star-Hspice netlist input files.
Input Netlist File (
<design>.sp
) Guidelines
Star-Hspice operates on an input netlist file and stores results in either an output listing file or a graph data file. The Star-Hspice input file, with the name
<design>.sp (although the filename can be anything, we recommend this form for clarity)
, contains the following:
-
Design netlist (with subcircuits and macros, power supplies, and so on)
-
Statement naming the library to be used (optional)
-
Specification of the analysis to be run (optional)
-
Specification of the output desired (optional)
Input netlist and library input files are generated by a schematic netlister or with a text editor.
Statements in the input netlist file can be in any order, except that the first line is a title line, and the last .ALTER submodule must appear at the end of the file before the .END statement.
NOTE: If there is no .END statement at the end of the input netlist file or no carriage return after the .END statement, an error message is issued.
Input Line Format
-
The input netlist file cannot be in a packed or compressed format.
-
The Star-Hspice input reader can accept an input token, such as a statement name, a node name, or a parameter name or value. A valid string of characters between two token delimiters is accepted as a token. See Delimiters.
-
Input filename length, statement length, and equation length can be up to 1024 characters.
-
Upper and lower case are ignored, except in quoted filenames.
-
A statement may be continued on the next line by entering a plus (+) sign as the first nonnumeric, nonblank character in the next line.
-
All statements, including quoted strings such as paths and algebraics, are continued with a backslash (\) or a double backslash (\\) at the end of the line to be continued. The single backslash preserves white space and the double backslash squeezes out any white space between the continued lines. The double backslash guarantees that path names are joined without interruption. Input lines can be 1024 characters long, so folding and continuing a line is generally only necessary to improve readability.
-
Comments are added at any place in the file. Lines beginning with an asterisk (*) are comments. Place a comment on the same line as input text by entering a dollar sign ($), preceded by one or more blanks, after the input text.
-
An error is issued when a special control character is encountered in the input netlist file. Since most systems cannot print special control characters, the error message is ambiguous because the erroneous character cannot be shown in the error message. Use the .OPTIONS BADCHAR statement to locate such errors. The default for BADCHAR is "off".
Names
-
Names must begin with an alphabetic character, but thereafter can contain numbers and the following characters:
! # $ % * + - / < > [ ] _
-
Names are input tokens that must be preceded and followed by token delimiters. See "Delimiters" below.
-
Names can be 1024 characters long.
-
Names are not case sensitive.
Delimiters
-
An input token is any item in the input file recognized by Star-Hspice. Input token delimiters are: tab, blank, comma, equal sign (=), and parentheses
"( )".
-
Single or double quotes delimit expressions and filenames.
-
Element attributes are delimited by colons ("M1:beta", for example).
-
Hierarchy is indicated by periods. For example, "X1.A1.V" is the V node on subcircuit A1 of circuit X1.
Nodes
-
Node identifiers can be up to 1024 characters long, including periods and extensions.
-
Numerical node names are valid in the range of 0 through 9999999999999999 (1-1E16).
-
Leading zeros are ignored in node numbers.
-
Trailing characters are ignored in node numbers. For example, node 1A is the same as node 1. Exception: Star-Hspice recognizes the following special alphabetic trailing characters (d, e, f, g, i, m, n, o, p, u, x, k, t).
-
A node name can begin with any of the following characters: # _ ! %.
-
Nodes are made global across all subcircuits by a .GLOBAL statement.
-
Node 0, GND, GND!, and GROUND all refer to the global Star-Hspice ground.
Instance Names
-
The names of element instances begin with the element key letter (for example, M for a MOSFET element, D for a diode, R for a resistor, and so on), except in subcircuits.
-
Subcircuit instance names begin with "X". (Subcircuits are sometimes called macros or modules.)
-
Instance names are limited to 1024 characters.
-
.OPTIONS LENNAM controls the length of names in Star-Hspice printouts (default = 8).
Hierarchy Paths
-
Path hierarchy is indicated by a period.
-
Paths can be up to 1024 characters long.
-
Path numbers compress the hierarchy for post-processing and listing files.
-
Path number cross references are found in the listing and in the <design>.pa0 file.
-
.OPTIONS PATHNUM controls whether full path names or path numbers are shown in list files.
Numbers
-
Numbers are entered as integer or real.
-
Numbers can use exponential format or engineering key letter format, but not both (1e-12 or 1p, but not 1e-6u).
-
Exponents are designated by D or E.
-
Exponent size is limited by .OPTIONS EXPMAX.
-
Trailing alphabetic characters are interpreted as units comments.
-
Units comments are not checked.
-
.OPTIONS INGOLD controls the format of numbers in printouts.
-
.OPTIONS NUMDGT = x controls the listing printout accuracy.
-
.OPTIONS MEASDGT = x controls the measure file printout accuracy.
-
.OPTIONS VFLOOR = x specifies the smallest voltage for which the value will be printed. Smaller voltages are printed as 0.
Parameters and Expressions
-
Parameter names follow Star-Hspice name syntax rules.
-
Parameter hierarchy overrides and defaults are defined by .OPTIONS PARHIER = global | local.
-
The last parameter definition or .OPTIONS statement is used if multiple definitions exist. This is true even if the last definition or .OPTIONS statement is later in the input than a reference to the parameter or option. No warning is issued when a redefinition occurs.
-
If a parameter is used in another parameter definition, the first parameter must be defined before the second parameter definition.
-
In your design parameter name selection, be careful to avoid conflicts with parameterized libraries.
-
Expressions are delimited by single or double quotes and are limited to 256 characters.
-
A line can be continued to improve readability by using a double slash at end of the line (\\).
-
Function nesting is limited to three levels.
-
No user-defined function may have more than two arguments.
-
Use the PAR(expression or parameter) function to evaluate expressions in output statements.
Input Netlist File Structure
A Star-Hspice input netlist file should consist of one main program and one or more optional submodules. Use a submodule (preceded by an .ALTER statement) to automatically change an input netlist file and rerun the simulation with different options, netlist, analysis statements, and test vectors.
You can use several high-level call statements to restructure the input netlist file modules. These are the .INCLUDE, .LIB and .DEL LIB statements. These statements can call netlists, model parameters, test vectors, analysis, and option macros into a file from library files or other files. The input netlist file also can call an external data file that contains parameterized data for element sources and models.
Schematic Netlists
Star-Hspice circuits typically are generated from schematics by netlisters. Star-Hspice accepts either hierarchical or flat netlists. The normal SPICE netlisters flatten out all subcircuits and rename all nodes to numbers. Avoid flat netlisters if possible.
The process of creating a schematic involves:
-
Symbol creation with a symbol editor
-
Circuit encapsulation
-
Property creation
-
Symbol placement
-
Symbol property definition
-
Wire routing and definition
Input Netlist File Sections and Chapter References
Sections
|
Examples
|
Ch
|
Definition
|
Title
|
.TITLE
|
3
|
The first line is the input netlist file title
|
Set-up
|
.OPTIONS
|
9
|
Sets conditions for simulation
|
.IC or .NODESET
|
10
|
Initial values in circuit and subcircuit
|
.PARAM
|
7
|
Set parameter values in the netlist
|
.GLOBAL
|
7
|
Set node name globally in netlist
|
Sources
|
Sources (I or V) and digital inputs
|
5
|
Sets input stimuli
|
Netlist
|
Circuit elements
|
3-4
|
Circuit for simulation
|
.SUBKCT, .ENDS
|
3
|
Subcircuit definitions
|
Analysis
|
.DC, .TRAN, .AC, etc.
|
10-12
|
Statements to perform analyses
|
.SAVE and .LOAD
|
10
|
Save and load operating point info
|
.DATA
|
3
|
Create table for data-driven analysis
|
.TEMP
|
3
|
Set analysis temperature
|
Output
|
.PRINT, .PLOT, .GRAPH, .PROBE
|
8
|
Statements to output variables
|
.MEASURE
|
8
|
Statement to evaluate and report user-defined functions of a circuit
|
Library, Model and File Inclusion
|
.INCLUDE
|
3
|
General include files
|
.MODEL
|
3, 8
|
Element model descriptions
|
.LIB
|
3
|
Library
|
.<UN>PROTECT
|
3
|
Control printback to output listing
|
Alter blocks
|
.ALTER
|
3
|
Sequence for in-line case analysis
|
.DELETE LIB
|
3
|
Removes previous library selection
|
End of netlist
|
.END
|
3
|
Required statement to end the netlist
|
Star-Hspice Manual - Release 2001.2 - June 2001