New Features and Bug Fixes in SmartSpice Version 1.4.0

This article describes some of the new features that will be available in Version 1.4.0 of SmartSpice, to be released at the end of February 1996. SmartSpice will be available on the same platforms as UTMOST and SPAYN as well as on PCs (486 and up) running DOS 6.0 and up, Windows 3.1, Windows 95 and Windows NT. In addition some bug fixes from previous versions are described.


PHASE Parameter in Sinusoidal Waveforms

A new parameter was introduced into sinusoidal waveform formulae of independent current and voltage sources. The name of the parameter is PHASE (default 0). The modified formulae for the independent current source are

Table 1

Release of BSIM3 Version 3 Model

The BSIM3 Version 3 model released by the University of California, Berkeley in October 31, 1995 was implemented in SmartSpice as MOSFET level 8. The model supports standard SmartSpice parameters and equations.

  • ACM 0, 1, 2 and 3 model parameters,
  • Device multiplier M,
  • SCALE and SCALM parameters,
  • Diode equations,
  • Drain and Source parasitic resistances,
  • Temperature dependencies,
  • Drain, gate, source and bulk currents,
  • GMIN and DCGMIN options.

In addition, the model has been enhanced to remove any sources of discontinuities and possible convergence problems.

For reference, the original unmodified Berkeley BSIM3 Version 3 model is also implemented within SmartSpice and this can be accessed as MOSFET level 81.


Parameter Label Sweeping in DC Analysis

Global parameter labels can now be swept in the .DC statement. Parameter labels can be specified in both the first and nested sweep specification.


.PARAM par1=10 par2=0

.DC par1 1 5 1 LIST par2 0 1 2

vin in inn dc par1

vv inn 0 dc par2

r1 in out 1

r2 out 0 1

In this example, the parameter label par1 is swept from 1 to 5 in increments of 1 for three values of parameter par2 (0, 1 and 2).


If a number of .CONTROL blocks appear in a netlist, then each successive block will replace the previous one. This allows the user to use different .CONTROL blocks in .ALTER portions. Previously, SmartSpice tried to append .CONTROL blocks.

NOISE Analysis with syntax_form=1

In previous versions of SmartSpice, the frequency sweep for NOISE analysis was always linear, regardless of the type specified in the .AC statement, if syntax_form=1. This has now been corrected.

Unrecognized Nodenames in Macros

In the standard macros vdb, vi, vm, vp, vgd, dv, sv and vr defined on Page 3-17 of the User's Manual, Vol 1, nodenames beginning with a digit, and containing letters, were parsed as numbers previously. This could lead to commands failing. This has been corrected for instances of the macros taking one argument. For example, the command

% plot vdb(1nrd)

where "1nrd" is a node in the netlist, will now work as expected.

Vector Index Operator

It is now possible to access individual elements of a vector using the index operator, []. Given a vector "vec", the ith element of the vector can be accessed using the following format, vec[i]. The first element of a vector is 0.


% print v(out)[5]

% print abs(v(out)-v(in))[0]

% print @mn[gds][10]

Support for Csh-like Commands

The SmartSpice command interpreter can now support many csh-like control structures. Supported structures include, foreach, while, repeat, do while, if-then-else, label, goto, continue and break. These features allow the user to generate complex scripts to automate the simulation and analysis process. SmartSpice also fully supports standard io redirection operators and backquote substitution which allows shell commands to be evaluated and the results to be assigned to internal SmartSpice variables.


foreach pl $plots

strcmp i "constants" $pl

if $i eq 0



setplot $pl

measure max_v2 max v(2)

echo "The maximum value of v(2) in" $pl "is" $max_v2


unset pl i max_v2

This script will measure the maximum value of the vector v(2) in each plot, with the exception of the "constants" plot and print the value out.

set i = 0


if $i eq length(v(2))



print v(2)[{$i}]

set i = `expr $i + 1`


unset i

This script will print out each of the elements of the v(2) vector. The "repeat" command is used to iterate over the vector, while the shell command "expr" is used to increment the count variable "i".

setplot tran3

measure max_v1 max v(1)

measure max_v2 max v(2)

echo "The maximum value of v(1) is "

$max_v1 > out.$$

echo "The maximum value of v(2) is "

$max_v2 >> out.$$

shell cat out.$$

shell rm out.$$

This script measures the maximum values of v(1) and v(2) in the plot tran3. A file is then created using the PID of the current SmartSpice process and a report containing these measurements written to it. The last two commands list the contents of the file and then remove it.

Single Precision Rawfile Format

A new rawfile format "binary_float" has been created. Using the standard binary format results are written out as double precision numbers. The new binary_float format writes results out using single precision numbers. This will reduce the disk space consumed by such a rawfile by 50% when compared with the binary format. The disadvantage is that single precision numbers have a smaller range (on a SUN workstation e+-38) compared to the range of double precision numbers (e+-308). The single precision numbers are accurate to approximately 8 decimal places.

To use this format, set the "rawfiletype" variable to "binary_float".

% set rawfiletype = binary_float

% write rawfile v(1) v(2) v(3)

Default Signal Line Thickness

The default line thickness of signals plotted by SmartSpice can now be changed using either the signal thickness variable or the GrNdefault-SignalThickness X resource. The signal thickness variable overrides the value of the X resource.


Backgrounding SmartSpice

Previous versions of SmartSpice could not be run directly in the background using the & operator. This has been corrected.

Graphical Post-Processor

The graphics post-processor has been modified extensively in this version of SmartSpice. The user interface remains essentially the same but the underlying algorithms have changed.

Axis Labeling

New algorithms to implement axis labeling should prevent duplicate labels appearing on an axis.

Improved Zoom Resolution

The resolution of the zoom operation has been increased and now depends upon limits imposed by the platforms and operating systems being used.

Multiple Curves in a Signal.

As the result of some multiple sweep type analysis, a signal can contain multiple curves. In previous versions of SmartSpice it was not possible to identify each individual curve on the plot. The post-processor now supports multiple curves in a signal.

If the SELECT mode is activated in the plot window, then the signal closest to the mouse pointer will be highlighted when the left mouse button is pressed. The corresponding legend entry will be updated to highlight the signal. The name of the signal and the number of the curve closest to the pointer will be printed on the message area under the plot.

If XY mode is activated then the cursors will be attached to a curve within a signal and will not move from this curve when the mouse is dragged.

The "Measurement" Dialog now contains a new field for each of the cursors. This allows the user to explicitly attach each cursor to a curve. If the user changes the curve that the cursor is attached to, the cursor will retain its original x-position.

Multi-Line Labels and Chart Titles

It is now possible to create labels and chart titles with multiple lines of text.

Display Measurement Data

The data displayed in the "Measurement" dialog can be printed onto the chart. When the "Create Label" button is pressed the mouse can be used to position a label on the chart. The label contains all information about the measurement cursors. Once the label is positioned, it can be treated as any other label and modified to change its text, position, font size, color and rotation.

Print Cursors

When a canvas is printed, the cursors will now be printed as well. Hence, the user can now print the chart, measurement data and cursors.

Line Styles and Markers

The line styles and markers have been changed slightly to make them more distinguishable, especially on printouts. A new line style has been added which allows signals to be drawn with no line connecting the individual data points. The GrNprintMarkersPerLine resource controls the number of markers displayed on a signal on printouts. By default 10 markers will be placed on each signal. If the value of this resource is <= 1 then markers will be printed at each data point.

Proportionally Spaced Fonts

Support for proportionally spaced fonts on both the screen and printouts has been improved.


Four buttons have been added to the toolbar to allow the user to pan left, right,up and down.

Chart Alignment

The start position of an x-axis is defined by the width of the y-axes on the chart. If there are multiple charts on a canvas, then the x-axes will not lineup if the width of the y-axes are different. A button has been added to the toolbar to force the x-axes of all the charts to be aligned vertically.

Multiple Chart Zoom

A toggle has been added to the "Option" menu that forces all x-axes on a single canvas to have the same minimum and maximum values. If the user zooms in on a chart while this feature is active, then all chart will show the same x-axis values.

Postscript Generation

The generation of postscript hardcopies has been improved to fully support color postscript, improved legends, proportional fonts, measurement cursors and multi-line chart titles and labels. In addition the code to generate encapsulated postscript has been modified. The user can select encapsulated postscript from the "Print" dialog.

Figure 1

Figure 1. Example of Encapsulated Postscript output from SmartSpice 1.4.0., illustrating the use of proportional fonts, improved legends and printing of cursor and measurement values.