A SPICE Circuit Optimizer
A SPICE Circuit Optimizer
Permission is granted to copy, distribute and/or modify this document under the terms
of the GNU Free Documentation License, Version 1.2 or any later version published by
the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and
with no Back-Cover Texts.
Contents
1 Preface 5
1.1 Tool Fitness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Scope and Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Introduction 10
3.1 Features and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
CONTENTS 2
5 Efficient Usage 30
5.1 Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.2 Convergence Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.3 Number of Optimization Variables and Search Space . . . . . . . . . . . . 31
5.4 Objectives and Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.5 Evaluating Optimization Results . . . . . . . . . . . . . . . . . . . . . . . 31
6 ASCO Tutorials 32
6.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
TM
6.2 Eldo Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Latest tested version . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.2.1 Tutorial #1 – Digital inverter . . . . . . . . . . . . . . . . . . . . . 35
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Full Netlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Optimization Results Analysis . . . . . . . . . . . . . . . . . . . . . 38
6.2.2 Tutorial #2 – Three stage operational amplifier . . . . . . . . . . . 39
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Full Netlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Optimization Results Analysis . . . . . . . . . . . . . . . . . . . . . 43
6.2.3 Tutorial #3 – Class-E power amplifier . . . . . . . . . . . . . . . . 44
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Full Netlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
CONTENTS 3
10 Development Roadmap 74
10.1 How You Can Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
11 Submitting a Bug 76
12 FAQ 77
13 Acknowledgments 78
Chapter 1
Preface
5
CHAPTER 1. PREFACE 6
Table 1.1:
Convention Description
courier Indicates a code fragment
Brackets ([ ]) Indicates the component is optional
Arrows (< >) Indicates the component is mandatory
Pipe (|) Indicates that one of the items can be selected
1.4 Trademarks
All products mentioned in this document are the property of their respective owners and
carry the appropriate trademarks, registered trademarks, and/or copyrights. Any trade-
mark infringements are unintentional.
Chapter 2
This Chapter describes the minimum set of commands and information needed to start
using ASCO to optimize a CMOS inverter with a 10 pF load operating at 850 MHz. The
goal is to find the PMOS transistor width for minimum power consumption.
7
CHAPTER 2. QUICK START GUIDE 8
best[0]=-7.990420912
a graphic plotting program. The last line of this file is now shown
The plus signal as the first character in the line, as opposed to -cost, is an indication
that all optimization constraints have been met. In the last column, the transistor size,
1.904 mm, that originates the minimum power consumption is presented.
Introduction
10
CHAPTER 3. INTRODUCTION 11
• Number of variables: there is, in theory, no limit to the number of circuit variables
that can be optimized, except those constraints imposed by the available computer
memory and/or the time required to generate a functional circuit. It is currently
hardcoded in the C code.
• PVT corners: by using the simulator functionality, the possibility to test various
design corners and Monte Carlo analysis is only limited to the simulator capability
and by the time it takes to finish the optimization.
• File format: all outputted data and log information is stored in plain text format.
This guarantees that they will always be readable in the future. In addition, it makes
possible the use of other existing tools to post-process the optimization results.
• It is free software: the code is available under the GNU GPL license.
ASCO has been designed to address problems that are oriented to electric circuits.
Although not limited, some possible applications can include:
• Increase the robustness and yield of an already designed circuit by guaranteeing that
it comply with all design goals and constraints in some/all process corners at will.
CHAPTER 3. INTRODUCTION 12
• Easily explore a new operating point (design space) of an already existing topology,
to reduce power consumption, area or both.
• Look for a feasible new design topology before investing a considerable time trying
to derive equations that describe its operation.
Refer to Chapter 6 for ready to use practical examples to introduce you to ASCO, a
SPICE circuit optimization tool.
Chapter 4
Two executables are created: asco and asco-test. Copy them to a common directory
so that they can be used later.
to extract all necessary files. Then, type the following lines to configure and compile
aclocal
automake -f -c -a
sh autogen.sh
./configure
make
13
CHAPTER 4. INSTALLATION AND OPERATION 14
Optimization algorithms
Currently, one global (DE) optimization algorithm and two local (Hooke&Jeeves or Nelder-
Mead) optimizers are available to use in ASCO. The parameters for tuning the differential
evolution (DE) algorithm are accessible via the configuration file. On the contrary, local
optimizers can only be tunned in the source code. Furthermore, the selection of the two
local optimizers, is only possible at compilation time by editing the file asco.c around
Step4.
The local optimizers use an intrinsically a sequential method. To gain design speed in
situations where a good local starting point is known, the parallel global DE algorithm
can be used in an emulated local mode. Thus benefiting from distributed computing while
strongly limiting the search space.
1. Send: each process receives one vector at a time and returns the single cost back to
the Master process before receiving new parameters (one vector).
2. Scatter: within the same generation, all vectors are scattered among all existing
processes. All evaluations are performed before returning all the cost values back to
the Master process. In the next generation, it repeats itself.
CHAPTER 4. INSTALLATION AND OPERATION 15
3. Scatter with load balancing: for situations where the computer power is evenly avail-
able to each one of the processes, either due to different machines or to machines with
different loads, balancing the number of simulations according to the computational
resources, decreases optimization time. On a perfect balanced situation, all processes
start and finish their work at the same time. This, despite having received a different
number of vectors.
Spectre
R
BSIM selection
It is not possible to know on before hand which BSIM transistor model level is going to
be needed or has been used in Spectre
R
. The output from Spectre
R
version changes from
version-to-version but the change is more significant between different transistor models. As
such, the selection between BSIM3 and BSIM4 (the only two supported models) has to be
made by editing the source files. Search for BSIM4 string. File auxfunc measurefromlis.c
requires 2 one byte changes, while the file auxfunc updatelis.c requires commenting 5
lines and un-commenting another 5 lines of code. The changes are self explanatory for an
experienced C programmer.
Figure 4.1: Interface between ASCO tool and the SPICE simulation program.
compared. For each vector xi,G of generation G, a perturbed vector vi,G+1 is generated as
follows:
i=n
X
Cost = Wobj · Psimi
i=1
!
Pspecj − Psimj
+ Wcon · max (4.2)
j∈[1,m] Pspecj
with Wobj and Wcon the weights for the cost due to the objectives and constraints,
respectively, and where P indicates performances, either simulated or specified. With
1
The cost function, or objective function, is the function being optimized. It represents the quantity
that is to be minimized by the optimizer in a given search space. This function can be for example the
power consumption, circuit area or the sum of both. Maximization of objective such as Phase Margin is
obtained by minimizing 1/(Phase Margin).
CHAPTER 4. INSTALLATION AND OPERATION 17
properly scaled weights (which is very easily accomplished), the optimizer will first try to
find feasible solutions (satisfying the constraints) and then further tunes the parameters
to optimize the objectives. This scaling can easily be adjusted manually after a “dry-run”
(which can also be automated) and only requires altering the order of magnitude of one of
the weights depending on the cost values which are logged. In order to deal with complex
problems with many constraints, a minimax problem formulation is used in (4.2). When
the genetic algorithm proposes bad combinations of parameters (e.g. out of bound), a
“high” cost is assigned (e.g. 108 ) to such solutions.
In order to facilitate the automated optimization of specific circuit classes (Op-Amps,
comparators, . . . ), constraint and objective templates can be loaded. These could have
been stored for reuse by the designer himself or provided by another expert designer.
*Digital inverter
In the above netlist representing a digital inverter, all lines are the same as in a normal
simulation with a couple of exceptions:
CHAPTER 4. INSTALLATION AND OPERATION 19
• All values that are to be replace by the optimizer are enclosed in number sign # #.
This does not necessarily imply a variable to optimize. It can also be a fixed number
whose value is set for flexibility in the configuration file. This is a simple method
to optimize a write protected SPICE input netlist circuit with different operating
conditions.
• This is optional: no measurements exist in the netlist, although those that will not
be used to verify circuit performance and/or correct operation can still be present.
Word yes and no are used to perform or not a given analysis in the optimization
loop. The scheduled simulations with Alter and/or MonteCarlo, are only executed if all
constraints have been met in the previous cost evaluation, otherwise, they are executed
immediately after the real value specified in the AlterMC cost.
During and optimization, misconvergence can occur if before starting simulations re-
runs using Alter, a lower cost has already been obtained than the possible best when
including design corners. This situation can be avoided by not setting AlterMC too low.
Similar situation applies to the MonteCarlo case.
#DE#
choice of method:3
maximum no. of iterations:50
Output refresh cycle:2
No. of parents NP:60
Constant F:0.85
Crossover factor CR:1
Seed for pseudo random number generator:3
Minimum Cost Variance:1e-6
Cost objectives:10
Cost constraints:100
#
There is no choice of parameters that fits all. Each optimization problem has an ideal
choice of the above factors. However F=0.5 and CR=0.8 can be taken as good starting
point alongside with method 3 or 4. Read the following lines for further clarification.
• choice of method
An explanation of the naming-convention follows for the DE/x/y/z. DE: stands
for Differential Evolution; x: a string which denotes the vector to be perturbed; y:
number of difference vectors taken for perturbation of x; z: crossover method (exp =
exponential, bin = binomial). When the DE/best... schemes fail DE/rand... usually
works and vice versa. One of the following methods can be chosen using a number
between 1 and 10.
1. DE/best/1/exp: The oldest strategy but still not bad. Several optimization
problems where misconvergence occurs have been found.
2. DE/rand/1/exp: It works especially well when the “bestit[]”-schemes experience
misconvergence. Try e.g. F=0.7 and CR=0.5 as a first guess.
CHAPTER 4. INSTALLATION AND OPERATION 21
• No. of parents NP
Number of population members. To start off NP=10xD is a reasonable choice. In-
crease NP if misconvergence happens. If you increase NP, F usually has to be de-
creased. The number of population members NP is also not very critical. A good
initial guess is 10xD. Depending on the difficulty of the problem NP can be lower
than 10xD or must be higher than 10xD to achieve convergence.
• Constant F
DE-stepsize F from interval [0, 2] which affects the differential variation between two
individuals. The scale factor F must be above a certain minimum value to avoid
premature converge to a local minimum (sub-optimal solution). However, making F
too large causes the number of function evaluations to increase before converging to
an optimum solution. On the other hand, it allows global exploration of the search
space. F is usually between 0.5 and 1 (in rare cases >1). DE is also somewhat
sensitive to the choice of the stepsize F.
• Crossover factor CR
Crossover probability constant from interval [0, 1] which affects the diversity of pop-
ulation for the next generation. Helps to maintain the diversity of the population
and is rather uncritical, with 0.0, 0.3, 0.7 and 1.0 being optimal first choices. If
the parameters are correlated, high values of CR work better. The reverse is true
for no correlation. In low-dimensional problems (<10), higher values of crossover
probability work better to preserve the diversity in the population.
CHAPTER 4. INSTALLATION AND OPERATION 22
• Cost objectives
Wobj in (4.2)
• Cost constraints
Wcon in (4.2)
More information can be found either in the C source file de36.c or in [SP95, Sto96].
Alter Options
Refer to Section 7.1 for information on this category.
Parameter Options
# Parameters #
Supply voltage:#V_SUPPLY#:2.0:0:0:LIN_DOUBLE:---
Supply voltage:#V_SUPPLY#:2.0:0:0:LIN_DOUBLE:OPT
Input frequency:#INP_FREQ#:850E6:0:0:LIN_DOUBLE:---
PMOS width:#WP#:70u:75u:250u:LIN_DOUBLE:OPT
Multiplier:#M#:4:2:5:LIN_INT:OPT
#
• Symbol: must be enclosed with # #. ASCO searches the SPICE input netlist and
replaces every single occurrence by its numerical value.
• Number format: Naming-convention follows x y, where x stands for the scale in the
feasible range; y is the number format. x can either be LIN (linear interpolation) or
LOG (logarithmic interpolation) while y can take DOUBLE (continuous) or INT (discrete)
as possible values for the type of variables.
For IEC 60063 preferred number series (E3, E6, E12, E24, E48, E96 and E192 only)
use for example :E48: alone. The code was contributed by Stefan Mahr.
• Type: if the parameter is to be optimized, OPT must be added, otherwise use --- to
represent a parameter that is to be kept constant throughout the optimization. The
previous is useful to simulate the exactly same SPICE input netlist under different
conditions that are changed only in the configuration file, that is, for netlist integrity
purposes.
Notes:
• With the initial value, minimum and maximum, units must not be included, only
scale factors. This is: 2A is read as 2 atto instead of 2 Ampere, while 3F is read as
3 femto instead of 3 Farad. The Volt unit (V) must not be added.
• Exponential format (1e2, 1e-5, 1e+4) or engineering format (K, T, N) can be inter-
changeably used. Use one of the following:
T=1E12 G=1E9 MEG=1E6 K=1E3
A=1E-18 F=1E-15 P=1E-12 N=1E-9 U=1E-6 M=1E-3
• Character case is ignored.
• Multiplier:#M#:4:2:5:LIN INT:OPT
Possible values are 2, 3, 4 and 5 for multiplier parameter because xxx INT is used.
Initial value in the optimization is set to 4.
Measurement Options
To avoid the introduction of a user-defined cost function, objectives and constraints must be
manually introduced in the configuration input file. As such, measurements that assert cir-
cuit performance and/or correct operation shall not be included in the input SPICE netlist
(<inputfile>.*). This also simplifies the user work, as the definition of the cost function
is frequently tricky. The preferred method is to add an entry in the # Measurements #
category of the input configuration file. Furthermore, the added advantage is that this
knowledge in the form of objectives and constraints is stored in a template which can be
reused later.
# Measurements #
P_SUPPLY:---:MIN:0
P_OUT:OUT:GE:0.0316
#
• Measurement: The name of the measurement to perform. See sub-section 4.3.3 for
the format.
• P SUPPLY:---:MIN:0
Measure the power supply, no node is specified, minimize is the optimization objec-
tive. Because the objective gain is not yet implemented, the hardcoded value of 10
is used instead of 0.
• P OUT:OUT:GE:0.0316
Measure the output power at node OUT which must be greater-or-equal than 0.0316 Watt.
Only one objective and one constraint is specified, but in theory there is no limit
to the maximum number of objectives and/or constraints that can be considered in an
optimization. Neither is there a limit to the type of measurements to perform. However,
different cost functions or different penalties can lead to distinctive “optimal” solutions.
It is thus advisable to have only one objective combined with the necessary constraints.
A figure-of-merit (FOM) which accounts for all partial minimize/maximize goals is then
minimized by the optimizer.
# Info #
Name:P_OUT
Symbol:ZP_OUT
Unit:W
Analysis type:TRAN
Definition:Output power at the fundamental harmonic.
Note:
#
CHAPTER 4. INSTALLATION AND OPERATION 26
# Commands #
.OPTFOUR TSTART=TMEAS_START TSTOP=TMEAS_STOP NBPT=1024
.FOUR LABEL=fftout v(#NODE#)
.EXTRACT FOUR LABEL=#SYMBOL# {((YVAL(FOUR(fftout), INP_FREQ))^2)/(2*FILT_RES)}
#
# Post Processing #
#
Each file defining one parameter extraction must have the three categories shown above:
• # Info #
All fields are self-explanatory. Currently ignored.
• # Commands #
Commands to be included in the SPICE netlist to extract waveform information from
a simulation run are defined here. The node where the measurement is to be done,
is replaced by the text given in sub-section 4.3.2/Measurement Options. Currently,
the symbol is automatically filled by the tool.
• # Post Processing #
Refer to Section 7.4 for the appropriate syntax. Note, that only the MEASURE VAR
command can be used in here.
• <hostname>.log In this file, the results of each one of the simulations is stored in
a character separated value for easy importing by a spreadsheet. In each one of the
lines a detailed report quantities is given:
– The current cost of the evaluation, which carries the character “+” if all con-
straints are met, otherwise “-” is added.
– A list of objectives (minimize, maximize), constraints (lower-or-equal, greater-
or-equal, equal) and measurements to monitor. Again, those constraints that
have been met, have the character “+” added.
CHAPTER 4. INSTALLATION AND OPERATION 27
– All components values that have been optimized have their value documents on
the right most part of each line.
Before exiting, one last simulation is executed with the best set of set of values
obtained during the optimization. In this way, it is thus possible to analyze the
SPICE output log file and visually see each one of the waveforms for correct operation
assurance. The line, or lines in case corner analysis, should start with “+cost”.
• asco.log General information about the optimization process is stored in this file.
The simulator to use must be specified in the first input argument. The <inputfile>
can include the file extension.
As programmed in this current version, it is not possible to first execute Monte Carlo
simulations and then Alter. Monte Carlo always follows the optimization or Alter.
• Debug messages are written with DEBUG: ... and only appear when executing
asco-test with the objective to provide enough information to the user to correct
the SPICE input netlist and the ASCO configuration file.
• All other remaining messages are error messages. The C code filename and the
function at the point the program cannot continue, with a small explanation of the
error type is given. The program always exits after this message.
http://www.mcs.anl.gov/mpi/mpich/
If the executable mpicc is not in the PATH environment variable, the ASCO Makefile
must be edited and the full path added to CC MPI. Compile asco-mpi, the executable with
parallel processing support by typing at the command prompt:
make asco-mpi
CHAPTER 4. INSTALLATION AND OPERATION 29
Before continuing, make sure the simulator is available through ssh or rsh. If the PATH
environment variable is set in your current shell but not in your remote shell environment,
the simulator might not be visible. To test this, type the following at the command line
In case of an error two possible solutions exist. You can either edit your shell configu-
ration file to add the path to the directories that are searched by default, or you can edit
the file errfunc.c around line 600-650 (in Step3), and add the full path to the simulator.
To execute the parallel version with just one computer, type
This is exactly the same as executing the sequential optimization algorithm, but with
two processes, one being the master and the other being the slave. Should a network of
computers be available, the following method can be used:
node1
node1:2 #2 processes on this node
node2:1
node3
in which nodeN is the name of the machine as given by the *NIX command hostname.
More than one process can be launched per computer. The simulation netlist(s) and
configuration file(s) is/are then copied to the local disk (of the node computer) to reduce
traffic in the network and as such decrease total optimization time.
The result given by the parallel version of ASCO is exactly the same as given by the
sequential implementation. The exception is in the case where PVT corner analysis is
performed. Nevertheless, a similar result is reached.
Efficient Usage
5.1 Accuracy
In itself, the ASCO tool does not define the accuracy of the results. The algorithm used in
ASCO has been applied to various sets of problems and has obtained good results in term
of speed, robustness and convergence. More information is available in the DE’s homepage
in: http://www.icsi.berkeley.edu/∼storn/code.html.
The methodology applied to the ASCO tool has been proved on silicon. For further
details see Chapter 2 [Ram05] for a low-voltage low-power design of a three stage opera-
tional amplifier and Chapter 6 [Ram05] for the design in the presence of passive and board
parasitics, a high-efficiency 30 dBm class-E CMOS two-stage power amplifier for the GSM
standard.
30
CHAPTER 5. EFFICIENT USAGE 31
Minimizing the number of ASCII and binary files created by the simulator, the num-
ber of measurements (.EXTRACT or .MEAS) and output variables (.PROBE), and the
number of analysis (.AC, .PZ and .TRAN) to the absolute minimum required to efficiently
characterize the circuit in conjunction with a keen speed/accuracy simulation compromise,
saves precious CPU time in the optimization loop.
Open literature suggests that further gains in terms of convergence speed could be
obtained by first doing a global search to find a good starting point that is latter used
by a local optimization algorithm such as Hooke&Jeeves or Nelder-Mead. This decision is
taken at compilation time by editing the file asco.c around Step4.
ASCO Tutorials
1. <inputfile>.*
2. <inputfile>.cfg
• Edit the configuration file. Pay special attention to the category # Parameters #
and # Measurements # in which the symbol and measurement name must
match those in file <inputfile>.* and directory extract/, respectively.
• Adapt the three DE control parameters: NP, F and CR, according to the diffi-
culty of the optimization problem.
• Carefully review if the remaining configuration file suits your needs.
3. Create the necessary measurements, each one in a separate file and place them in the
directory extract/ which is in the same parent directory where the SPICE input
netlist is. If available from a central repository or another simulation, simply copy
the necessary files.
4. Run the asco-test executable to remove any existing error. Only then proceed with
the following steps.
32
CHAPTER 6. ASCO TUTORIALS 33
5. Copy the ASCO executable to the place where your SPICE file is. Start the opti-
mization loop.
6. During the optimization loop, data similar to the one below is printed to the terminal,
best[0]=-4.180591714
best[1]=6.665600201
best[2]=0.03964113694
best[3]=-7.372717493
best[4]=3.691704024
best[0]=-5.173398086
best[1]=9.592135291
CHAPTER 6. ASCO TUTORIALS 34
best[2]=9.780050221
best[3]=-8.086606726
best[4]=9.822119525
The cause for the optimization ending is also printed, in this case the maximum
number of generations has been reached. The minimum obtained cost of 0.40609 is
achieved after 50 generations and 2080 function evaluations. The optimization has
converged as result of the low value of the cost-variance. Although this may be true,
some of the best[] are close to the search range of [-10, +10]. This can be the result
that toward the minimum and/or maximum value of a given vector lies the optimum
point. Therefore it is advisable to increase the lower bound for best[] vectors close
to -10 and the upper bond for best[] vectors close to +10.
8. Analyze the results stored in asco.log, <hostname>.log and the other simulator
specific output files. If not already created (to increase optimization speed), re-
run one last simulation with the necessary command(s) to save waveforms in an
appropriated binary format suitable for a graphical viewer.
The following ready to use optimization examples can be found in the directory examples/
of the ASCO distribution, grouped for each one of the supported simulators.
V DD
Mp
V in V out
Mn
Summary
• One optimization variable
• One objective
Full Netlist
*Digital inverter
The CMOS inverter, in which the transistor width is to be optimized has a 10 pF load
capacitance. All measurements have been removed from the netlist and included in the
extract/ directory.
Configuration File
From the complete configuration file, available at /examples/Eldo/inv, only those cate-
gories that might require extra attention are now discussed.
#Optimization Flow#
Alter:yes $do we want to do corner analysis?
CHAPTER 6. ASCO TUTORIALS 37
Simulation re-runs are executed immediately upon having a returned cost below 3.00.
Immediately after that, and because the AlterMC cost is smaller than the returned cost
from the simulation, Monte Carlo Simulation is performed. For this to occur, the line .MC
2 ALL has to be present which tells the number of simulations runs, also ALL must exist.
# ALTER #
.param
+ V_SUPPLY=[2.0 2.1 2.2]
#
As a demonstration, only three process corners are executed. For an extensive list of
possible examples refer to the configuration file.
# Parameters #
Supply voltage:#V_SUPPLY#:2.0:0:0:LIN_DOUBLE:---
Temperature:#TEMP#:25:0:0:LIN_DOUBLE:---
Minimal gate length:#LMIN#:0.35u:0:0:LIN_DOUBLE:---
Input frequency:#INP_FREQ#:850E6:0:0:LIN_DOUBLE:---
PMOS width:#WP#:10000u:1m:10m:LIN_DOUBLE:OPT
#
The PMOS transistor width is the only optimization variable used. The other param-
eters are used to configure the SPICE input netlist.
# Measurements #
P_SUPPLY:---:MIN:0
VHIGH:OUT:GE:1.95
VLOW:OUT:LE:0.05
#
In here, minimization of the power supply consumption is the objective. This, while
meeting the constraint of having an output voltage above 1.95 V and below 0.05 V at a
fourth of the signal period.
Command Line
./asco -eldo inv
CHAPTER 6. ASCO TUTORIALS 38
to obtain a file with a summary of the measurements and also with a list of param-
eters to use in new optimization. However, it is better to create the new parameter list
(# Parameters #) in the situation where all constraints have been met, i.e., those where
the line start with +cost. Filtering lines matching a pattern is obtained using the *NIX
grep command
after which a new summary can be obtained, this time with a smaller range for the
parameters. With this in hand, a new re-run can be started, either to fine-tune the design
or for a new and faster optimization having corners.
CHAPTER 6. ASCO TUTORIALS 39
C m2 M 00 M 10 M 13 M 16 M 22
V b1
M 20
g m2
V1 V2
V in -g m1 +g m2 -g m3 V out IBIAS M 30
V in- V in+ g mf
M 11 M 12 C m1
g o1 c o1 g o2 c o2 g o3 c o3 CL g m1 V out
V b2
M 17
M 14 C m2
M 31
g m3
-g mf
M 15 M 18 M 21 M 23
A VSS
(a) Block diagram of the PFC amplifier. (b) Schematic diagram of the PFC amplifier.
Summary
• 21 optimization variables
• One objective
Full Netlist
*Three stage operational amplifier
* differential pair
M10 1 IBIAS AVDD AVDD PMOS W=#WM00_10# L=#LM1# M=6
* folded cascode
M13 4 IBIAS AVDD AVDD PMOS W=#WM13_16# L=#LM1# M=3
CHAPTER 6. ASCO TUTORIALS 40
* second stage
M20 6 5 AVDD AVDD PMOS W=#WM20# L=#LM6#
M22 7 IBIAS AVDD AVDD PMOS W=#WM22# L=#LM1#
* third stage
M30 VOUT 5 AVDD AVDD PMOS W=#WM30# L=#LM6# M=22
M31 VOUT 7 AVSS AVSS NMOS W=#WM31# L=#LM7# M=5
* compensation
CM1 5 VOUT #CC1#
CM2 5 7 #CC2#
.ENDS PFC.SUB
Configuration File
#DE#
choice of method:3
maximum no. of iterations:100
Output refresh cycle:2
No. of parents NP:100
Constant F:0.7
Crossover factor CR:0.9
Seed for pseudo random number generator:3
Minimum Cost Variance:1e-6
Cost objectives:10
Cost constraints:10e6
#
A random starting point is used in combination with a population size of 100 for the
evolutionary optimization algorithm. The number of iterations is arbitrarily set to 100,
which translates into a long optimization time. However, this allows to verify that the
optimal values are no longer changing significantly.
# Parameters #
Supply voltage:#VSUPPLY#:3.0:2.4:3.3:LIN_DOUBLE:---
Minimal gate length:#LMIN#:0.35U:0.35U:0.35U:LIN_DOUBLE:---
Bias voltage:#VBIAS#:1.25:1:3.0:LIN_DOUBLE:OPT
Bias current:#IBIAS#:5E-6:1E-6:10E-6:LIN_DOUBLE:OPT
Load capacitance:#CLOAD#:100E-12:100E-12:130E-12:LIN_DOUBLE:---
Load resistance:#RLOAD#:25E3:10E3:50E3:LIN_DOUBLE:---
C compensation 1:#CC1#:15p:2p:20p:LIN_DOUBLE:OPT
CHAPTER 6. ASCO TUTORIALS 42
C compensation 2:#CC2#:3p:2p:20p:LIN_DOUBLE:OPT
Length group 1:#LM1#:0.7E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Length group 2:#LM2#:0.7E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Length group 3:#LM3#:0.7E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Length group 4:#LM4#:0.7E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Length group 5:#LM5#:0.7E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Length group 6:#LM6#:0.7E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Length group 7:#LM7#:0.5E-6:0.35E-6:7E-6:LIN_DOUBLE:OPT
Width M00_10:#WM00_10#:10E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M11_12:#WM11_12#:40E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M13+16:#WM13_16#:10E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M14_17:#WM14_17#:6E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M15_18:#WM15_18#:11.01E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M20:#WM20#:15E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M22:#WM22#:10E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M21_23:#WM21_23#:2E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M30:#WM30#:1.5E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
Width M31:#WM31#:1.5E-6:0.35E-6:50E-6:LIN_DOUBLE:OPT
#
In order to automatically size the amplifier circuit, the netlist of the PFC amplifier is
parametrized using 21 design variables (one bias voltage and current, two compensation
capacitors, seven transistor lengths and ten transistor widths). The number of transistor
geometry variables is somewhat reduced by taking standard analog design constraints
(e.g. the matching of differential input pairs and current mirrors) into account. However,
constraints on the operating point of the circuit are not included, only the performance
specifications are given as input to the tool. On the one hand, this makes the design space
much more complex, but on the other hand this doesn’t require specific circuit knowledge.
# Measurements #
ac_power:VDD:MIN:0
dc_gain:VOUT:GE:122
unity_gain_frequency:VOUT:GE:3.15E6
phase_margin:VOUT:GE:51.8
phase_margin:VOUT:LE:70
amp3_slew_rate:VOUT:GE:0.777E6
#
The original performances as in [Ram05] are taken as constraints, except for the power
consumption, which is requested to be minimized.
Command Line
./asco -eldo amp3
CHAPTER 6. ASCO TUTORIALS 43
V DD
L1
L0 C0
M1 RL
Figure 6.3: Class E power amplifier. It consists of CMOS switch M1 , the finite dc-feed
inductance L1 , the series-tuned (L0 -C0 ) and the load resistance RL .
Summary
• Five optimization variables
• One objective
Full Netlist
*Class-E power amplifier
+ + T_PERC/100*INP_PERIOD
The above file represents a class-E amplifier with a NMOS transistor acting as a switch-
ing device. Minimum inductor parasitics, using SPICE language, are included by the fact
of the LBOND.SUB sub-circuit.
CHAPTER 6. ASCO TUTORIALS 46
Configuration File
The relevant code from the configuration is now shown:
# DE #
choice of method:3
maximum no. of iterations:50
Output refresh cycle:2
No. of parents NP:60
Constant F:0.85
Crossover factor CR:1
Seed for pseudo random number generator:3
Minimum Cost Variance:1e-6
Cost objectives:10
Cost constraints:100
#
The three control parameters controlling the optimization algorithm and that must be
chosen by the user: NP, F and CR are set to 60, 0.85 and 1, respectively.
# Parameters #
Supply voltage:#V_SUPPLY#:2.0:0:0:LIN_DOUBLE:---
Temperature:#TEMP#:25:0:0:LIN_DOUBLE:---
Minimal gate length:#LMIN#:0.35u:0:0:LIN_DOUBLE:---
Input frequency:#INP_FREQ#:850E6:0:0:LIN_DOUBLE:---
No of sim periods:#NO_PERIODS#:50:0:0:LIN_DOUBLE:---
TR1 width:#TR1_W#:1600.0u:5000u:20000u:LIN_DOUBLE:OPT
L1 inductance:#L1#:38.2n:0.1n:10n:LIN_DOUBLE:OPT
L0 inductance:#L0#:14.4n:0.1n:10n:LIN_DOUBLE:OPT
C0 capacitance:#C0#:4.82p:10p:70p:LIN_DOUBLE:OPT
Load resistance:#RL#:27.9:1:10:LIN_DOUBLE:OPT
#
In first three lines above, inputs for the SPICE simulation are shown. The next five
lines configure the parameters to be optimized with the bounding range for each one of the
circuit components.
# Measurements #
P_SUPPLY:---:MIN:0
P_OUT:OUT:GE:0.5
VDSOFF:D1:LE:0.2
SLOPEOFF:D1:LE:9E9
VDSON:D1:LE:0.2
VMIN:D1:GE:-0.2
#
CHAPTER 6. ASCO TUTORIALS 47
The above category describes minimization of the power supply (the only objective)
while meeting all other five constraints, specifically an output power of at least 0.5 W.
The remaining four performance goals, ensure correct operation of the circuit as a class-E
amplifier.
The minimization of the power supply while constraining the output power to be higher
than 0.5 W is equivalent to maximizing the drain efficiency, thus the cost function has only
one objective.
Command Line
./asco -eldo classE
The same spreadsheet can again be used to analyze all results resting assured that only
those where the design constraint have been met are shown.
CHAPTER 6. ASCO TUTORIALS 48
L0 C0 L0 C0
1 2 1 2
L1 C1 C3 L3 L1 C1 C3 L3
Summary
• Six optimization variables
• One objective
Full Netlist
*Chebyshev Band Pass Filter
L2 1 2 #L2# ! #LBOND_60n100n#
C2 2 3 #C2# ! #CSMD_300f340f#
C3 3 0 #C3# ! #CSMD_50p80p#
L3 3 0 #L3# ! #LBOND_350p450p#
The above text, describes a three pole Chebyshev band pass filter. The user-defined
device models, are specified after the in-line comment specific to each one of the simulators
used. Refer to Section 7.5 for a detailed description of its usage.
Configuration File
The relevant code from the configuration file is now shown:
#Optimization Flow#
Alter:no $do we want to do corner analysis?
MonteCarlo:no $do we want to do MonteCarlo analysis?
AlterMC cost:1.00 $point at which we want to start ALTER and/or MONTECARLO
ExecuteRF:yes $Execute or no the RF module to add RF parasitics?
SomethingElse:
#
The difference to note is the definition of ExecuteRF setting to require the inclusion of
RF parasitics in the netlist.
CHAPTER 6. ASCO TUTORIALS 50
#DE#
choice of method:3
maximum no. of iterations:100
Output refresh cycle:2
No. of parents NP:30
Constant F:0.7
Crossover factor CR:0.9
Seed for pseudo random number generator:3
Minimum Cost Variance:1e-6
Cost objectives:10
Cost constraints:1000
#
Above, normal settings for an optimization. Increase the number of parents to achieve
better results at the expense of a longer simulation time.
# Parameters #
C1:#C1#: 64.415p: 50p: 80p:LIN_DOUBLE:OPT
L1:#L1#: 393.233p:350p:450p:LIN_DOUBLE:OPT
L2:#L2#: 79.107n: 60n:100n:LIN_DOUBLE:OPT
C2:#C2#: 320.205f:300f:340f:LIN_DOUBLE:OPT
C3:#C3#: 64.415p: 50p: 80p:LIN_DOUBLE:OPT
L3:#L3#: 393.233p:350p:450p:LIN_DOUBLE:OPT
#
# Measurements #
Left_Side_Lobe:---:LE:-20
Pass_Band_Ripple:---:GE:-1
Right_Side_Lobe:---:LE:-20
S11_In_Band:---:MAX:---
#
The first three lines define the magnitude constraints tolerance scheme as shown in
Fig. 6.4(a). The objective, maximization of the in-band S11, is given in the last line.
Considering that in extract/ it is defined as -S11, as result, the optimizer minimizes the
in-band return loss (S11) value.
The other important file is in this case the place where the parasitic definition resides.
In the file rfmodule.cfg, the following information can be found.
#50p80p#
C=50p R=5m L=0.010n
C=70p R=7m L=0.015n
C=80p R=8m L=0.020n
#
#LBOND#
Device:inductor
Terminal:IN OUT
LBOND IN 1 LS
RBOND 1 OUT RS
#
#350p450p#
LS=350p RS=0.0042
LS=450p RS=0.0054
#
#60n100n#
LS=60n RS=0.718
LS=100n RS=1.196
#
CHAPTER 6. ASCO TUTORIALS 52
Two devices, one capacitor and one inductor are defined in parallel with the sub-
circuit model and device range. Section 7.5 break down the format used in the parasitics
configuration file.
Command Line
./asco -eldo bandpass
Command Line
./asco -ltspice inv
#! /bin/sh
./rosen $1.txt $2.out > /dev/null
Summary
• 2 optimization variables
• One objective
Full Netlist
Configuration File
# Parameters #
Constant F:#F#:0:0:2:LIN_DOUBLE:OPT
Crossover factor CR:#CR#:0:0:1:LIN_DOUBLE:OPT
#
# Measurements #
COST:---:MIN:0
#
Command Line
tar -zxvf ASCO-<version>.tar.gz
cd ASCO-<version>
make -B
cp asco examples/rosen/
# Rosenbrock’s function
cd examples/rosen/bin
CHAPTER 6. ASCO TUTORIALS 60
make
cp rosen ..
cd ..
#Execute optimizer
./asco -general rosen.txt
7.1 alter
SPICE syntax that is used to re-run the same netlist with different options using the com-
TM
mand .ALTER (in Eldo and HSPICE
R
), altergroup (in Spectre
R
) and altermod/alter
(in ngspice) are entered here.
# ALTER #
.protect
.inc [slow.mod typ.mod fast.mod]
.unprotect
.temp [-40 +25 +85]
.param V_SUPPLY=[2.0 2.1 2.2]
.param Ibias=[0.7 1.3]
#
The above line format is dependent on the selected SPICE simulator due to the existing
variations in the input format. The exactly same type of parameters, devices and com-
mands available with the SPICE simulator can be used in here. To test PVT corners, the
options must be enclosed in square brackets ([ ]) with only one space character between
them. For example, if only one line exists and is the following:
upon expansion, three re-runs will be executed for the same netlist:
61
CHAPTER 7. TOOLS AND MODULES 62
.ALTER @1
.inc slow.mod
.ALTER @2
.inc typ.mod
.ALTER @3
.inc fast.mod
TM
A total of 3 × 3 × 3 × 2 = 54 re-runs for the complete above example for Eldo are
necessary before the cost value can be obtained and returned to the optimizer. Use only the
necessary lines, because upon expansion (to all possible combinations), the total number
of simulation re-runs can rapidly grow, with the consequent increase in the optimization
time. Besides the speed, no other caution seems to exist at this time.
Should a file with the name alter.inc exist in the running directory, this file is included
in the netlist instead of adding the parameters in the category. This is useful in cases where
it is important to use an existing file with re-run commands.
The alter tool can be used integrated in the ASCO optimization flow or as a standalone
program. In this case, a file named alter.inc having the #ALTER# commands is created,
which can then be included in the simulation netlist.
7.1.1 Spectre
R
For Spectre
R
a restriction exist in that the command altergroup must be present and
must be also the first line in the configuration file after the #ALTER# category name. Use
for example
# ALTER #
ag altergroup {
simulatorOptions options temp=[-40 +25 +85]
parameters xvdd=[2.0 2.1 2.2]
include "n.typ" section=[slow typ fast]
}
dcOp_ag dc oppoint=logfile
dcOp dc oppoint=logfile
#
Command Line
./alter -<eldo|hspice|spectre|ngspice> <configfile>
CHAPTER 7. TOOLS AND MODULES 63
7.2 log
The log tool can only be used as a standalone program. To obtain a summary of the
simulation optimization measurements (# Measurements #) alongside with the parameters
(# Parameters #), execute in the command line:
Command Line
./log <hostname>.log <outputfile>
7.3 monte
#Monte Carlo#
NMOS_AVT:12.4mV $ This values will be divided by sqrt(2) by the program
NMOS_ABETA:7.3% $ ’m’ parameter is taken into account
PMOS_AVT:10.9mV $
PMOS_ABETA:3.7% $
SMALL_LENGTH:0.0um $ Small transistors if l<= SMALL_LENGTH
SMALL_NMOS_AVT:20mV $ Small transistors parameters
SMALL_NMOS_ABETA:10% $
SMALL_PMOS_AVT:10mV $
SMALL_PMOS_ABETA:5% $
R_DELTA:0.333% $ Resistors matching at 1 sigma between two resistors
L_DELTA:0.333% $ Inductors matching at 1 sigma between two inductors
C_DELTA:0.333% $ Capacitors matching at 1 sigma between two capacitors
#
Parameters describing device parameter mismatch following the Pelgrom’s MOS tran-
sistor models are defined in here. Only the numerical values between the colon and the
unit can be changed. This is also possible for circuit passives: resistors, inductors and
capacitors.
The monte tool can be used integrated in the ASCO optimization flow or as a standalone
program. In both cases, a file named <inputfile>.mc having the Monte Carlo parameters
is created, which can then be used as the input simulation netlist.
Command Line
./monte -<eldo|hspice> <inputfile>.* <configfile>
7.4 postp
# Post Processing #
#
CHAPTER 7. TOOLS AND MODULES 64
Sometimes it is necessary to further manipulate a given value to obtain the final mea-
surement. Some situations where this functionality is useful is:
• Take a voltage and divide by a resistance value, or, simply because the SPICE ex-
traction command do not allow further arithmetic.
• The other possibility is to parse information from the netlist that is not possible to
obtain using the SPICE extract command.
To this end, the flexible post-processing language implemented allows to parse data
existing in the output file and manipulate it to obtain values that are otherwise not possible.
The general syntax is implemented in the MEASURE VAR command where the values are
in a colon separated list. The maximum number of measurements, i.e., the number of
MEASURE VAR lines is only limited by the memory available. The value is hardcoded in the
C code and can be changed as desired. Each one of the five parameters that can be used
are now described:
• MEASURE VAR
The name to give to the measurement (arbitrary).
• SEARCH FOR
The string that is to be found. Depending on the measurement type, it must be an
exact match.
• S COL
The beginning column position where the search string specified in SEARCH FOR must
exist to obtain a valid result.
• P LINE
The number of lines (below the line where exists a string match) to read before
extracting the measurement.
• P COL
The number of columns range within which the data is to be measured.
• MATH
Enters in math mode and thus enables manipulation of data already measured.
Four simple type variations have been implemented, being each one of them better
tailored to a given application with the goal to minimize user work.
CHAPTER 7. TOOLS AND MODULES 65
will look for the ’ UGF =’ (without the quotation marks but including the spaces),
starting at position 1, the first character of the line, and print what is in the current
line between columns 9 and 18. As such, 7.6280E-04 will be read to variable UGF if
the following line exist in the text file to be processed:
UGF = 7.6280E+04
As an example, the same measurement can be performed by using instead, each one
of the following examples
2. Fast read: upon finding on a given line a user defined string, the data that follows is
read. The data of interest is assumed to be within the character(s) space(s). Only
parameter SEARCH FOR can exist for syntax correctness. An exact match throughout
the file must be enforced which otherwise would case incorrect data extraction. As
an example, each one the following command line is equivalent to the command lines
in the general purpose variable extraction.
3. MOS transistor variable extraction: given a transistor name and a list of parameters
(id, vgs, vth...), their value is measured. Parameters S COL and P COL cannot exist,
only P LINE). For flexibility, text and line numbers can be used for variables. If
necessary +,-,*,/ can be used as function.
The postp tool can be used integrated in the ASCO optimization flow or as a standalone
program. In this case, up to three files: nosat.txt, summary.txt and <inputfile>.?jr
can be created. The first has a report of the transistors that are not simultaneously in
strong inversion (VGS <VT H +margin) and saturation (VDS <VDsat +margin); a synopsis of
the measurements is available in the summary.txt; in the last file, the output simulation
file is updated with the operating state of the CMOS transistors. The standalone program,
also accepts a few other parameters that can be added to the correct category.
# Post Processing #
CREATE_LJR:yes
PRECISION:3
VOVD:150mV
VOFF:100mV
VDST:100mV
Each one of the reserved words above can be used to fine-tune the comments and
operating point of the electric simulation output file. A description follows:
• CREATE LJR
Possibilities are yes or no. Useful when it is only necessary to extract the measure-
ments, using the MEASURE VAR command.
CHAPTER 7. TOOLS AND MODULES 67
• PRECISION
Numeric precision of the results printed to summary.txt. Not yet implemented.
• VOVD
Overdrive voltage margin: if VGS <VT H +VOVD, the transistor is in the weak inversion
region.
• VOFF
Off voltage margin: if VGS <VT H -VOFF the transistor if in the off region.
• VDST
Saturation voltage margin: if VDS <VDsat +VDST the transistor is in the linear region.
• SKIP NOSAT
Skips from the nosat.txt file, all transistors in the semicolon separated list, or all
those with the given prefix if the asterisk (*) exists. More than one line can be used.
Command Line
./postp -<eldo|hspice|ltspice|spectre> <inputfile>.* <configfile>
7.5 RF module
Unless there is an accurate and scalable model of passives, the edge is on table lookup
form. This is in spite of their lack of portability and discontinuity. For devices such as
capacitors, pads, interconnections and transistors, the parasitics dependent on the layout
implementation and can, with limited complexity, be manually extracted by the designer.
Coil parasitics, on the other hand, need more attention and must be analyzed by an exter-
nal tool such as FastHenry or ASITIC. Then tables are generated and typically includes
about 10 values around an anticipated value for the target application. Since the tables
are generated only once for each technology the computational time is less important.
Measured results and manufacturer data sheets can also be used if available. Other values
for the devices are then linearly interpolated. Continuity and portability across distinct
electric simulators is created by the RF module, an extension to ASCO. The simulation
overhead is unnoticeable owing to the fact that all the necessary data is read to memory
in the beginning, and taken from there during the optimization loop.
The file format of rfmodule.cfg is composed by groups of subcircuit definition and
variable sets of tabled data to describe either different devices, different maximum operating
current or different layout information.
#5p7p#
C=5p R=260m L=1.1n
C=7p R=300m L=1.5n
#
#7p9p#
C=7p R=300m L=1.5n
C=9p R=320m L=1.6n
#
The above example describe the device #CSMD# as being a capacitor with IN OUT as
the two nodes of the subcircuit. The next three lines describe the circuit components.
After the subcircuit definition, the tabled values for each one of the devices is given. In the
example, keys #1p5p#, #5p7p# and #7p9p# are different groups of characterization data.
Arbitrary key names can be used, as long as it matches the symbol in the circuit input
netlist file exactly.
The first line in the subcircuit definition is the device having parasitics, while the first
column is always the device value with the following columns representing the parasitics.
To not interfere with the normal electric simulator flow, devices having parasitics have
this instruction after the in-line comment, which is specific for each simulator. As an
TM
example, in the following SPICE input netlist for the case of Eldo , it must be placed
after the ! character.
CHAPTER 7. TOOLS AND MODULES 69
C0 1 2 3p
C1 1 2 3p !
C2 1 2 3p ! #CSMD_1p5p#
C3 1 2 #C0#
C4 1 2 #C0# !
C5 1 2 #C0# ! #CSMD_1p5p#
C6 1 2 #C0# ! #CFLUX_1p5p#
L0 1 2 #L0# ! #LSMD_1nH390nH#
xL1 1 2 LSMD.sub L=390n R2=_RF_ k=_RF_ C1=_RF_ R1=_RF_ ! #1nH390nH#
1. The two first devices in the first group do not have parasitics. Element C2 according
to command #CSMD 1p5p# is a subcircuit as defined in the file rfmodule.cfg with
the tag #CSMD#. The tabled date is to be taken from tag #1p5p#.
2. Only the two last devices of the second group have parasitics. One is of type #CSMD#
while the other is of type #CFLUX#. Both use the same subkey #1p5p#, but this refers
to different tables, as they are local to each one of the existing subcircuits.
4. Two different subcircuits are defined, having both the same subkey. Again, despite
having the same name, they represent different sets of data. This is because each
table is local to each subcircuit.
5. In the last group, an example on how to use an inductor having parasitics is given,
for the two possible input formats.
#LSMD#
Device:inductor
Terminal:IN OUT
LL 3 OUT L
RR2 IN 1 R2
RRV 1 3 VALUE={k*sqrt(FREQ)} ! k
CC1 1 2 C1
RR1 2 OUT R1
#
#1nH390nH#
L=1.6n R1=2 R2=0.001 C1=0.030p k=6.50E-06
L=10.0n R1=35 R2=0.010 C1=0.043p k=2.64E-05
L=21.9n R1=13 R2=0.050 C1=0.054p k=4.80E-05
L=51n R1=30 R2=0.010 C1=0.050p k=1.17E-04
L=100n R1=25 R2=0.010 C1=0.060p k=2.34E-04
L=390n R1=41 R2=1.052 C1=0.059p k=7.69E-04
#
Chapter 8
2. Without the user intervention, it must be possible to start the simulator which must
exit upon finishing the simulation.
71
CHAPTER 8. ADDING NEW SIMULATORS 72
First you need to find the source code of a free algorithm should you not want to invent
one. Once this happens, edit the file asco.c around the line where it reads
DE(argc, argv); /*Rainer Storn and Ken Price Differential Evolution (DE)*/
Within the optimization algorithm code, replace where appropriate, every call to the
function evaluation by the new evaluation function
73
Chapter 10
Development Roadmap
This is still a project in its infancy with the objective of having a modular implementation.
This is the reason why changes in the goals and architecture are quite possible. There are
however a few things that at this moment look certain:
1. Merge the input/output format of the various tools that make up ASCO, to have
an unified script like language. Furthermore, make input and output file names
programmable.
2. Include support for logarithmic search space for the existing variables.
3. Add hybrid optimization algorithm which couples global optimization for the first
steps followed by a local optimization. This can be for example Differential Evolution
in conjunction with Hooke-Jeeves or Levenberg-Marquardt algorithm.
5. Include the possibility to define which tasks and the order they are to be executed
upon an event happening, making thus possible to change to local optimization after
the cost has decreased below a user-defined value; start Monte Carlo analysis at given
time; re-run the simulator with a modified netlist specifying different analysis; i.e., a
user defined optimization flow.
6. Code the RF module, needed for a fast, accurate modeling and optimization of circuit
with passives having parasitics.
74
CHAPTER 10. DEVELOPMENT ROADMAP 75
9. Graphical analysis of the simulation output log file to ease in the discovery of a
suitable design. An easy approach would be to use octave and gnuplot. A more
elaborated one uses its own GUI. Again, your contribution in this item is welcome.
• Proofreading this document: which increases readability of the text and clarifies
something that is badly explained, out-of-date or totally wrong.
• Expanding this document: with another section, text reorganization or just submit-
ting a new tutorial. At the end, good documentation is important to clarify doubts
and increase productivity.
• New ideas: You can steer the development by showing where you think it will be
valuable to invest time. Or better, what is missing that without question will make
ASCO more user-friendly.
Obviously, you can also contribute new code, either adding new functionalities or cor-
recting implementation errors.
Chapter 11
Submitting a Bug
Bug reporting is the simplest way you can contribute to the development of ASCO. This is
the reason why this tool is released with a GPL license. Your help is always appreciated,
because you are improving the quality of a tool that has the possibility to benefit all of us.
Simply saying that a bug exist does not help much. Your results have to be adequately
transmitted as well. Also, please understand that we live in a busy world. Your contri-
bution is not forgotten if it takes more time than what you find reasonable. Furthermore,
please understand that you might be asked further clarification. Besides this, follow all
instructions below closely:
3. Remove the files that you cannot distribute, namely the transistor model files.
4. Send to the developer(s) the complete directory tree in tar.gz format with a descrip-
tion of your problem in as much detail as possible.
A useful text on how to ask questions is available in guide How To Ask Questions The
Smart Way by Eric S. Raymond.
76
Chapter 12
FAQ
None yet...
77
Chapter 13
Acknowledgments
Some functions used in the ASCO tool were originally written in 1999 and have been
maintained since then by the author. Nevertheless, the design flow of ASCO is inspired
in the work of [Fra03]. The RF module, of which I’m co-author, is paramount to have
accurate high-frequency simulations in the presence of board and passive parasitics is
already included in ASCO. In conclusion, the goal of ASCO is to extend the well thought
ideas presented in [Fra03], with more functionalities in conjunction with the already existing
and more flexible netlist parser, Alter re-runs, Monte Carlo, support for multiprocessor
calculations and load balancing.
The idea of creating the ASCO project came out of a discussion with S. Xavier-de-
Souza and the concepts around optimization algorithms and its applications. The result
of which being, that although ASCO is intended to interact with zero effort with a SPICE
simulator, only a handful lines of code are necessary to add support to a completely new
simulator, as long as the simulator reads from text files, writes its output in ASCII and it
can be launched from the command line.
The Internet is home to a huge amount of information it is not as nicely presented as
in Wikipedia. No verbatim copy is done but some ideas where developed after reading its
pages.
78
Bibliography
[Ram05] J. Ramos, CMOS Operational and RF Power Amplifiers for Mobile Communi-
cations. PhD thesis, K. U. Leuven, Belgium, March 2005.
[SP95] R. Storn and K. Price, “Differential Evolution – A Simple and Efficient Adaptive
Scheme for Global Optimization over Continuous Spaces”, Technical report,
Technical Report TR-95-012, ICSI, March 1995.
[Sto96] R. Storn, “On the Usage of Differential Evolution for Function Optimization”,
In NAFIPS, pages 519–523, 1996.
79