Previous Up Next

Chapter 2  Command descriptions

2.1  Command Summary

command descriptions command summary
*
Comment line. comment line

!
Pass a command to the operating system.

<
Batch mode.

>
Direct the ``standard output'' to a file.

AC
Performs a small signal AC (frequency domain) analysis. Sweeps frequency.

ALARM
Select points in circuit check against limits.

ALTER
Perform analyses in queue. Changes follow. (Not implemented.)

BUILD
Build a new circuit or change an existing one.

CHDIR
Change current directory.

CLEAR
Delete the entire circuit, titles, etc.

DC
Performs a nonlinear DC analysis, for determining transfer characteristics. Sweeps DC input or component values.

DELETE
Delete a part, or group of parts.

DISTO
SPICE command not implemented.

EDIT
Edit the circuit description using your editor.

END
Perform analyses in queue. New circuit follows. (Implemented incorrectly.)

EXIT
Exits the program. (Same as quit.)

FANOUT
List by node number, the branches that connect to each node.

FAULT
Temporarily change a component.

FOURIER
Transient analysis, with results in frequency domain. (Different from SPICE.)

GENERATOR
View and set the transient analysis function generator.

GET
Get a circuit from a disk file. Deletes old one first.

IC
Set transient analysis initial conditions. (Not implemented.)

INCLUDE
Include a file from disk. Add it the what is already in memory.

INSERT
Insert a node number. (Make a gap.)

LIST
List the circuit on the console.

LOG
Save a record of commands.

MARK
Mark this time point, so transient analysis will restart here.

MERGE
Get a file from disk. Add it the what is already in memory.

MODIFY
Change a value, node, etc. For very simple changes.

NODESET
Preset node voltages, to assist convergence. (Not implemented.)

NOISE
SPICE command not implemented.

OP
Performs a nonlinear DC analysis, for determining quiescent operating conditions. Sweeps temperature.

OPTIONS
View and set system options. (Same as set.)

PAUSE
Wait for key hit, while in batch mode.

PLOT
Select points in circuit (and their range) to plot.

PRINT
Select which points in the circuit to print as table.

QUIT
Exits the program. (Same as exit.)

SAVE
Save the circuit in a file.

SENS
SPICE command not implemented.

STATUS
Display resource usage, etc.

SWEEP
Sweep a component. (Loop function.)

TEMP
SPICE command not implemented.

TF
SPICE command not implemented.

TITLE
View and create the heading line for printouts and files.

TRANSIENT
Performs a nonlinear transient (time domain) analysis. Sweeps time.

UNFAULT
Undo faults.

UNMARK
Undo mark. Release transient start point.

WIDTH
Set output width.

2.2  ! command

! command operating system commands

2.2.1  Syntax

! command

2.2.2  Purpose

Run a program, or escape to a shell.

2.2.3  Comments

Any command typed here will be passed to the system for it to execute.

The bare command ! will spawn an interactive shell. Exiting the shell will return.

2.2.4  Examples

! ls *.ckt
Run the command ls *.ckt as if it were a shell command.

!
No arguments mean to spawn an interactive shell.

2.3  < command

< command batch mode files disk files input redirection i-o redirection redirection: i-o

2.3.1  Syntax

< filename
<< filename

2.3.2  Purpose

Run a simulation in batch mode. Gets the commands and circuit from a disk file. << clears the old circuit, first.

2.3.3  Comments

You can invoke the batch mode directly from the command that starts the program. The first command line argument is considered to be an argument for this command.

The file format is almost as you would type it on the keyboard. Commands must be prefixed with a dot, and circuit elements can be entered directly, as if in build mode. This is compatible with Spice.

The log command makes a file as you work the program, but the format is not correct for this command. To fix it, prefix commands with a dot, and remove the build commands.

Any line that starts with * a comment line.

Any line that starts with . (dot) is a command.

Any line that starts with a letter is a component to be added or changed.

A < command in the file transfers control to a new file. Files can be nested.

A bare < in the file (or the end of the file) gives it back to the console.

Unlike SPICE, commands are executed in order. This can result in some surprises when using some SPICE files. SPICE queues up commands, then executes them in a predetermined order.

2.3.4  Examples

< thisone.ckt
Activates batch mode, from the file thisone.ckt, in the current directory.

< runit.bat
Use the file runit.bat.

From the shell: on start up:

gnucap afile
Start up the program. Start using the file afile.ckt in batch mode, as if you entered < afile as the first command.

gnucap <afile
Start up the program. Start using the file afile.ckt with commands as if you typed them from the keyboard.

2.4  > command

> command files disk files output redirection i-o redirection redirection: i-o

2.4.1  Syntax

> file
>> file
>

2.4.2  Purpose

Saves a copy of all program output (except help) in a file.

2.4.3  Comments

> creates a new file for this output. If the file already exists, the old one is lost, and replaced by the new one.

>> appends to an existing file, if it exists, otherwise it creates one.

A bare > closes the file.

2.4.4  Examples

> run1
Save everything in a file run1 in the current directory. If run1 already exists, the old one is gone.

>> allof
Save everything in a file allof. If allof already exists, it is kept, and the new data is added to the end.

>
Close the file. Stop saving.

2.5  AC command

ac command sine wave analysis frequency response small signal ac analysis

2.5.1  Syntax

AC {options ...} start stop stepsize {options ...}

2.5.2  Purpose

Performs a small signal, steady state, AC analysis. Sweeps frequency.

2.5.3  Comments

nonlinear AC analysis The AC command does a linear analysis about an operating point. It is absolutely necessary to do an OP analysis first on any nonlinear circuit. Not doing this is the equivalent of testing it with the power off.

Three parameters are normally needed for an AC analysis: start frequency, stop frequency and step size, in this order. If all of these are omitted, the values from the most recent AC analysis are used.

If only one frequency is specified, a single point analysis will be done.

If only a new step size is specified, the old start and stop are kept and only the step size is changed. This is indicated by a keyword: by, times, decade or octave, or a symbol: + or *.

If the start frequency is zero, the program will still do an AC analysis. The actual frequency can be considered to be the limit as the frequency approaches zero. It is, therefore, still possible to have a non-zero phase angle, but delays are not shown because they may be infinite.

The nodes to look at must have been previously selected by the print or plot command. This is different fron Spice.

2.5.4  Options

+ stepsize
Linear sweep. Add stepsize to get the next step. Same as By.

* multiplier
Log sweep. Multiply by multiplier to get the next step.

> file
Send results of analysis to file.

>> file
Append results to file.

By stepsize
Linear sweep. Add stepsize to get the next step. Same as +.

Decade steps
Log sweep. Use steps steps per decade.

NOPlot
Suppress plotting.

Octave steps
Log sweep. Use steps steps per octave.

PLot
Graphic output, when plotting is normally off.

Print
Send results to printer.

Quiet
Suppress console output.

TEmperature degrees
Temperature, degrees C.

TImes multiplier
Log sweep. Multiply by multiplier to get the next step.

2.5.5  Examples

ac 10m
A single point AC analysis at 10 mHz.

ac 1000 3000 100
Sweep from 1000 Hz to 3000 Hz in 100 Hz steps.

ac 1000 3000 Octave
Sweep from 1000 Hz to 3000 Hz in octave steps. Since the sweep cannot end at 3000 Hz, in this case, the last step will really be 4000 Hz.

ac by 250
Keep the same limits as before, but use 250 Hz steps. In this case, it means to sweep from 1000 to 3000 Hz, because that it what it was the last time.

ac 5000 1000 -250
You can sweep downward, if you want. Remember that the increment would be negative.

ac 20 20k *2
Double the frequency to get the next step.

ac 20k 20 *.5
You can do a log sweep downward, too. A multiplier of less than one moves it down.

ac
Do the same AC sweep again.

ac >afile
Save the results in the file afile. The file will look just like the screen. It will have all probe points. It will be a plot, if plotting is enabled. It will have the numbers in abbreviated notation. (10 nanovolts is 10.n.)

2.6  ALARM command

alarm command output selection safe operating area

2.6.1  Syntax

ALArm
ALArm mode points ... ...
ALArm mode + points ... ...
ALArm mode - points ... ...
ALArm mode CLEAR

2.6.2  Purpose

Select points in the circuit to check against user defined limits.

2.6.3  Comments

The `alarm' command selects points in the circuit to check against limits. There is no output unless the limits are exceeded. If the limits are exceeded a the value is printed.

There are separate lists of probe points for each type of analysis.

To list the points, use the bare command `alarm'.

Syntax for each point is parameter(node)(limits), parameter(componentlabel)(limits), or parameter(index)(limits). Some require a dummy index.

For more information on the data available see the print command.

You can add to or delete from an existing list by prefixing with + or -. alarm ac + v(3) adds v(3) to the existing set of AC probes. alarm ac - q(c5) removes q(c5) from the list. You can use the wildcard characters * and ? when deleting.

2.6.4  Examples

alarm ac vm(12)(0,5) vm(13)(-5,5)
Check magnitude of the voltage at node 12 against a range of 0 to 5, and node 13 against a range of -5 to 5 for AC analysis. Print a warning when the limits are exceeded.

alarm op id(m*)(-100n,100n)
Check current in all mosfets. In op analysis, print a warning for any that are outside the range of -100 to +100 nanoamps. The range goes both positive and negative so it is valid for both N and P channel fets.

alarm tran v(r83)(0,5) p(r83)(0,1u)
Check the voltage and power of R83 in the next transient analysis. The voltage range is 0 to 5. The power range is 0 to 1 microwatt. Print a warning when the range is exceeded.

alarm
List all the probes for all modes.

alarm dc
Display the DC alarm list.

alarm ac CLear
Clear the AC list.

2.7  ALTER command

alter command sweep command sweep components step components The Spice Alter command is not implemented. Similar functionality is available from the sweep command.

2.8  BUILD command

build command new circuit creating new circuit add to circuit

2.8.1  Syntax

Build {line}

2.8.2  Purpose

Builds a new circuit, or replaces lines in an existing one.

2.8.3  Comments

Build Lets you enter the circuit from the keyboard. The prompt changes to > to show that the program is in the build mode.

At this point, type in the circuit components in standard (Spice type) netlist format.

Component labels must be unique. If not, the old one is modified according to the new data, keeping old values where no new ones were specified.

Ordinarily, components are added to the end of the list. To insert at a particular place, specify the label to insert in front of. Example: Build R77 will cause new items to be added before R77, instead of at the end.

In either case, components being changed or replaced do not change their location in the list.

If it is necessary to start over, delete all or clear will erase the entire circuit in memory.

To exit this mode, enter a blank line.

2.8.4  Examples

build
Build a circuit. Add to the end of the list. This will add to the circuit without erasing anything. It will continue until you exit or memory fills up.

b
This is the same as the previous example. Only the first letter of the `Build' is necessary.

build R33
Insert new items in front of R33.

2.9  CHDIR command

chdir command cd command change directory directory: change

2.9.1  Syntax

ChDir {path}
CD {path}

2.9.2  Purpose

Changes or displays the current directory name.

2.9.3  Comments

Change the current directory to that specified by path. See your system manual for complete syntax.

If no argument is given the current directory is displayed.

2.9.4  Examples

cd ../ckt
Change the current working directory to ../ckt.

cd
Show the current working directory name.

2.10  CLEAR command

clear command clear circuit erase title: clear

2.10.1  Syntax

CLEAR

2.10.2  Purpose

Deletes the entire circuit, and blanks the title.

2.10.3  Comments

The entire word clear is required.

Clear is similar to, but a little more drastic than delete all.

After deleting anything, there is no way to get it back.

See also: delete command.

2.10.4  Examples

clear
Delete the entire circuit.

2.11  DC command

dc command transfer characteristics nonlinear transfer analysis

2.11.1  Syntax

DC start stop stepsize {options ...}
DC label start stop stepsize {options ...}

2.11.2  Purpose

Performs a nonlinear DC steady state analysis, and sweeps the signal input, or a component value.

2.11.3  Status

Nesting of sweeps is not supported. (SPICE supports two levels of nesting.)

2.11.4  Comments

The nodes to look at must have been previously selected by the print or plot command.

If there are numeric arguments, without a part label, they represent a ramp from the generator function. They are the start value, stop value and step size, in order. They are saved between commands, so no arguments will repeat the previous sweep.

A single parameter represents a single input voltage. Two parameters instruct the computer to analyze for those two points only.

In some cases, you will get one more step outside the specified range of inputs due to internal rounding errors. The last input may be beyond the end point.

This command also sets up a movable operating point for subsequent AC analysis, which can be helpful in distortion analysis.

The program will sweep any simple component, including resistors, capacitors, and controlled sources. SPICE sweeps only fixed sources (types V and I).

2.11.5  Options

* multiplier
Log sweep. Multiply the input by multiplier to get the next step. Do not pass zero volts!!

> file
Send results of analysis to file.

>> file
Append results to file.

BY stepsize
Linear sweep. Add stepsize to get the next step.

Continue
Use the last step of a OP, DC or Transient analysis as the first guess.

Decade steps
Log sweep. Use steps steps per decade.

LOop
Repeat the sweep, backwards.

NOPlot
Suppress plotting.

PLot
Graphic output, when plotting is normally off.

Print
Send results to printer.

Quiet
Suppress console output.

REverse
Sweep in the opposite direction.

TEmperature degrees
Temperature, degrees C.

Times multiplier
Log sweep. Multiply the input by multiplier to get the next step. Do not pass zero volts!!

TRace n
Show extended information during solution. Must be followed by one of the following:
Off
No extended trace information (default, override .opt)
Warnings
Show extended warnings
Iterations
Show every iteration.
Verbose
Show extended diagnostics.

2.11.6  Examples

dc 1
Do a single point DC signal simulation, with `1 volt' input.

dc -10 15 1
Sweep the circuit input from -10 to +15 in steps of 1. (usually volts.) Do a DC transfer simulation at each step.

dc
With no parameters, it uses the same ones as the last time. In this case, from -10 to 15 in 1 volt steps.

dc 20 0 -2
You can sweep downward, by asking for a negative increment. Sometimes, this will result in better convergence, or even different results! (For example, in the case of a bi-stable circuit.)

dc
Since the last time used the input option, go back one more to find what the sweep parameters were. In this case, downward from 20 to 0 in steps of 2. (Because we did it 2 commands ago.)

dc -2 2 .1 loop
After the sweep, do it again in the opposite direction. In this case, the sweep is -2 to +2 in steps of .1. After it gets to +2, it will go back, and sweep from +2 to -2 in steps of -.1. The plot will be superimposed on the up sweep. This way, you can see hysteresis in the circuit.

dc temperature 75
Simulate at 75 degrees, this time. Since we didn't specify new sweep parameters, do the same as last time. (Without the loop.)

2.12  DELETE command

delete command clear circuit erase remove parts

2.12.1  Syntax

DELete label ...
DELete ALL

2.12.2  Purpose

Remove a line, or a group of lines, from the circuit description.

2.12.3  Comments

To delete a part, by label, enter the label. (Example `DEL R15'.) Wildcards `*' and `?' are allowed, in which case, all that match are deleted.

To delete the entire circuit, the entire word ALL must be entered. (Example `DEL ALL'.)

After deleting anything, there is usually no way to get it back, but if a fault had been applied (see fault command) restore may have surprising results.

2.12.4  Examples

delete all
Delete the entire circuit, but save the title.

del R12
Delete R12.

del R12 C3
Delete R12 and C3.

del R*
Delete all resistors. (Also, any models and subcircuits starting with R.)

2.13  DISTO command

disto command distortion The Spice disto command is not implemented. Similar functionality is not available.

2.14  EDIT command

edit command

2.14.1  Syntax

Edit
Edit file

2.14.2  Purpose

Use your editor to change the circuit.

2.14.3  Comments

The edit command runs your editor on a copy of the circuit in memory, then reloads it.

Edit file runs your editor on the specified file.

If you are only changing a component value, the modify command may be easier to use.

The program uses the EDITOR environment variable to find the editor to use. The command fails if there is no EDITOR defined.

2.14.4  Examples

edit
Brings up your editor on the circuit.

edit foo
Edits the file foo in your current directory.

2.15  END command

end command When run in batch mode from the shell, the END command cleans up and exits the program.

In script mode (< command) it ends the script and returns to the program prompt.

In interactive mode it exits the program.

2.16  EXIT command

quit command exit command

2.16.1  Syntax

EXIt

2.16.2  Purpose

Terminates the program.

2.16.3  Comments

`Quit' also works.

Be sure you have saved everything you want to!

2.17  FANOUT command

fanout command view circuit connection list node list list by node

2.17.1  Syntax

FANout {nodes}

2.17.2  Purpose

Lists connections to each node.

2.17.3  Comments

Fanout lists the line number and label of each part connected to each node. If both ends of a part are connected the same place, it is listed twice.

For a partial list, just specify the numbers. A number alone (17) says this branch alone. A trailing dash (23-) says from here to the end. A leading dash (-33) says from the start to here. Two numbers (9 13) specify a range.

2.17.4  Examples

fanout
Lists all the nodes in the circuit, with their connections.

fanout 99
List parts connecting to node 99.

fanout 0
List the connections to node 0. (There must be at least one, unless you are editing a model.)

fanout 78-
List connections to nodes 78 and up.

fanout 124 127
List connections to nodes 124, 125, 126, 127.

2.18  FAULT command

fault command change values: temporary

2.18.1  Syntax

FAult partlabel=value ...

2.18.2  Purpose

Temporarily change a component value.

2.18.3  Comments

This command quickly changes the value of a component, usually with the intention that you will not want to save it.

If you apply this command to a nonlinear or otherwise strange part, it becomes ordinary and linear until the fault is removed.

It is an error to fault a model call.

If several components have the same label, the fault value applies to all of them. (They will all have the same value.)

The unfault command restores the old values.

2.18.4  Example

fault R66=1k
R66 now has a value of 1k, regardless of what it was before.

fault C12=220p L1=1u
C12 is 220 pf and L1 is 1 uH, for now.

unfault
Clears all faults. It is back to what it was before.

2.19  FOURIER command

fourier command spectrum analysis frequency domain: nonlinear nonlinear analysis: frequency domain

2.19.1  Syntax

Fourier start stop stepsize {options ...}

2.19.2  Purpose

Performs a nonlinear time domain (transient) analysis, but displays the results in the frequency domain.

Start, stop, and stepsize are frequencies.

2.19.3  Comments

This command is slightly different and more flexible than the SPICE counterpart. SPICE always gives you the fundamental and 9 harmonics. Gnucap will do the same if you only specify one frequency. SPICE has the probes on the same line. Gnucap requires you to specify the probes with the print command.

SPICE uses the last piece of a transient that was already done. Gnucap does its own transient analysis, continuing from where the most recent one left off, and choosing the step size to match the Fourier Transform to be done. Because of this the Gnucap Fourier analysis is much more accurate than SPICE.

The nodes to look at must have been previously selected by the print or plot command.

Three parameters are normally needed for a Fourier analysis: start frequency, stop frequency and step size, in this order.

If the start frequency is omitted it is assumed to be 0. The two remaining parameters are stop and step, such that stop > step.

If only one frequency is specified, it is assumed to be step size, which is equivalent to the fundamental frequency. The start frequency is zero and the stop frequency is set according the harmonics option (from the options command. The default is 9 harmonics.

If two frequencies are specified, they are stop and step. The order doesn't matter since stop is always larger than step.

Actually, this command does a nonlinear time domain analysis, then performs a Fourier transform on the data to get the frequency data. The transient analysis parameters (start, stop, step) are determined by the program as necessary to produce the desired spectral results. The internal time steps are selected to match the Fourier points, so there is no interpolation done.

The underlying transient analysis begins where the previous one left off. If you specify the "cold" option, it begins at time = 0. Often repeating a run will improve the accuracy by giving more time for initial transients to settle out.

See also: Transient command.

2.19.4  Options

> file
Send results of analysis to file.

>> file
Append results to file.

Cold
Zero initial conditions. Cold start from power-up.

Quiet
Suppress console output.

SKip count
Force at least count internal transient time steps for each one used.

STiff
Use a different integration method, that will suppress overshoot when the step size is too small.

TEmperature degrees
Temperature, degrees C.

TRACe n
Show extended information during solution. Must be followed by one of the following:
Off
No extended trace information (default, override .opt)
Warnings
Show extended warnings
Alltime
Show all accepted internal time steps.
Rejected
Show all internal time steps including rejected steps.
Iterations
Show every iteration.
Verbose
Show extended diagnostics.

2.19.5  Examples

fourier 1Meg
Analyze the spectrum assuming a fundamental frequency of 1 mHz. Use the harmonics option to determine how many harmonics (usually 9) to display.

fourier 40 20k 20
Analyze the spectrum from 40 Hz to 20 kHz in 20 Hz steps. This will result in a transient analysis with 25 micro-second steps. (1 / 40k). It will run for .05 second. (1 / 20).

fourier 0 20k 20
Similar to the previous example, but show the DC and 20 Hz terms, also.

fourier
No parameters mean use the same ones as the last time. In this case: from 0 to 20 kHz, in 20 Hz steps.

fourier Skip 10
Do 10 transient steps internally for every step that is used. In this case it means to internally step at 2.5 micro-second, or 10 steps for every one actually used.

fourier Cold
Restart at time = 0. This will show the spectrum of the power-on transient.

2.20  GENERATOR command

Generator command user defined transient input user source transient input input: transient analysis function generator

2.20.1  Syntax

Generator {option-name=value ...}

2.20.2  Purpose

Sets up an input waveform for transient and Fourier analysis. Emulates a laboratory type function generator.

2.20.3  Comments

This command sets up a singal source that is conceptually separate from the circuit. To use it, make the value of a component "generator(1)", or substitute a scale factor for the parameter.

The SPICE style input functions also work, but are considered to be part of the circuit, instead of part of the test equipment.

The parameters available are designed to emulate the controls on a function generator. There are actually two generators here: sine wave and pulse. If both are on (by setting non-zero parameters) the sine wave is modulated by the pulse, but either can be used alone.

Unless you change it, it is a unit-step function at time 0. The purpose of the command is to change it.

This command does not affect AC or DC analysis in any way. It is only for transient and Fourier analysis. In AC analysis, the input signal is always a sine wave at the analysis frequency.

Typical usage is the name of the control followed by its value, or just plain Generator to display the present values.

The actual time when switching takes place is ambiguous by one time step. If precise time switching is necessary, use the Skip option on the transient analysis command, to force more resolution. This ambiguity can usually be avoided by specifying finite rise and fall times. ambiguous time switch time errors

2.20.4  Parameters

Frequency
The frequency of the sine wave generator for a transient analysis. The sine wave is modulated by the pulse generator. A frequency of zero puts the pulse generator on line directly.

Amplitude
The overall amplitude of the pulse and sine wave. A scale factor. It applies to everything except the offset and init values.

Phase
The phase of the sine wave, at the instant it is first turned on.

MAx
The amplitude of the pulse, when it is `on'. (During the width time) If the sine wave is on (frequency not zero) this is the amplitude of the sine wave during the first part of the period. The max is scaled by ampl.

MIn
The amplitude of the pulse, when it is `off'. (After it falls, but before the next period begins.) Although we have called these min and max, there is no requirement that max be larger than min. If the sine wave is on, this is its amplitude during the second part of the period. The min is scaled by ampl.

Offset
The DC offset applied to the entire signal, at all times after the initial delay. The offset is not scaled by ampl.

Init
The initial value of the pulse generator output. It will have this value starting at time 0, until Delay time has elapsed. It will never return to this value, unless you restart at time 0.

Rise
The rise time, or the time it takes to go from MIn to MAx, or for the first rise, Init to MAx. The rise is linear.

Fall
The fall time. (The time required to go from MAx back to MIn.)

Delay
The waiting time before the first rise.

Width
The length of time the output of the generator has the value Max. A width of zero means that the output remains high for the remainder of the period. If you really want a width of zero, use a very small number, less than the step size.

Period
The time for repetition of the pulse. It must be greater than the sum of rise + fall + width. A period of zero means that the signal is not periodic and so will not repeat.

2.20.5  Examples

The generator command ...
gen
Display the present settings.

gen Freq=1k
Sets the sine wave to 1 kHz. All other parameters are as they were before.

gen Freq=0
Turns off the sine wave, leaving only the pulse.

gen Ampl=0
Sets the amplitude to zero, which means the circuit has no input, except for possibly a DC offset.

gen Period=.001 Freq=1m
Sets the period back to 1 millisecond. Applies 1 mHz modulation to the pulse, resulting in a pulsed sine wave. In this case, a 100 microsecond 10 volt burst, repeating every millisecond. Between bursts, you will get 2.5 volts, with reversed phase. The old values, in this case from 2 lines back (above) are kept. (Ampl 5 Rise 10u Fall 10u ...)

gen Freq=60 Phase=90 Delay=.1
The sine wave frequency is 60 Hertz. Its phase is 90 degrees when it turns on, at time .1 seconds. It turns on sharply at the peak.
A component using it ...
V12 1 0 generator(1)
Use the generator as the circuit input through this voltage source. The DC and AC values are 0.

V12 1 0 tran generator(1) ac 10 dc 5
Same as before, except that the AC value is 10 and DC value is 5.

Rinput 1 0 tran generator(1)
Unlike SPICE, the functions can be used on other components. The resistance varies in time according to the "generator".

2.21  GET command

get command load circuit from file read circuit from file retrieve circuit from file file: get file: read

2.21.1  Syntax

GET filename

2.21.2  Purpose

Gets an existing circuit file, after clearing memory.

2.21.3  Comments

The first comment line of the file being read is taken as the `title'. See the title command.

Comments in the circuit file are stored, unless they start with *+ in which case they are thrown away.

`Dot cards' are set up, but not executed. This means that variables and options are changed, but simulation commands are not actually done. As an example, the options command is actually performed, since it only sets up variables. The ac card is not performed, but its parameters are stored, so that a plain ac command will perform the analysis specified in the file.

Any circuit already in memory will be erased before loading the new circuit.

2.21.4  Examples

get amp.ckt
Get the circuit file amp.ckt from the current directory.

get /usr/foo/ckt/amp.ckt
Get the file amp.ckt from the /usr/foo/ckt directory.

get npn.mod
Get the file npn.mod.

2.22  IC command

ic command initial conditions The Spice IC command is not implemented. Similar functionality is not available.

2.23  INSERT command

insert command nodes: insert

2.23.1  Syntax

INsert node
INsert node, count

2.23.2  Purpose

Open up node numbers inside a circuit.

2.23.3  Comments

To open up an internal node, enter insert followed by the number and how many. All node numbers higher than the first number will be raised by the second. The second (how many) is optional. If omitted, 1 will be assumed.

2.23.4  Examples

insert 8 3
Insert 3 nodes before node 8. Adds 3 nodes (8,9,10) with no connections. Old node numbers 8 and higher have 3 added to them to make room. Old node 8 is now 11, 9 is now 12, 10 is now 13, 11 is 14, etc.

insert 6
Insert one node at 6. Old nodes 6 and higher are incremented by 1. Old node 6 is now 7, 7 is 8, etc.

2.24  LIST command

list command view circuit connection list parts list list by branch

2.24.1  Syntax

List {label ...}
List {label - label}

2.24.2  Purpose

Lists the circuit in memory.

2.24.3  Comments

Plain List will list the whole circuit on the console.

List with a component label asks for that one only. Wildcards are supported: ? matches any character, once. * matches zero or more of any character.

For several components, list them.

For a range, specify two labels separated by a dash.

2.24.4  Examples

list
List the entire circuit to the console.

list R11
Show the component R11.

list D12 - C5
List the part of the netlist from M12 to C5, inclusive. D12 must be before C5 in the list.

list D* C*
List all diodes and capacitors.

2.25  LOG command

log command batch mode files disk files command record record of commands i-o redirection redirection: i-o

2.25.1  Syntax

LOg file
LOg >> file
LOg

2.25.2  Purpose

Saves a copy of your keyboard entries in a file.

2.25.3  Comments

The `>>' option appends to an existing file, if it exists, otherwise it creates one.

Files can be nested. If you open one while another is already open, both will contain all the information.

A bare LOg closes the file. Because of this, the last line of this file is always LOg. Ordinarily, this will not be of any consequence, but if a log file is open when you use this file as command input, this will close it. If more than one LOg file is open, they will be closed in the reverse of the order in which they were opened, maintaining nesting.

See also: `>' and `<' commands.

2.25.4  Bugs

The file is an exact copy of what you type, so it is suitable for gnucap <file from the shell. It is NOT suitable for the < command in gnucap or the Spice-like mode gnucap file without <.

2.25.5  Examples

log today
Save the commands in a file today in the current directory. If today already exists, the old one is gone.

log >> doit
Save the commands in a file doit. If doit already exists, it is kept, and the new data is added to the end.

log runit.bat
Use the file runit.bat.

log
Close the file. Stop saving.

2.26  MARK command

mark command transient reruns

2.26.1  Syntax

MArk

2.26.2  Purpose

Remember circuit voltages and currents.

2.26.3  Comments

After the mark command, the transient and fourier analysis will continue from the values that were kept by the mark command, instead of progressing every time.

This allows reruns from the same starting point, which may be at any time, not necessarily 0.

2.26.4  Examples

transient 0 1 .01
A transient analysis starting at zero, running until 1 second, with step size .01 seconds. After this run, the clock is at 1 second.

mark
Remember the time, voltages, currents, etc.

transient
Another transient analysis. It continues from 1 second, to 2 seconds. (It spans 1 second, as before.) This command was not affected by the mark command.

transient
This will do exactly the same as the last one. From 1 second to 2 seconds. If it were not for mark, it would have started from 2 seconds.

transient 1.5 .001
Try again with smaller steps. Again, it starts at 1 second.

unmark
Release the effect of mark.

transient
Exactly the same as the last time, as if we didn't unmark. (1 to 1.5 seconds.)

transient
This one continues from where the last one left off: at 1.5 seconds. From now on, time will move forward.

2.27  MERGE command

merge command load circuit from file read circuit from file retrieve circuit from file file: get file: merge file: read

2.27.1  Syntax

MErge filename

2.27.2  Purpose

Gets an existing circuit file, without clearing memory.

2.27.3  Comments

The first comment line of the file being read is the new title, and replaces the existing title.

Comments in the circuit file are stored, unless they start with *+ in which case they are thrown away.

`Dot cards' are set up, but not executed. This means that variables and options are changed, but simulation commands are not actually done. As an example, the options command is actually performed, since it only sets up variables. The ac command is not performed, but its parameters are stored, so that a plain ac command will perform the analysis specified in the file.

Any circuit already in memory is kept. New elements with duplicate labels replace the old ones. New elements that are not duplicates are added to the end of the list, as if the files were appended.

2.27.4  Examples

merge amp.ckt
Get the circuit file amp.ckt from the current directory. Use it to change the circuit in memory.

merge npn.mod
Include the file npn.mod.

2.28  MODIFY command

modify command

2.28.1  Syntax

MOdify partlabel=value ...

2.28.2  Purpose

Quickly change a component value.

2.28.3  Comments

This command quickly changes the value of a component. It is restricted to simply changing the value.

If several components have the same label or if wildcard characters are used, all are changed.

2.28.4  Example

modify R66=1k
R66 now has a value of 1k, regardless of what it was before.

modify C12=220p L1=1u
C12 is 220 pf and L1 is 1 uH.

mod R*=22k
All resistors are now 22k.

2.29  NODESET command

nodeset command The Spice NODESET command is not implemented. Similar functionality is not available.

2.30  NOISE command

noise command The Spice NOIse command is not implemented. Similar functionality is not available.

2.31  OP command

op command operating point bias analysis nonlinear bias analysis temperature sweep quiescent conditions

2.31.1  Syntax

OP start stop stepsize {options ...}

2.31.2  Purpose

Performs a nonlinear DC steady state analysis, with no input. If a temperature range is given, it sweeps the temperature.

2.31.3  Comments

There are substantial extensions beyond the capabilities of the SPICE op command.

If there are numeric arguments, they represent a temperature sweep. They are the start and stop temperatures in degrees Celsius, and the step size, in order. They are saved between commands, so no arguments will repeat the previous sweep.

This command will use the op probe set, instead of automatically printing all nodes and source currents, so you must do "print op ...." before running op. We did it this way because we believe that printing everything all the time is usually unnecessary clutter. All of the information available from SPICE and more is available here. See the print command and the device descriptions for more details.

A single parameter represents a single temperature. Two parameters instruct the computer to analyze for those two points only.

This command also sets up the quiescent point for subsequent AC analysis. It is necessary to do this for nonlinear circuits. The last step in the sweep determines the quiescent point for the AC analysis.

2.31.4  Options

* multiplier
Log sweep. Multiply the absolute temperature by multiplier to get the next step. The fact that it is offset to absolute zero may make the step sizes look strange.

> file
Send results of analysis to file.

>> file
Append results to file.

BY stepsize
Linear sweep. Add stepsize to get the next step.

Continue
Use the last step of a OP, DC or Transient analysis as the first guess.

Input volts
Apply volts input to the circuit, instead of zero.

LOop
Repeat the sweep, backwards.

PLot
Graphic output, when plotting is normally off.

Print
Send results to printer.

Quiet
Suppress console output.

REverse
Sweep in the opposite direction.

TAble
Tabular output. Override default plot.

TEmperature degrees
Temperature, degrees C. Override the sweep.

TImes multiplier
Log sweep. Multiply the absolute temperature by multiplier to get the next step.

TRace n
Show extended information during solution. Must be followed by one of the following:
Off
No extended trace information (default, override .opt)
Warnings
Show extended warnings
Iterations
Show every iteration.
Verbose
Show extended diagnostics.

2.31.5  Examples

op 27
Do a DC operating point simulation at temperature 27 degrees Celsius.

op -50 200 25
Sweep the temperature from -50 to 200 in 25 degree steps. Do a DC operating point simulation at each step.

op
With no parameters, it uses the same ones as the last time. In this case, from -50 to 200 in 25 degree steps.

op 200 -50 -25
You can sweep downward, by asking for a negative increment.

op Input 2.3
Apply an input to the circuit of 2.3 volts. This overrides the default of no input.

op TEmperature 75
Simulate at 75 degrees, this time. This isn't remembered for next time.

op
Since the last time used the TEmperature option, go back one more to find what the sweep parameters were. In this case, downward from 200 to -50 in 25 degree steps. (Because we did it 3 commands ago.)

2.32  OPTIONS command

options command set command system options options: global global options

2.32.1  Syntax

OPTions
OPTions option-name value ...

2.32.2  Purpose

Sets options, iteration parameters, global data.

2.32.3  Comments

Typical usage is the name of the item to set followed by the value.

The bare command `OPTions' displays the values.

These options control the simulation by specifying how to handle marginal circumstances, how long to wait for convergence, etc.

Most of the SPICE options are supported, more have been added.

2.32.4  Parameters



accounting ACCT
Turns on accounting. When enabled, print the CPU time used after each command, and a summary on exit in batch more. This does not affect accounting done by the status command.

NOACCT
Turns off accounting. (Not in SPICE.)

echo file input
LIST
Turns on echo of files read by get and merge commands, and in batch mode. (SPICE option accepted but not implemented.)

NOLIST
Turns off list option. (Not in SPICE.)

MOD
Enable printout of model parameters. (Accepted, but not implemented, to complement NOMOD.)

NOMOD
Suppress printout of model parameters. (SPICE option accepted but not implemented.)

PAGE
Enable page ejects at the beginning of simulation runs. (Accepted, but not implemented, to complement NOPAGE.)

NOPAGE
Turn off page ejects. (SPICE option accepted but not implemented.)

NODE
Enable printing of the node table. (SPICE option accepted but not implemented.)

NONODE
Disable printing of the node table. (Accepted, but not implemented, to complement NODE.)

OPTS
Enable printing of option values on every options command.

NOOPTS
Disable automatic printing of option values. Option values are only printed on a null options command.

gmin option minimum conductance open circuit error
GMIN = x
Minimum conductance allowed by the program. (Default = 1e-12 or 1 picomho.) Every node must have a net minimum conductance of GMIN to ground. If effective open circuits are found during the solution process (leading to a singular matrix) a conductance of GMIN is forced to ground, after printing an "open circuit" error message.

reltol option relative tolerance convergence criteria
RELTOL = x
Relative error tolerance allowed. (Default =.001 or .1%.) If the ratio of successive values in iteration are within RELTOL of one, this value is considered to have converged.

abstol option absolute tolerance convergence criteria
ABSTOL = x
Absolute error tolerance allowed. (Default = 1e-12) If successive values in iteration are within ABSTOL of each other, this value is considered to have converged.

vntol option voltage tolerance model evaluation bypass
VNTOL = x
Absolute voltage error required to force model re-evaluation. (Default = 1e-12 or 1 microvolt.) If the voltage at the terminals of a model is within VNTOL of the previous iteration, the model is not re-evaluated. The old values are used directly.

trtol option transient error tolerance
TRTOL = x
Transient error ``tolerance''. (Default = 7.) This parameter is an estimate of the factor by which the program overestimates the actual truncation error.

chgtol option charge error tolerance
CHGTOL = x
Charge tolerance. (Default = 1e-14) It is used in step size control in transient analysis.

pivtol option pivot tolerance
PIVTOL = x
Pivot tolerance. (Default = 1e-13) SPICE option accepted but not implemented.

pivrel option
PIVREL = x
Pivot ratio. (Default = 1e-3) SPICE option accepted but not implemented.

numdgt option
NUMDGT = x
Number of significant digits to print for analysis results. (Default = 5.) It is silently limited to 3 to 20.

tnom option temperature nominal temperature reference temperature
TNOM = x
Nominal temperature. (Default = 27° C.) All components have their nominal value at this temperature.

iteration count itl? options
ITL1 = x
DC iteration limit. (Default = 100.) Sets the maximum number of iterations in a DC, OP, or initial transient analysis allowed before stopping and reporting that it did not converge.

ITL2 = x
DC transfer curve iteration limit. (Default = 50.) SPICE option accepted but not implemented. Use ITL1 instead.

ITL3 = x
Lower transient iteration limit. (Default = 4.) If the number of iterations is more than ITL3 the step size will not increase beyond its present size. Otherwise, it can grow by trstepgrow.

ITL4 = x
Upper transient iteration limit. (Default = 10.) Sets the maximum number of iterations on a step in transient analysis. If the circuit fails to converge in this many iterations the step size is reduced (by option trstepshrink), time is backed up, and the calculation is repeated.

ITL5 = x
Transient analysis total iteration limit. (Default = 5000.) SPICE option accepted but not implemented. Actual behavior is the same as ITL5 = 0, in SPICE, which omits this test.

ITL6 = x
Source stepping iteration limit. (Default = 0.) SPICE option accepted but not implemented. Source stepping is not available.

worst case iterations iterations: worst case analysis
ITL7 = x
Worst case analysis iteration limit. (Default = 1.) Sets the maximum number of iterations for the individual element trials in a DC or bias worst case analysis. If more iterations than this are necessary, the program silently goes on to the next step, as if nothing was wrong, which is usually the case.

convergence diagnostics
ITL8 = x
Convergence diagnostic iteration threshold. (Default = 100.) If the iteration count on a step exceeds ITL8 diagnostic messages are printed in an attempt to aid the user in solving the convergence problem.

cptime option cpu time limit
CPTIME = x
Total CPU job time limit. (Default = 30000.) SPICE option accepted but not implemented. There is no limit imposed.

limtim option
LIMTIM = x
CPU time reserved for plotting. (Default = 2.) SPICE option accepted but not implemented.

limpts option
LIMPTS = x
Max number of points printed. (Default = 201.) SPICE option accepted but not implemented.

lvlcod option
LVLCOD = x
Matrix solution and allocation method. (Default = 2, generate machine language.) SPICE option not implemented.

lvltim option time step control
LVLTIM = x
Time step control method. (Default = 2, truncation error.) SPICE option not implemented.

method option integration method
METHOD = x
Integration method. (Default = TRAPezoidal.) Possible values are:
EULER
backward Euler, unless forced to other
EULERONLY
backward Euler only
TRAP
usually trap, but Euler where better
TRAPONLY
always trapezoid
defl option mosfet defaults
DEFL = x
MOSFET default channel length in meters. (Default = 100u.)

defw option
DEFW = x
MOSFET default channel width in meters. (Default = 100u.)

defad option
DEFAD = x
MOSFET default drain diffusion area in square meters. (Default = 0.)

defas option
DEFAS = x
MOSFET default source diffusion area in square meters. (Default = 0.)

seed option random number seed
SEED = x
Seed used by the random number generator. (Default = 1.) (ECA-2 equivalent = Random.) (Not available in SPICE.) The same random numbers will be used every time, determined by this seed number. Setting this to zero is a special case, causing each run to start from a random point.

wczero option zero: worst case
WCZERO = x
Worst case zero window. (Default = 1e-9) (Not available in SPICE.) Sets a window for the difference in a DC or bias worst case analysis. Differences less than this are assumed to be zero, for purposes of setting direction flags. This prevents cluttering up the screen with very small numbers that are essentially zero.

damp option damped Newton's method
DAMPMAX = x
Normal Newton damping factor. (Default = 1.) Sets the damping factor for iteration by damped Newton's method, used when all is well. It must be between 0 and 1, as close to 1 as possible and still achieve convergence. The useful range is from .9 to 1. Setting DAMPMAX too low will probably cause convergence to a nonsense result.

DAMPMIN = x
Newton damping factor in problem cases. (Default = .5) Sets the damping factor for iteration by damped Newton's method, used when there are problems. It must be between 0 and 1, and is usually set somewhat less than DAMPMAX. The useful range is from .5 to .9. Setting it lower than .5 may cause convergence to a nonsense result. Aside from that, a lower value (but less than DAMPMAX) tends to improve robustness at the expense of convergence speed.

DAMPSTrategy = x
Damping strategy. (Default = 0) The actual damping factor to use is determined by heuristics. Normally the damping factor is DAMPMAX. It is reduced to DAMPMIN when certain conditions occur, then it drifts back up on subsequent iterations. This parameter turns the various heuristics on or off. The number to use is the sum of the following flags.
1 the second iteration on any voltage or time step. (usually helps robustness, but always increases iteration count.)

2 if the voltage at any nonlinear node exceeds the range determined by VMIN, VMAX, and LIMIT. (usually not desirable.)

4 if any device limiting algorithm is activated. (usually not desirable.)

10 when any device crosses a region boundary. (usually desirable and has little cost.)

20 when a FET or BJT is reversed. (usually helps robustness. sometimes increases iteration count.)
floor option suppressing numerical noise
FLOOR = x
Effective zero value. (Default = 1e-21) Results values less than FLOOR are shown as zero. Other small numbers are rounded to the nearest FLOOR.

VFLOOR = x
Effective zero value for voltage probes. (Default = 1e-15) Results values less than VFLOOR are shown as zero. Other small numbers are rounded to the nearest VFLOOR.

tempamb option ambient temperature
TEMPAMB = x
Simulation temperature. (Default = 27° C.) Sets the ambient temperature, in degrees Celsius. This is the temperature at which the simulation takes place, unless changed by some other command.

short option short circuit resistance voltage source resistance resistance of short
Short = x
Resistance of voltage source or short. (Default = 1e-7 or 10 µW.) Sets the default resistance of voltage sources. In some cases, inductors are replaced by resistors, if so, this is the value. It is also the resistance used to replace short circuits anywhere they are not allowed and the program finds one.

transits option mixed mode control
TRansits = x
Mixed mode transition count. (Default = 2) Sets the number of ``good'' transitions for a supposedly digital signal to be accepted as digital.

in option input width option width command
IN = x
Input width. (Default = 80.) Sets the last column read from each line of input. Columns past this are ignored. This option is present only for SPICE compatibility, through the width command, which is an alias for options.

out option output width option
OUT = x
Output width. (Default = 80.) Sets the output print width, for tables and character graphics.

xdivisions option plot control
XDivisions = x
X axis divisions. (Default = 4) Sets the number of divisions on the X axis for plotting.

ydivisions option plot control
YDivisions = x
Y axis divisions. (Default = 4) Sets the number of divisions on the Y axis for plotting.

ORder = x
Equation ordering. (Default = auto.) Determines how external node numbers are mapped to internal numbers. The values are FORward, REVerse, and AUTo.

MODe = x
Simulation mode selection. (Default = mixed.) Values are ANAlog, DIGital, and MIXed. In analog mode, logic elements (type U) are replaced by their subcircuits as if they were type X. In digital mode, logic elements are simulated as digital regardless of whether the signals are proper or not, as in traditional mixed-mode simulation. In mixed mode, logic elements may be simulated as analog or digital depending on the signals present.

bypass option
BYPass
Bypass model evaluation if appropriate. If the last two iterations indicate that an element is converged or dormant, do not evaluate it but use its old values directly. (Default)

vbypass option
VBYpass
Check only voltage to bypass model evaluation. This produces a faster but possibly less accurate simulation.

NOBYpass
Do not bypass model evaluation.

lubypass option
LUBypass
Bypass parts of LU decomposition if appropriate. If only a few elements of the matrix were changed solve only those parts of the LU matrix that depend on them. (Default)

NOLUbypass
Do not bypass parts of LU decomposition. Solve the entire LU matrix whenever a matrix solution is called for regardless of whether it is actually needed.

incmode option
INCmode
Incrementally update the matrix. Instead of rebuilding the matrix on every iteration, keep as much of the old matrix as possible and make incremental changes. (Default)

NOIncmode
Do not incrementally update the matrix. This eliminates a possible cause of roundoff error at the expense of a slower simulation.

TRACELoad
Use a queue to only load changed elements to the matrix. This results in faster loading and has no known drawbacks. (Default)

NOTRACELoad
Do not use a queue to only load changed elements to the matrix. Instead, load all elements, even if they are unchanged or zero. This is always slower, and is forced if "noincmode".

limit option voltage limiting
LIMIT = x
Internal differential branch voltage limit. (Default = 1e10, essentially disabled.) All circuit branch voltages may be limited to ± x to aid in convergence. This is intended as a convergence aid only. It may or may not help.

VMIN = x
Negative node voltage limit. (Default = -30) All node voltages may be limited to -x to aid in convergence and prevent numeric overflow. This is intended as a convergence aid only. It may or may not help.

VMAX = x
Positive node voltage limit. (Default = 30) All node voltages may be limited to +x to aid in convergence and prevent numeric overflow. This is intended as a convergence aid only. It may or may not help.

dtmin option minimum resolvable time minimum time step
DTMIn = x
Minimum time step. (Default = 1e-12.) The smallest internal time step in transient analysis. The transient command dtmin option and the dtratio option override it if it is bigger.

DTRatio = x
The ratio between minimum and maximum time step. (Default = 1e9).

rstray option mosfet series resistance
RSTray
Include series resistance in device models. This creates internal nodes and results in a significant speed and memory penalty. It also makes convergence characteristics worse.

NORSTray
Do not include series resistance in device models. This results in faster simulations and better numerical accuracy at the expense of model accuracy. Differences between rstray and norstray have been observed to be insignificant most of the time. Some popular commercial versions of SPICE do not implement series resistance at all, so norstray may be more consistent with other simulators.(Default)

cstray option mosfet capacitance diode capacitance
CSTray
Include capacitance in device models. This may create internal nodes and result in a significant speed and memory penalty. It also may make convergence characteristics worse. (Default)

NOCSTray
Do not include capacitance in device models. This results in faster simulations and better numerical accuracy at the expense of model accuracy. Differences between cstray and nocstray are usually significant, since often the strays are the dominant reactive elements.

harmonics option fourier: harmonics
Harmonics = x
Harmonics in Fourier analysis. (Default = 9) The number of harmonics to display in a Fourier analysis, unless specified otherwise.

TRSTEPGrow = x
The maximum internal step size growth in transient analysis. (Default = 2.)

TRSTEPShrink = x
The amount to decrease the transient step size by when convergence fails. (Default = 8.)

TRReject = x
Transient error rejection threshold. (Default = .5) Controls how bad the truncation error must be to reject a time step. A value of .5 means that if the step reqested is smaller than .5 times the step size used, the current step will be rejected. If the new step is .8 times the old step size it will be adjusted but the step just calculated will not be rejected.

2.32.5  Examples

options
Display the present settings.

options itl1=50
Allows 50 iterations in a dc or op analysis.

2.33  PAUSE command

pause command suspend batch mode wait for key hit

2.33.1  Syntax

PAuse comment

2.33.2  Purpose

Suspend batch mode. Wait for the user to hit a key.

2.33.3  Status

This command does not work on all systems, due to buffering of console i/o.

2.33.4  Comments

Prints Continue? and waits for a key hit. Type `n', `N', escape or control-c to terminate the batch mode. Type anything else to continue.

Any comment is ignored.

2.33.5  Examples

pause Try more gain


pause
These both work the same. Ask to continue, wait for a key hit, then go on.

2.34  PLOT command

plot command graphics: set-up plotting: set-up

2.34.1  Syntax

PLot
PLot mode points ... ...
PLot mode + points ... ...
PLot mode - points ... ...
PLot mode CLEAR

2.34.2  Purpose

Select points in the circuit for graphic output. Select graphic output.

2.34.3  Status

The plotting leaves something to be desired. Only two signals can be plotted at a time. The output file is corrupt when plotting is on.

2.34.4  Comments

The `plot' command selects where to look at the circuit, or where to hook the oscilloscope probe.

There are separate lists of probe points for each type of analysis.

To list the probe points, use the bare command `plot'.

Syntax for each point is parameter(node)(limits), parameter(componentlabel)(limits), or parameter(index)(limits). Some require a dummy index.

For more information on the data available see the print command.

You must set the scaling. If you do not, the default range is fixed at -5 to 5. Gnucap cannot auto-scale because it generates the plot during simulation, so the necessary information is not available yet. Spice can auto-scale only because it waits for the simulation to complete before producing any output.

Plot uses the same variables as print. See the print command for a list of what is available.

The options plot and noplot on any analysis command turn plotting on and off a single run. The plot command turns plotting on and tabular output off. The print command turns plotting off and tabular output on.

You can add to or delete from an existing list by prefixing with + or -. plot ac + v(3) adds v(3) to the existing set of AC probes. plot ac - q(c5) removes q(c5) from the list. You can use the wildcard characters * and ? when deleting.

Plotting is limited to 2 items.

2.34.5  Examples

plot ac vm(12)(0,5) vm(13)(-5,5)
The magnitude of the voltage at node 12 with a range of 0 to 5, and node 13 with a range of -5 to 5 for AC analysis.

plot dc v(r26)
The voltage across R26 for DC analysis. Since there is no range, default values will be used.

plot tran v(r83)(0,5) p(r83)(0,1u)
Plot the voltage and power of R83 in the next transient analysis. The voltage scale is 0 to 5. The power scale is 0 to 1 microwatt.

plot
List all the probes for all modes.

plot dc
Display the DC plot list.

plot ac CLear
Clear the AC list.

2.35  PRINT command

print command probe command output selection selection of output nodes: output selection

2.35.1  Syntax

PRint
PRint mode points ... ...
PRint mode + points ... ...
PRint mode - points ... ...
PRint mode CLEAR

2.35.2  Purpose

Select points in the circuit for tabular output. Select tabular output.

2.35.3  Comments

The `print' command selects where to look at the circuit, or where to hook the voltmeter (ammeter, watt meter, ohm meter, etc.) probe.

There are separate lists of probe points for each type of analysis.

To list the probe points, use the bare command `print'.

On start-up, probes are not set. You must do the command `print op v(nodes)' or put `.print op v(nodes)' in the circuit file to get any output from the op command.

Syntax for each point is parameter(node), parameter(componentlabel), or parameter(index). Some require a dummy index.

You can access components in subcircuits by connecting the names with dots. For example: R56.X67.Xone is R56 in X67 in Xone. Some built-in elements, including diodes, transistors, and mosfets, contain subcircuits with internal elements. Cgd.M12 is the gate to drain capacitor of mosfet M12.

If the component does not exist, you will get an error message. If the component exists but the parameter is not valid for that type, there will be no error message but the value printed will be obviously bogus.

The options plot and noplot on any analysis command turn plotting on and off a single run. The plot command turns plotting on and tabular output off. The print command turns plotting off and tabular output on.

You can add to or delete from an existing list by prefixing with + or -. print ac + v(3) adds v(3) to the existing set of AC probes. print ac - q(c5) removes q(c5) from the list. You can use the wildcard characters * and ? when deleting.

For AC analysis, by adding a suffix letter to the parameter, you can get the magnitude M, phase P, real part R, or imaginary part I. Adding DB gives the value in decibels, relative to 1. For example, VRDB(R13) gives you the real part of the voltage across R13, in decibels.

2.35.4  Node probes

Several parameters are available at each node.

All modes

V
Voltage.

All except Transient

Z
Impedance looking into the node.

Transient, DC, OP only

Logic
A numeric interpretation of the logic value at the node. The value is displayed encoded in a number of the form a.bc where a is the logic state: 0 = logic 0, 1 = rising, 2 = falling, 3 = logic 1. b is an indication of the quality of the digital signal. 0 is a fully valid logic signal. Nonzero indicates it does not meet the criteria for logic simulation. c indicates how the node was calculated: 0 indicates logic simulation. 1 indicates analog simulation of a logic device. 2 indicates analog simulation of analog devices.

2.35.5  Status probes

There are several status variables that can be probed.

All modes

Temperature(0)
The simulation temperature in degrees Celsius.

TIme(0)
The current time in a transient analysis. In AC analysis it shows the time at which the bias point was set, 0 if it was set in a DC or OP analysis, or -1 if it is the bias was not set (power off).

Transient, DC, OP only

GEnerator
The output of the ``signal generator''. In a transient analysis, it shows the output of the signal generator, as set up by the generator command. In a DC analysis, it shows the DC input voltage (not the power supply). In an OP analysis, it shows the DC input, normally zero.

iteration count
ITer(0)
The number of iterations needed for convergence for this printed step including any hidden steps.

ITer(1)
The number of iterations needed for convergence for this printed step not including any hidden steps.

ITer(2)
The total number of iterations needed since startup including check passes.

Control(0)
A number indicating why the simulator chose this time to simulate at.
1 The user requested it. One of the steps in a sweep.

2 A discrete event. An element required a solution at this time.

3 The effect of the ``skip'' parameter.

4 The iteration count exceeded ITL4 so the last step was rejected and is being redone at a smaller time step.

5 The iteration count exceeded ITL3 so the time interval is the same as it was last time.

6 Determined by local truncation error or some other device dependent approximation in hopes of controlling accuracy.

7,8 The step size was limited to twice the previous step size.

9 The step size was reduced to half the interval to an event to avoid a tiny next step.

10 + x The previous step was rejected.

20 + x A zero time step was replaced by mrt.

30 + x The required step size less than mrt, so it was replaced by mrt.


Control(1)
The number internal time steps. (1 if all steps are printed. One more than the number of hidden steps.)

2.35.6  Element probes

Each element type has several parameters that can be probed. In general, the form is Parameter(element). Wild cards are allowed in element names to allow probing the same parameter of a group of elements.

For components in a subcircuit, the names are connected with dots. For example R12.X13 is R12 in the subcircuit X13.

Most two node elements (capacitors, inductors, resistors, sources) and four terminal elements (controlled sources) have at least the following parameters available. Others are available for some elements.

All modes

V
Branch voltage. The first node in the net list is assumed positive. This is the same as ``output voltage''.

Vout
Output voltage. The voltage across the ``output'' terminals.

VIN
Input voltage. The voltage across the ``input'' terminals. For two terminal elements, input and output voltages are the same.

I
Branch current. It flows into the first node in the net list, out of the second.

P
Branch power. Positive power indicates dissipation. Negative power indicates that the part is supplying power. Its value is the same as (PD - PS). In AC analysis, it is the real part only.

NV
Nominal value. In most cases, this is just the value which is constant, but it can vary for internal elements of complex devices.

EV
The effective value of the part, in its units. If the part is ordinary, it will just show its value, but if it is time variant or nonlinear, it shows what it is now.

R
Resistance. The effective resistance of the part, in ohms. In AC analysis, shows the magnitude of the self impedance. In OP, DC or TRansient analysis, shows its incremental resistance. In TRansient analysis, it shows the effective Z-domain resistance of inductors and capacitors.

Y
Admittance. 1/R.

All except Transient

Z
Impedance at a port. The port impedance seen looking into the circuit across the branch. It does not include the part itself. In transient analysis, it shows the effective Z-domain impedance, which is a meaningless number if there are capacitors or inductors in the circuit.

ZRAW
Impedance at a port, raw. This is the same as ``Z'' except that it includes the part itself.

Transient, DC, OP only

These parameters are available in addition to the above.
PD
Branch power dissipated. The power dissipated in the part. It is always positive and does not include power sourced.

PS
Branch power sourced. The power sourced by the part. It is always positive and does not consider its own dissipation.

F
The result of evaluating the function related to the part. It is the voltage across a resistor, the charge stored in a capacitor, the flux in an inductor, etc.

INput
The ``input'' of the device. It is the current through a resistor or inductor, the voltage across a capacitor or admittance, etc. It is the value used to evaluate nonlinearities.

IOffset
The offset current in the device. The current through a nonlinear device can be considered to have two parts: a passive part and an offset.

IPassive
The passive part of the current.

AC only

These parameters are available in addition to the above. In addition to those listed here, you can add a suffix (M, P, R, I and DB) for magnitude, phase, real part, imaginary part, and decibels, to any valid probe. Some of them have a special meaning, which is listed here. Negative phase is capacitive. Positive phase is inductive.
PI
Reactive (imaginary) power, volt-amps reactive.

PIDB
Decibels relative to 1 va reactive.

PM
Volt amps, complex power.

PMDB
Decibels relative to 1 va.

PP
Power phase (angle between voltage and current).

2.35.7  Examples

print ac v(12) v(13) v(14)
The voltage at nodes 12, 13, and 14 for AC analysis.

print dc v(r26)
The voltage across R26, for DC analysis.

print tran v(r83) p(r83)
Voltage and power of R83, for transient analysis.

print dc i(c8) p(r5) z(r5)
The current through C8, power dissipated in R5, and the impedance seen looking into the circuit across R5.

print op v(nodes)
The voltage at all nodes for the op command.

print
List all the probes, for all modes.

print op
Display the OP probe list.

print ac clear
Clear the AC list.

2.36  QUIT command

quit command exit command

2.36.1  Syntax

Quit

2.36.2  Purpose

Terminates the program.

2.36.3  Comments

`exit' also works.

Be sure you have saved everything you want to!

2.37  SAVE command

save command store the circuit keep the circuit file: save

2.37.1  Syntax

SAve filename {options ...}

2.37.2  Purpose

Saves the circuit on the disk.

2.37.3  Comments

The file is in an ASCII format, so the list may be used as part of a report. It is believed to be compatible with other simulators such as Berkeley Spice to the extent that the capabilities are the same. Compatibility with commercial Spice derivatives may be a problem because they all have proprietary extensions and are incompatible with each other.

If the file name specified already exists, the old file is deleted and replaced by a new file of the same name, after asking you for permission.

You can save a part of a circuit. See the list command for more details.

2.37.4  Examples

save works.ckt
Save the circuit in the file works.ckt, in the current directory.

save
Save the circuit. Since you did not specify a file name, it will ask for one.

save partof.ckt R*
Save a partial circuit, just the resistors, to the file partof.ckt. (See the List command.)

save /client/sim/ckt/no33
You can specify a path name.

2.38  SENS command

sens command sensitivity analysis The Spice SENS command is not implemented. Similar functionality is not available.

2.39  STATUS command

status command utilization memory

2.39.1  Syntax

STatus

2.39.2  Purpose

Shows information on how the system resources are being utilized.

2.40  SWEEP command

sweep command sweep component values step component values

2.40.1  Syntax

SWeep {stepcount} partlabel=range ...

2.40.2  Purpose

Sweep a component (or group of components) over a range. Set up a loop for iteration.

2.40.3  Comments

This command begins a loop which will sweep a component or group of components.

When this command is given, the only apparent actions will be a change in the prompt from `-->' to `>>>', and some disk action.

The different prompt means that commands are not executed immediately, but are stored in a temporary file.

The bare command will repeat the same command sequence as the last time sweep was run, and not prompt for anything else.

Additional components can be swept at the same time by entering a `FAult' command at the `>>>' prompt. The `fault' behaves differently here: It accepts a range, which is the sweep limits.

The `go' command will end the entry sequence, and make it all happen. After this, the values are restored. (Also, all faults are restored, as if by the `restore' command.)

All commands can be used in this mode. Of course, some of them are not really useful (quit) because they work as usual.

Only linear, ordinary parts can be swept. (No semiconductor devices, or elements using behavioral modeling.) The tolerance remains unchanged. If you attempt to sweep a nonlinear or otherwise strange part, it becomes ordinary and linear during the sweep.

2.40.4  Example

-->sweep  5   R14=1,100k   R15=100k,1
>>>list
>>>ac 500 2k oct
>>>go
This sequence of commands says to simultaneously sweep R14 and R15 in 5 steps, in opposite directions, list the circuit and do an AC analysis for each step.

Assuming the circuit was:
     R14  1   0   50k
     R15  2   0   50k
The result of this sequence would be:
     R14  1   0   1
     R15  2   0   100k
an AC analysis
     R14  1   0   25.75k
     R15  2   0   75.25k
an AC analysis
     R14  1   0   50.5k
     R15  2   0   50.5k
an AC analysis
     R14  1   0   75.25k
     R15  2   0   25.75k
an AC analysis
     R14  1   0   100k
     R15  2   0   1
an AC analysis

After all this is done, the circuit is restored, so list would show:
     R14  1   0   50k
     R15  2   0   50k
You could accomplish the same thing by entering fault commands at the `>>>' prompt.
-->sweep  5
>>>fault  R14=1, 100k
>>>fault  R15=100k, 1
>>>list
>>>ac 500 2k oct
>>>go

2.41  TEMP command

temp command The Spice TEmp command is not implemented. Similar functionality is available by sweeping the op command.

2.42  TF command

tf command transfer function, dc The Spice TF command is not implemented. Similar functionality is not available.

2.43  TITLE command

title command headings

2.43.1  Syntax

TItle
TItle a line of text

2.43.2  Purpose

View and create the heading line for printouts and files.

2.43.3  Comments

There is a header line at the beginning of every file, to help you identify it in the future. This command sets up what it says. It also sets up a heading for printouts and graphs.

When you use the `get' command to bring in a new circuit, it replaces the title with the one in the file. The `title' command lets you change it, for the next time it is written out.

2.43.4  Examples

title This is a test.
Sets the file heading to `This is a test.' In the future, all files written will have `This is a test.' as their first line.

title
Displays the file heading. In this case, it prints `This is a test.'

2.44  TRANSIENT command

transient command time domain nonlinear transient analysis

2.44.1  Syntax

Transient start stop stepsize {options ...}
Transient stepsize stop start {options ...}

2.44.2  Purpose

Performs a nonlinear time domain (transient) analysis.

2.44.3  Comments

The nodes to look at must have been previously selected by the Print or Plot command.

Three parameters are normally needed for a Transient analysis: start time, stop time and step size, in this order. The SPICE order (step size, stop, start) is also acceptable. An optional fourth parameter is the maximum internal time step.

If all of these are omitted, the simulation will continue from where the most recent one left off, with the same step size, unless the circuit topology has been changed. It will run for the same length of time as the previous run.

Do not use a step size too large as this will result in errors in the results. If you suspect that the results are not accurate, try a larger argument to `Skip'. This will force a smaller internal step size. If the results are close to the same, they can be trusted. If not, try a still larger `Skip' argument until they appear to match close enough. aliasing: transient accuracy: transient stability: transient

The most obvious error of this type is aliasing. You must select sample frequency at least twice the highest signal frequency that exists anywhere in the circuit. This frequency can be very high, when you use the default step function as input. The signal generator does not have any filtering.

2.44.4  Options

> file
Send results of analysis to file.

>> file
Append results to file.

Cold
Zero initial conditions. Cold start from power-up.

DTMIn = x
Minimum time step. (Default = from options) The smallest internal time step in transient analysis. The transient command dtmin option and the dtratio option override it if it is bigger.

DTRatio = x
The ratio between minimum and maximum time step. (Default = from options).

NOPlot
Suppress plotting.

PLot
Graphic output, when plotting is otherwise off.

Quiet
Suppress console output.

Skip count
Force at least count simulation steps for each one displayed. If the output is a table or ASCII plot, the extra steps are hidden.

TEmperature degrees
Temperature, degrees C.

TRace n
Show extended information during solution. Must be followed by one of the following:
Off
No extended trace information (default, override .opt)
Warnings
Show extended warnings
Alltime
Show all accepted internal time steps.
Rejected
Show all internal time steps including rejected steps.
Iterations
Show every iteration.
Verbose
Show extended diagnostics.


UIC
Use initial conditions. Use the values specified with the IC = options on the various elements.

2.44.5  Examples

transient 0 100u 10n
Start at time 0, stop after 100 micro-seconds. Simulate using 10 nanosecond steps.

transient
No parameters mean to continue from the last run. In this case it means to step from 100 us to 200 us in 10 ns steps. (The same step size and run length, but offset to start where the last one stopped.

transient skip 10
Do 10 extra steps internally for every step that would be done otherwise. In this case it means to internally step at 1 nanosecond. If the output is in tabular form, the extra steps are hidden.

transient 0
Start over at time = 0. Keep the same step size and run length.

transient cold
Zero initial conditions. This will show the power-on transient.

transient >arun
Save the results of this run in the file arun.

2.45  UNFAULT command

faults: restore unfault command change values: temporary

2.45.1  Syntax

UNFault

2.45.2  Purpose

Undo any action from fault commands.

2.45.3  Comments

This command reverses the action of all fault commands.

It will also clean up any side effects of an aborted sweep command.

Unfault is automatically invoked on any clear command.

If you change the circuit in any other way, unfault will bring back the old on top of the changes. This can bring on some surprises.

2.45.4  Example

fault R66=1k
R66 now has a value of 1k, regardless of what it was before.

unfault
Clears all faults. In this case, R66 has its old value again.
unfault can bring on surprises. Consider this sequence ...
V1   1   0    ac  1
C3   1   2    1u
R4   2   0    10k
fault C3=100p
C3 is 100 picofarads, for now.

modify C3=220p
C3 is 220 pf, for now. It will be restored.

modify R4=1k
R4 is 1k. It will not be restored.

restore
C3 back to 1 uf, but R4 still 1k.

2.46  UNMARK command

unmark command transient reruns

2.46.1  Syntax

UNMark

2.46.2  Purpose

Forget remembered circuit voltages and currents. Undo the `mark' command.

2.46.3  Comments

Allow time to proceed. It has been held back by the `mark' command.

2.46.4  Examples

transient 0 1 .01
A transient analysis starting at zero, running until 1 second, with step size .01 seconds. After this run, the clock is at 1 second.

mark
Remember the time, voltages, currents, etc.

transient
Another transient analysis. It continues from 1 second, to 2 seconds. (It spans 1 second, as before.) This command was not affected by the mark command.

transient
This will do exactly the same as the last one. From 1 second to 2 seconds. If it were not for mark, it would have started from 2 seconds.

transient 1.5 .001
Try again with smaller steps. Again, it starts at 1 second.

unmark
Release the effect of mark.

transient
Exactly the same as the last time, as if we didn't unmark. (1 to 1.5 seconds.)

transient
This one continues from where the last one left off: at 1.5 seconds. From now on, time will move forward.

2.47  WIDTH command

width command in option input width option out option output width option

2.47.1  Syntax

Width {IN=value} {OUT=value}

2.47.2  Purpose

Set input and output width.

2.47.3  Comments

The `width' command is the same as the `options' command. It is provided for SPICE compatibility. SPICE uses width to set two parameters: in and out, which we set with the options command.
Previous Up Next