Using the .AC Statement

You can use the .AC statement in several different formats, depending on the application, as shown in the examples below. The parameters are described below.

Syntax

Single/double sweep:

.AC type np fstart fstop

or

.AC type np fstart fstop <SWEEP var start stop incr>

or

.AC type np fstart fstop <SWEEP var type np start stop>

or

.AC var1 START = <param_expr1> STOP = <param_expr2>
+ STEP = <param_expr3>

or

.AC var1 START = start1 STOP = stop1 STEP = incr1

Parameterized sweep:

.AC type np fstart fstop <SWEEP DATA = datanm>

or

.AC DATA = datanm

Optimization:

.AC DATA = datanm OPTIMIZE = opt_par_fun RESULTS = measnames
+ MODEL = optmod

Random/Monte Carlo:

.AC type np fstart fstop <SWEEP MONTE = val>

The .AC statement keywords and parameters have the following descriptions:

 

DATA = datanm

Data name referred to in the .AC statement

incr

voltage, current, element or model parameter increment value


NOTE: If "type" variation is used, the "np" (number of points) is specified instead of "incr".

fstart

Starting frequency


NOTE: If type variation "POI" (list of points) is used, a list of frequency values is specified instead of "fstart fstop".

fstop

Final frequency

MONTE = val

Produces a number val of randomly-generated values that are used to select parameters from a distribution. The distribution can be Gaussian , Uniform , or Random Limit. See Performing Monte Carlo Analysis for more information.

np

Number of points per decade or per octave, or just number of points, depending on the preceding keyword

start

Starting voltage, current, any element or model parameter value

stop

Final voltage, current, any element or model parameter value

SWEEP

Keyword to indicate a second sweep is specified in the .AC statement

TEMP

Keyword to indicate a temperature sweep

type

Can be any of the following keywords:

  • DEC - decade variation
  • OCT - octave variation
  • LIN - linear variation
  • POI - list of points

var

Name of an independent voltage or current source, any element or model parameter, or the keyword TEMP (indicating a temperature sweep). Star-Hspice supports source value sweep, referring to the source name (SPICE style). However, if parameter sweep, a .DATA statement, and temperature sweep are selected, a parameter name must be chosen for the source value and subsequently referred to in the .AC statement. The parameter name can not start with V or I.

Example

The following example performs a frequency sweep by 10 points per decade from 1 kHz to 100 MHz.

.AC DEC 10 1K 100MEG

The next line calls for a 100 point frequency sweep from 1 Hz to 100 Hz.

.AC LIN 100 1 100HZ

The following example performs an AC analysis for each value of cload, which results from a linear sweep of cload between 1 pF and 10 pF (20 points), sweeping frequency by 10 points per decade from 1 Hz to 10 kHz.

.AC DEC 10 1 10K SWEEP cload LIN 20 1pf 10pf

The following example performs an AC analysis for each value of rx, 5 k and 15 k, sweeping frequency by 10 points per decade from 1 Hz to 10 kHz.

.AC DEC 10 1 10K SWEEP rx n POI 2 5k 15k

The next example uses the DATA statement to perform a series of AC analyses modifying more than one parameter. The parameters are contained in the file datanm .

.AC DEC 10 1 10K SWEEP DATA = datanm

The following example illustrates a frequency sweep along with a Monte Carlo analysis with 30 trials.

.AC DEC 10 1 10K SWEEP MONTE = 30

When an .AC statement is included in the input file, Star-Hspice performs an AC analysis of the circuit over the specified frequency range for each parameter value specified in the second sweep.

For an AC analysis, at least one independent AC source element statement must be in the data file (for example, VI INPUT GND AC 1V). Star-Hspice checks for this condition and reports a fatal error if no such AC sources have been specified (see Using Sources and Stimuli).

AC Control Options

 

ABSH = x

Sets the absolute current change through voltage defined branches (voltage sources and inductors). In conjunction with DI and RELH, ABSH is used to check for current convergence. Default = 0.0.

ACOUT

AC output calculation method for the difference in values of magnitude, phase and decibels for prints and plots. Default = 1.

 

The default value, ACOUT = 1, selects the Star-Hspice method, which calculates the difference of the magnitudes of the values. The SPICE method, ACOUT = 0, calculates the magnitude of the differences.

DI = x

Sets the maximum iteration-to-iteration current change through voltage defined branches (voltage sources and inductors). This option is only applicable when the value of the DI control option is greater than 0. Default = 0.0.

MAXAMP = x

Sets the maximum current through voltage defined branches (voltage sources and inductors). If the current exceeds the MAXAMP value, an error message is issued. Default = 0.0.

RELH = x

Sets relative current tolerance through voltage defined branches (voltage sources and inductors). It is used to check current convergence. This option is applicable only if the value of the ABSH control option is greater than zero. Default = 0.05.

UNWRAP

Displays phase results in AC analysis in unwrapped form (with a continuous phase plot). This allows accurate calculation of group delay. Note that group delay is always computed based on unwrapped phase results, even if the UNWRAP option is not set.

Star-Hspice Manual - Release 2001.2 - June 2001