PyOPUS - Simulation, Optimization, and Design

For circuits and everything else

PyOPUS Quickstart

1. Installation

1.1 From pre-built packages for 64-bit Windows

Go to the Download page and download all quickstart packages. Follow the installation instructions on the download page. The recommended location for installing the Python interpreter is c:\Python26. Finally install PyOPUS by running the PyOPUS 0.8 installer. Install it to Lib/site-packages/ under your Python installation directory. The library will be installed in the pyopus/ subfolder and can be imported by typing

import pyopus

in the Python command line.

1.2 From sources on Linux

Go to the Download page and get the sources. Install all packages PyOPUS depends on. Unpack the sources and enter the folder with the sources. Type

python setup.py build

Become root. In the folder where PyOPUS sources are located, type

python setup.py install

This will install PyOPUS on your system. If you don't want a system-wide installation, you can install PyOPUS to a custom folder by typing

python setup.py install --install-lib /home/username/<custom_folder>

If you install to a custom location make sure you add this location to the PYTHONPATH.

export PYTHONPATH=/home/username/<custom_folder>

2. Running a quickstart demo

You will need a working SPICE OPUS installation. Don't forget to set the OPUSHOME environmental variable (refer to SPICE OPUS documentation on how to do this). All files in this example (except runme.py) are in SPICE OPUS netlist format. SPICE OPUS will be used as the circuit simulator.

Download PyOPUS sources and unpack them. Demos are in the demo/ subfolder. Go to PyOPUS-0.6\demo\circuit-evaluation\06-iteration-plotter. There are 5
files in that folder

Parameters w and l specify channel dimensions while m is the device multiplier.
vtmm and u0mm specify threshold voltage and mobility variation of a transistor
where 0 means that both parameters are nominal, 1 corresponds to 1-sigma
positive deviation, and -1 corresponds to 1-sigma negative deviation. The value
of sigma depends on channel area (Pelgrom model) and is automatically
determined by the subcircuit from w and l.

Any include or lib file that will be specified in PyOPUS must not be included
here with .include or .lib. The same holds for all circuit parameters that will
be controlled by PyOPUS. They must not be specified here with .param
statements.

Note that none of the above listed .inc files has an .end directive. The .end
directive will be added by PyOPUS when it joins the source files together and
simulates the circuit by invoking SPICE OPUS.

in the terminal window (cmd.exe under Windows or any kind of xterm under Linux).

If the Python interpreter is not in the system PATH you must specify the full path to the Python executable. The cost function value will be printed for every iteration and the details will be printed every time a better circuit is found.

Output of the quickstart example in the terminal window.

Every time a better circuit is found (the best-yet cost function value decreses) the circuit's performance is plotted in two windows. When the optimization is finished (in this case when the stopper plugin stops the optimizer) the best circuit is re-evaluated and its performance in printed in the terminal window.

The performance of the best circuit that was found by the optimizer.

Also the performance of the final circuit is plotted in the same windows as the performance of the best-yet
circuit was plotted during optimization.

The dc plot window of the quickstart example (final result). Upper subplot is the differential input voltage sweep while the bottom window is the common mode input voltage sweep.

The m1vds plot window (final result) displaying the dependence of Vds overdrive voltage for mn1 (instance xmn1) with respect to the input common mode voltage.

To finish the demo, close the GUI control window.

The GUI control window.

3. Learning more about PyOPUS

You can start with the examples in the /demo subfolder of PyOPUS sources. Some demos are organzied as tutorials. Follow them in the same order as they are enumerated.
A very useful resource is also the manual which was generated from docstrings in PyOPUS modules using Sphinx. Everything you see in the manual is also available through online Python help.