Displaying Simulation Results

The following section describes the statements used to display simulation results for your specific requirements.

.PRINT Statement

The .PRINT statement specifies output variables for which values are printed.

The maximum number of variables in a single .PRINT statement is 32. You can use additional .PRINT statements for more output variables.

To simplify parsing of the output listings, a single "x" printed in the first column indicates the beginning of the .PRINT output data, and a single "y" in the first column indicates the end of the .PRINT output data.

Syntax

.PRINT antype ov1 <ov2 ... ov32>

where:

 

antype

Specifies the type of analysis for outputs. Antype is one of the following types: DC, AC, TRAN, NOISE, or DISTO.

ov1 ...

Specifies output variables to be printed. These are voltage, current, or element template variables from a DC, AC, TRAN, NOISE, or DISTO analysis.

Statement Order

Star-Hspice produces different .sw0 and .tr0 files based on the order of the .print and .dc statements. If no analysis type is given for a .print command, then the analysis type will match the last analysis command found in the netlist before the .print. See examples below.

 

CASE 1

.print v(din) i(mxn18)

.dc vdin 0 5.0 0.05

.tran 1ns 60ns

 

CASE 2

.dc vdin 0 5.0 0.05

.tran 1ns 60ns

.print v(din) i(mxn18)

 

CASE 3

.dc vdin 0 5.0 0.05

.print v(din) i(mxn18)

.tran 1ns 60ns

 

.print TRAN v(din) i(mnx)
then all 3 cases have identical .sw0 and .tr0 files.
.print DC v(din) i(mnx)
then the .sw0 and .tr0 files will be different.
Example

.PRINT TRAN V(4) I(VIN) PAR(`V(OUT)/V(IN)')

This example prints out the results of a transient analysis for the nodal voltage named 4 and the current through the voltage source named VIN. The ratio of the nodal voltage at node "OUT" and node "IN" is also printed.

.PRINT AC VM(4,2) VR(7) VP(8,3) II(R1)

VM(4,2) specifies that the AC magnitude of the voltage difference (or the difference of the voltage magnitudes, depending on the value of the ACOUT option) between nodes 4 and 2 is printed. VR(7) specifies that the real part of the AC voltage between nodes 7 and ground is printed. VP(8,3) specifies that the phase of the voltage difference between nodes 8 and 3 (or the difference of the phase of voltage at node 8 and voltage at node 3 depending on the value of ACOUT options) is printed. II(R1) specifies that the imaginary part of the current through R1 is printed.

.PRINT AC ZIN YOUT(P) S11(DB) S12(M) Z11(R)

The above example specifies that the magnitude of the input impedance, the phase of the output admittance, and several S and Z parameters are to be printed. This statement would accompany a network analysis using the .AC and .NET analysis statements.

.PRINT DC V(2) I(VSRC) V(23,17) I1(R1) I1(M1)

This example specifies that the DC analysis results are to be printed for several different nodal voltages and currents through the resistor named R1, the voltage source named VSRC, and the drain-to-source current of the MOSFET
named M1.

.PRINT NOISE INOISE

In this example, the equivalent input noise is printed.

.PRINT DISTO HD3 SIM2(DB)

This example prints the magnitude of the third-order harmonic distortion and the decibel value of the intermodulation distortion sum through the load resistor specified in the .DISTO statement.

.PRINT AC INOISE ONOISE VM(OUT) HD3

In this statement, specifications of NOISE, DISTO, and AC output variables are included on the same .PRINT statement.

.PRINT pj1 = par(`p(rd) +p(rs)`)

This statement prints the value of pj1 with the specified function.


NOTE: Star-Hspice ignores .PRINT statement references to nonexistent netlist part names and prints those names in a warning message.

.PLOT Statement

The .PLOT statement plots output values of one or more variables in a selected analysis. Each .PLOT statement defines the contents of one plot, which can have 1 to 32 output variables.

When no plot limits are specified, Star-Hspice automatically determines the minimum and maximum values of each output variable being plotted and scales each plot to fit common limits. To cause Star-Hspice to set limits for certain variables, set the plot limits to (0,0) for those variables.

To make Star-Hspice find plot limits for each plot individually, select .OPTION PLIM to create a different axis for each plot variable. The PLIM option is similar to the plot limit algorithm in SPICE2G.6. In the latter case, each plot can have limits different from any other plot. The overlap of two or more traces on a plot is indicated by a number from 2 through 9.

When more than one output variable appears on the same plot, the first variable specified is printed as well as plotted. If a printout of more than one variable is desired, include another .PLOT statement.

The number of .PLOT statements you can specify for each type of analysis is unlimited. Plot width is set by the option CO (columns out). For a CO setting of 80, a 50-column plot is produced. If CO is 132, a 100-column plot is produced.

Syntax

.PLOT antype ov1 <(plo1,phi1)> ... <ov32>
+ <(plo32,phi32)>

where:

 

antyp e

Type of analysis for the specified plots. Analysis types are: DC, AC, TRAN, NOISE, or DISTO.

ov1 ...

Output variables to plot. These are voltage, current, or element template variables from a DC, AC, TRAN, NOISE, or DISTO analysis. See the following sections for syntax.

plo1,phi1 ...

Lower and upper plot limits. Each output variable is plotted using the first set of plot limits following the output variable. Output variables following a plot limit should have a new plot limit. For example, to plot all output variables with the same scale, specify one set of plot limits at the end of the PLOT statement. Setting the plot limits to (0,0) causes Star-Hspice to set the plot limits.

Example

In the following example, PAR invokes the plot of the ratio of the collector current and the base current of the transistor Q1.

.PLOT DC V(4) V(5) V(1) PAR(`I1(Q1)/I2(Q1)')

.PLOT TRAN V(17,5) (2,5) I(VIN) V(17) (1,9)

.PLOT AC VM(5) VM(31,24) VDB(5) VP(5) INOISE

The second of the two examples above uses the VDB output variable to plot the AC analysis results of the node named 5 in decibels. Also, NOISE results may be requested along with the other variables in the AC plot.

.PLOT AC ZIN YOUT(P) S11(DB) S12(M) Z11(R)

.PLOT DISTO HD2 HD3(R) SIM2

.PLOT TRAN V(5,3) V(4) (0,5) V(7) (0,10)

.PLOT DC V(1) V(2) (0,0) V(3) V(4) (0,5)

In the last example above, Star-Hspice sets the plot limits for V(1) and V(2), while 0 and 5 volts are specified as the plot limits for V(3) and V(4).

.PROBE Statement

The .PROBE statement saves output variables into the interface and graph data files. Star-Hspice usually saves all voltages and supply currents in addition to the output variables. Set .OPTION PROBE to save output variables only. Use the .PROBE statement to specify which quantities are to be printed in the output listing.

If you are only interested in the output data file and do not want tabular or plot data in your listing file, set .OPTION PROBE and use the .PROBE statement to specify which values you want saved in the output listing.

Syntax

.PROBE antype ov1 ... <ov32>

where:

 

antype

Type of analysis for the specified plots. Analysis types are: DC, AC, TRAN, NOISE, or DISTO.

ov1 ...

Output variables to be plotted. These are voltage, current, or element template variables from a DC, AC, TRAN, NOISE, or DISTO analysis. The limit for the number of output variables in a single .PROBE statement is 32. Additional .PROBE statements may be used to deal with more output variables.

Example

.PROBE DC V(4) V(5) V(1) beta = PAR(`I1(Q1)/I2(Q1)')

.GRAPH Statement

The .GRAPH statement allows high resolution plotting of simulation results. This statement is similar to the .PLOT statement with the addition of an optional model. When a model is specified, you can add or change graphing properties for the graph. The .GRAPH statement generates a .gr# graph data file and sends this file directly to the default high resolution graphical device (specified by PRTDEFAULT in the meta.cfg configuration file).

Each .GRAPH statement creates a new .gr# file, where # ranges first from 0 to 9, and then from a to z. The maximum number of graph files that can exist is 36. If more than 36 .GRAPH statements are used, the graph files are overwritten starting with the .gr0 file. To overcome this limitation, the option ALT999 or ALT9999 should be used to extend the number of digits allowed in the file name extension to .gr### or .gr#### (in this case # ranges from 0 to 9).


NOTE: The .GRAPH statement is not provided in the PC version of Star-Hspice.
Syntax

.GRAPH antype <MODEL = mname> <unam1 = > ov1,
+ <unam2 = >ov2, ... <unam32 = > ov32 (plo,phi)

where:

 

antype

Type of analysis for the specified plots. Analysis types are: DC, AC, TRAN, NOISE, or DISTO.

mname

Plot model name referenced by the .GRAPH statement. .GRAPH and its plot name allow high resolution plots to be made from Star-Hspice directly.

unam1...

User-defined output names, which correspond to output variables ov1...ov32 (unam1 to unam32 respectively), are used as labels instead of output variables for a high resolution graphic output.

ov1 ...ov2

Output variables to be printed, 32 maximum. They can be voltage, current, or element template variables from a different type analysis. Algebraic expressions also are used as output variables, but they must be defined inside the PAR( ) statement.

plo, phi

Lower and upper plot limits. Set the plot limits only at the end of the .GRAPH statement.

.MODEL Statement for .GRAPH

This section describes the model statement for .GRAPH.

Syntax

.MODEL mname PLOT (pnam1 = val1 pnam2 = val2....)

 

mname

Plot model name referenced by the .GRAPH statements

PLOT

Keyword for a .GRAPH statement model

pnam1 = val1...

Each .GRAPH statement model includes a variety of model parameters. If no model parameters are specified, Star-Hspice takes the default values of the model parameters described in the following table. Pnamn is one of the model parameters of a .GRAPH statement, and valn is the value of pnam n . Val n can be a number of parameter.

Example
.GRAPH DC  cgb = lx18(m1)  cgd = lx19(m1) cgs = lx20(m1)
.GRAPH DC MODEL = plotbjt
+ model_ib = i2(q1)    meas_ib = par(ib)
+ model_ic = i1(q1)    meas_ic = par(ic)
+ model_beta = par('i1(q1)/i2(q1)')
+ meas_beta = par('par(ic)/par(ib)')(1e-10,1e-1)
.MODEL plotbjt PLOT MONO = 1 YSCAL = 2 XSCAL = 2 XMIN = 1e-8
+ XMAX = 1e-1

Model Parameters

Name (Alias)

De-fault

Description

FREQ

0.0

Plots symbol frequency. Value 0 suppresses plot symbol generation; a value of n generates a plot symbol every n points.

MONO

0.0

Monotonic option. MONO = 1 automatically resets x-axis if any change in x direction.

TIC

0.0

Shows tick marks

XGRID, YGRID

0.0

Setting to 1.0 turns on the axis grid lines

XMIN, XMA X

0.0

If XMIN is not equal to XMAX, then XMIN and XMAX determines the x-axis plot limits. If XMIN equals XMAX, or if XMIN and XMAX are not set, then the limits are automatically set. These limits apply to the actual x-axis variable value regardless of the XSCAL type.

XSCAL

1.0

Scale for the x-axis. Two common axis scales are:

Linear(LIN) (XSCAL = 1)
Logarithm(LOG) (XSCAL = 2)

YMIN,
YMAX

0.0

If YMIN is not equal to YMAX, then YMIN and YMAX determines the y-axis plot limits. The y-axis limits specified in the .GRAPH statement override YMIN and YMAX in the model. If limits are not specified then they are automatically set. These limits apply to the actual y-axis variable value regardless of the YSCAL type.

YSCAL

1.0

Scale for the y-axis. Two common axis scales are:

Linear(LIN) (YSCAL = 1)
Logarithm(LOG) (YSCAL = 2)

Print Control Options

.OPTION CO for Printout Width

The number of output variables printed on a single line of output is a function of the number of columns, set by the option CO. Typical values are CO = 80 for narrow printouts and CO = 132 for wide printouts. CO = 80 is the default. The maximum number of output variables allowed is 5 per 80-column output and 8 per 132-column output with twelve characters per column. Star-Hspice automatically creates additional print statements and tables for all output variables beyond the number specified by the CO option.

.WIDTH Statement

Syntax

.WIDTH OUT = {80 |132}

where OUT is the output print width

Example

.WIDTH OUT = 132 $ SPICE compatible style
.OPTION CO = 132 $ preferred style

Permissible values for OUT are 80 and 132. OUT can also be set with option CO.

.OPTION ALT999 or ALT9999 for Output File Name Extension

The output files for postprocessor (from .OPTION POST) or .GRAPH statements have unique extensions .xx#, where xx is a 2-character text string to denote the output type (see Specifying Simulation Output for more information), and # is an alphanumeric character that denotes the .ALTER number of the current simulation. This limits the total number of .ALTER statements in a netlist to 36 before the outputs begin overwriting the current files.

The options ALT999 and ALT9999 extend the output file name extension syntax to .xx### and .xx####, respectively, where # now represents a numerical character only. This syntax allows for 1000 and 10,000 .ALTERs in the input netlist while maintaining a unique file name for the output files.

.OPTION INGOLD for Printout Numerical Format

Variable values are printed in engineering notation by default:

	F = 1e-15         M = 1e-3
	P = 1e-12         K = 1e3
	N = 1e-9          X = 1e6
	U = 1e-6          G = 1e9

In contrast to the exponential format, the engineering notation provides two to three extra significant digits and aligns columns to facilitate comparison. To obtain output in exponential format, specify INGOLD = 1 or 2 with an .OPTION statement.

INGOLD = 0 (default)

Engineering Format

1.234K

123M

INGOLD = 1

G Format (fixed and exponential)

1.234e+03

.123

INGOLD = 2

E Format (exponential SPICE)

1.234e+03

.123e-1

.OPTION POST for High Resolution Graphics

Use an .OPTION POST statement to use AvanWaves to display high resolution plots of simulation results on a graphics terminal or a high resolution laser printer. Use the .OPTION POST to provide output without specifying other parameters. POST has defaults that supply most parameters with usable data.

POST = 0,1,BINARY

Output format is binary

POST = 2,ASCII

Output format is ascii

.OPTION ACCT Summary of Job Statistics

A detailed accounting report is generated using the ACCT option, where:

.OPTION ACCT

Enables reporting

.OPTION ACCT = 1 (default)

Is the same as ACCT with no argument

.OPTION ACCT = 2

Enables reporting plus matrix statistic reporting

Example

The following output appears at the end of the output listing.

******  job statistics summary tnom =   25.000 temp =   25.000 
# nodes = 15 # elements =  29 # real*8 mem avail/used =   333333/   13454
# diodes =  0 # bjts = 0 # jfets = 0 # mosfets = 24
 
    analysis				time      # points  tot. iter  conv.iter
op point				0.24		 1        11
    transient				5.45		161       265       103 rev =     1
    pass1				0.08
    readin				0.12
    errchk				0.05
    setup				0.04
    output				0.00
the following time statistics are already included in the analysis time
    load				5.22
    solver				0.16
# external nodes =   15 # internal nodes =    0
# branch currents =     5 total matrix size =    20
    pivot based and non pivotting solution times
      non pivotting:  ----  decompose       0.08  solve 0.08
    matrix size(   109) = initial size(   105) + fill(     4)
    words copied =       111124
          total cpu time          6.02 seconds
              job started at  11:54:11  21-sep92
              job ended   at  11:54:36  21-sep92

The definitions for the items in the previous listing follow:

# BJTS

Number of bipolar transistors in the circuit

# ELEMENTS

Total number of elements

# JFETS

Number of JFETs in the circuit

# MOSFETS

Number of MOSFETs in the circuit

# NODES

Total number of nodes

# POINTS

Number of transient points specified by the user on the .TRAN statement. JTRFLG is usually at least 50 unless the option DELMAX is set.

CONV.ITER

Number of points that the simulator needed to take to preserve the accuracy specified by the tolerances

DC

DC operating point analysis time and number of iterations required. The option ITL1 sets the maximum number of iterations.

ERRCHK

Part of the input processing

MEM +

Amount of workspace available and used for the simulation

AVAILUSED

Measured in 64-bit (8-byte) words

OUTPUT

Time required to process all prints and plots

LOAD

Constructs the matrix equation

SOLVER

Solves equations

PASS1

Part of the input processing

READIN

Specifies the input reader that takes the user data file and any additional library files, and generates an internal representation of the information

REV

Number of times the simulator had to cut time (reversals). This is a measure of difficulty.

SETUP

Constructs a sparse matrix pointer system

TOTAL JOB TIME

Total amount of CPU time required to process the simulation. This is not the length of actual (clock) time that was taken, and may differ slightly from run to run, even if the runs are identical.

The ratio of TOT.ITER to CONV.ITER is the best measure of simulator efficiency. The theoretical ratio is 2:1. In this example the ratio was 2.57:1. SPICE generally has a ratio of 3:1 to 7:1.

In transient, the ratio of CONV.ITER to # POINTS is the measure of the number of points evaluated to the number of points printed. If this ratio is greater than about 4, the convergence and time step control tolerances might be too tight for the simulation.

Changing the File Descriptor Limit

A simulation that has a large number of .ALTER statements might fail due to the limit on the number of file descriptors. For example, for a Sun workstation, the default number of file descriptors is 64, and a design with more than 50 .ALTER statements is liable to fail with the following error message:

error could not open output spool file /tmp/tmp.nnn
a critical system resource is inaccessible or exhausted

To prevent this on a Sun workstation, enter the following operating system command before you start the simulation:

limit descriptors 128

For platforms other than Sun workstations, see your system administrator for help with increasing the number of files you can open concurrently.

Subcircuit Output Printing

The following examples demonstrate how to print or plot voltages of nodes in subcircuit definitions using .PRINT, .PLOT, .PROBE or .GRAPH.


NOTE: .PROBE, .PLOT, or .GRAPH may be substituted for .PRINT in the following example.
Example 1

.GLOBAL vdd vss

X1 1 2 3 nor2

X2 3 4 5 nor2

.SUBCKT nor2 A B Y

.PRINT v(B) v(N1) $ Print statement 1

M1 N1 A vdd vdd pch w = 6u l = 0.8u

M2 Y B N1 vdd pch w = 6u l = 0.8u

M3 Y A vss vss nch w = 3u l = 0.8u

M4 Y B vss vss nch w = 3u l = 0.8u

.ENDS

Print statement 1 invokes a printout of the voltage on input node B and internal node N1 for every instance of the nor2 subcircuit.

.PRINT v(1) v(X1.A) $ Print statement 2

The print statement above specifies two ways of printing the voltage on input A of instance X1.

.PRINT v(3) v(X1.Y) v(X2.A) $ Print statement 3

This print statement specifies three different ways of printing the voltage at output Y of instance X1. (input A of instance X2).

.PRINT v(X2.N1) $ Print statement 4

The print statement above prints out the voltage on the internal node N1 of instance X2.

.PRINT i(X1.M1) $ Print statement 5

The print statement above prints out the drain-to-source current through MOSFET M1 in instance X1.

Example 2

X1 5 6 YYY

.SUBCKT YYY 15 16

X2 16 36 ZZZ

R1 15 25 1

R2 25 16 1

.ENDS

.SUBCKT ZZZ 16 36

C1 16 0 10P

R3 36 56 10K

C2 56 0 1P

.ENDS

.PRINT V(X1.25) V(X1.X2.56) V(6)

The .PRINT statement voltages are:

 

V(X1.25)

Local node to subcircuit definition YYY, called by subcircuit X1

V(X1.X2.56)

Local node to subcircuit definition ZZZ, called by subcircuit X2, which was called by X1

V(6)

Represents the voltage of node 16 in instance X1 of subcircuit YYY

This example prints analysis results for the voltage at node 56 within the sub-circuits X2 and X1. The full path name X1.X2.56 specifies that node 56 is within subcircuit X2 that is within subcircuit X1.

Star-Hspice Manual - Release 2001.2 - June 2001