Product Documentation
Spectre Classic Simulator, Spectre APS, Spectre X, Spectre XPS, Spectre FMC Analysis, and Legato Reliability Solution User Guide
Product Version 23.1, September 2023

19


Time-Saving Techniques

In this chapter, you will learn about different methods to reduce simulation time. This chapter discusses the following topics:

Specifying Efficient Starting Points

The Spectre® circuit simulator arrives at a solution for a simulation by calculating successively more accurate estimates of the final result. You can increase simulation speed by providing information that the Spectre simulator uses to increase the accuracy of the initial solution estimate. There are three ways to provide a good starting point for a simulation:

Reducing the Number of Simulation Runs

With the Spectre simulator, you can run many analyses (including analyses of the same type) in a single simulation. With other SPICE-like simulators, you might require multiple simulations to complete the same tasks. In a single simulation run, you can run a set of Spectre analyses; modify the component, temperature, or options parameters; and then run additional analyses with the new parameters.

Adjusting Speed and Accuracy

You can use the errpreset parameter to increase the speed of transient analyses, but this speed increase requires some sacrifice of accuracy.

Saving Time by Starting Analyses from Previous Solutions

A solution for one analysis can be an appropriate starting point for the next analysis. For example, if a DC analysis precedes a transient analysis, you can use the DC solution as the first guess for the initial point in the transient analysis solution. There are two Spectre analysis parameters that let you start analyses from previous solutions. They are available for most Spectre analyses.

Saving Time by Specifying State Information

The Spectre simulator lets you provide state information (the current or last-known status or condition of a process, transaction, or setting) to the DC and transient analyses. You can specify two kinds of state information:

Setting Initial Conditions for All Transient Analyses

You can specify initial conditions that apply to all transient analyses in a simulation or to a single transient analysis. The ic statement and the ic parameter described in this section set initial conditions for all transient analyses in the netlist. In general, you use the ic parameter of individual components to specify initial conditions for those components, and you use the ic statement to specify initial conditions for nodes. You can specify initial conditions for inductors with either method. Specifying cmin for a transient analysis does not satisfy the condition that a node has a capacitive path to ground.

Do not confuse the ic parameter for individual components with the ic parameter of the transient analysis. The latter lets you select from among different initial conditions specifications for a given transient analysis.

Specifying Initial Conditions for Components

You can specify initial conditions in the instance statements of capacitors, inductors, and windings for magnetic cores. The ic parameter specifies initial voltage values for capacitors and current values for inductors and windings. In the following example, the initial condition voltage on capacitor Cap13 is set to two volts:

Cap13 11 9 capacitor c=10n ic=2

Specifying Initial Conditions for Nodes

You use the ic statement to specify initial conditions for nodes or initial currents for inductors. The nodes can be inside a subcircuit or internal nodes to a component.

The following is the format for the ic statement:

ic signalName=value

The format for specifying signals with the ic statement is similar to that used by the save statement. This method is described in detail in “Saving Main Circuit Signals”. Consult this discussion if you need further clarification about the following example.

ic Voff=0 X3.7=2.5 M1:int_d=3.5 L1:1=1u

This example sets the following initial conditions:

Specifying initial node voltages requires some additional discussion. The following table tells you the internal voltages you can specify with different components.

Component Internal Node Specifications

BJT

int_c, int_b, int_e

BSIM

int_d, int_s

MOSFET

int_d, int_s

GaAs MESFET

int_d, int_s, int_g

JFET

int_d, int_s, int_g, int_b

Winding for Magnetic Core

int_Rw

Magnetic Core with Hysteresis

flux

Supplying Solution Estimates to Increase Speed

You use the nodeset statement to supply estimates of solutions that aid convergence or bias the simulation towards a given solution. You can use nodesets for all DC and initial transient analysis solutions in the netlist. The nodeset statement has the following format:

nodeset signalName=value

Values you can supply with the nodeset statement include voltages on topological nodes, including internal nodes, and currents through voltage sources, inductors, switches, transformers, N-ports, and transmission lines.

The format for specifying signals with the nodeset statement is similar to that used by the save statement. This method is described in detail in “Saving Main Circuit Signals”

nodeset Voff=0 X3.7=2.5 M1:int_d=3.5 L1:1=1u

This example sets the following solution estimates:

Specifying State Information for Individual Analyses

You can specify state information for individual analyses in two ways:

Choosing Which Initial Conditions Specifications Are Used for a Transient Analysis

The ic parameter in the transient analysis lets you select among several options for which initial conditions to use. You can choose the following settings:

Parameter Setting Action Taken

dc

Initial conditions specifiers are ignored, and the existing DC solution is used.

node

The ic statements are used, and the ic parameter settings on the capacitors and inductors are ignored.

dev

The ic parameter settings on the capacitors and inductors are used, and the ic statements are ignored.

all

Both the ic statements and the ic parameters are used. If specifications conflict, ic parameters override ic statements.

Specifying State Information with State Files

You can also specify initial conditions and estimate solutions by creating a state file that is read by the appropriate analysis. You can create a state file in two ways:

Telling the Spectre Simulator to Create a State File

You can instruct the Spectre simulator to create a state file from either the initial point or the final point in an analysis. To write a state file from the initial point in an analysis, use the write parameter. To write a state file from the final point, use the writefinal parameter. Each of the following two examples writes a state file named ua741.dc. The first example writes the state file from the initial point in the DC sweep, and the second example writes the state file from the final point in the DC sweep.

Drift dc param=temp start=0 stop=50.0 step=1 readns="ua741.dc" write="ua741.dc"
Drift dc param=temp start=0 stop=50.0 step=1 readns="ua741.dc" writefinal="ua741.dc"

Creating a State File Manually

The syntax for creating a state file in a text editor is simple. Each line contains a signal name and a signal value. Anything after a pound sign (#) is ignored as a comment. The following is an example of a simple state file:

# State file generated by Spectre from circuit file 'wilson'
# during 'stepresponse' at 5:39:38 PM, jan 21, 1992.
1     .588793510612534
2 1.17406247989272
3 14.9900516233357
pwr 15
vcc:p -9.9483766642647e-06

Reading State Files

To read a state file as an initial condition, use the readic transient analysis parameter. To read a state file as a nodeset, use the readns parameter. This example reads the file intCond as initial conditions:

DoTran_z12 tran start=0 stop=0.003 \
step=0.00015 maxstep=6e-06 readic="intCond"

This second example reads the file soluEst as a nodeset.

DoTran_z12 tran start=0 stop=0.003 \
step=0.00015 maxstep=6e-06 readns="soluEst"

Special Uses for State Files

State files can be useful for the following reasons:

The following example demonstrates the usefulness of state files:

altTemp alter param=temp value=0
Drift dc param=temp start=0 stop=50.0 step=1 readns=”ua741.dc0” write=”ua741.dc
XferVsTemp xf param=temp start=0 stop=50 step=1 probe=Rload freq=1kHz \   readns=”ua741.dc0”

The first analysis computes the DC solution at T=0C, saves it to a file called ua741.dc0, and then sweeps the temperature to T=50C. The transfer function analysis (xf) resets the temperature to zero. Because of the temperature change, the DC solution must be recomputed. Without the use of state files, this computation might slow the simulation because the only available estimate of the DC solution would be that computed at T=50C, the final point in the DC sweep. However, by using a state file to preserve the initial DC solution at T=0C, you can enable the Spectre simulator to compute the new DC solution quickly. The computation is fast because the Spectre simulator can use the DC solution computed at T=0C to estimate the new solution. You can also make future simulations of this circuit start quickly by using the state file to estimate the DC solution. Even if you have altered a circuit, it is usually faster to start the DC analysis from a previous solution than to start from the beginning.

Saving Time by Modifying Parameters during a Simulation

The Spectre simulator lets you place specifications in the netlist to modify parameters and then resimulate. This lets you accomplish tasks with a single Spectre run that might require multiple runs with another simulator. To change parameter settings during a run, you use the following Spectre control statements:

The alter and set statements are queued up with analysis statements and are processed in order.

Changing Circuit or Component Parameter Values

You modify parameters for devices, models, circuit, and subcircuit parameters during a simulation with the alter statement. The modifications apply to all analyses that follow the alter statement in your netlist until you request another parameter modification.

Changing Parameter Values for Components

To change a parameter value for a component device or model, you specify the device or model name, the parameter name, and the new parameter value in the alter statement. You can modify only one parameter with each alter statement, but you can put any number of alter statements in a netlist. The following example demonstrates alter statement syntax:

SetMag alter dev=Vt1 param=mag value=1

Changing Parameter Values for Models

To change a parameter value for model files with the altergroup statement, you list the device, model, and circuit parameter statements as you do in the main netlist. Within an alter group, each model is first defaulted and then the model parameters are updated. You cannot nest alter groups. You cannot change from a model to a model group and vice versa. The following example demonstrates altergroup statement syntax:

ag1 altergroup {
parameters p1=1
model myres resistor r1=1e3 af=p1
model mybsim bsim3v3 lmax=p1 lmin=3.5e-7
}

Further Examples of Changing Component Parameter Values

This example changes the is parameter of a model named SH3 to the value
1e-15:

modify2 alter mod=SH3 param=is value=1e-15

The following examples show how to use the param default in an alter statement. The first parameter listed for resistors in the Spectre online help (spectre -h) is the default. For resistors, this is the resistance parameter r.

Consequently, if R1 is a resistor, the following two alter statements are equivalent:

change1 alter dev=R1 param=r value=50
change1 alter dev=R1 value=50

Changing Parameter Values for Circuits

When you change a circuit parameter, you use the same syntax as when you change a device or model parameter except that you do not enter a dev or a mod parameter.

This example changes the ambient temperature to 0°C:

change2 alter param=temp value=0

The following table describes the circuit parameters you can change with the alter statement:    

Parameter Description

temp

Ambient temperature

tnom

Default measurement temperature for component parameters

scalem

Component model scaling factor

scale

Component instance scaling factor

If you change temp or tnom using an alter statement, all expressions with temp or tnom are reevaluated.

Modifying Initial Settings of the State of the Simulator

You can change the initial settings for the state of the simulator by placing a set statement in the netlist. The set statement is similar to the options statement that sets the state of the simulator, but it is queued with the analysis statements in the order you place them in the netlist.

You use the set statement to change previous options or set statement specifications. The modifications apply to all analyses that follow the set statement in the netlist until you request another parameter modification. The set and options statements have many identical parameters, but the set statement cannot modify all options statement parameters. The parameter listings in the Spectre online help (spectre -h) tell you which parameters you can reset with the set statement.

Formatting the set Statement

The following example demonstrates the set statement syntax. This example turns off several annotation parameters.

Quiet set narrate=no error=no info=no
If you want to change temp or tnom, use the alter statement.

Saving Time by Selecting a Continuation Method

The Spectre simulator normally starts with an initial estimate and then tries to find the solution for a circuit using the Newton-Raphson method. If this attempt fails, the Spectre simulator automatically tries several continuation methods to find a solution and tells you which method was successful. Continuation methods modify the circuit so that the solution is easy to compute and then gradually change the circuit back to its original form. Continuation methods are robust, but they are slower than the Newton-Raphson method.

If you need to modify and resimulate a circuit that was solved with a continuation method, you probably want to save simulation time by directly selecting the continuation method you know was previously successful.

You select the continuation method with the homotopy parameter of the set or options statements. In addition to the default setting, all, other settings are possible for this parameter: gmin stepping (gmin), source stepping (source), the pseudotransient method (ptran), and damped pseudotransient method (dptran), . You can also prevent the use of continuation methods by setting the homotopy parameter to none.


Return to top
 ⠀
X