Welcome to PyOPUS documentation!¶
PyOPUS is a library for simulation-based optimization of arbitrary systems. It was developed with circuit optimization in mind. The library is the basis for the PyOPUS GUI that makes it possible to setup design automation tasks with ease. In the GUI you can also view the the results and plot the waveforms generated by the simulator.
PyOPUS provides several optimization algorithms (Coordinate Search, Hooke-Jeeves, Nelder-Mead Simplex, Successive Approximation Simplex, PSADE (global), MADS, ...). Optimization algorithms can be fitted with plugins that are triggered at every function evaluation and have full access to the internals of the optimization algorithm.
PyOPUS has a large library of optimization test functions that can be used for optimization algorithm development. The functions include benchmark sets by Moré-Garbow-Hillstrom, Lukšan-Vlček (nonsmooth problems), Karmitsa (nonsmooth problems), Moré-Wild, global optimization problems by Yao, Hedar, and Yang, problems used in the developement of MADS algorithms, and an interface to thousands of problems in the CUTEr/CUTEst collection. Benchmark results can be converted to data profiles that visualize the relative performance of optimization algorithms.
The pyopus.simulator
module currently supports SPICE OPUS, HSPICE, and
SPECTRE (supports OP, DC, AC, TRAN, and NOISE analyses, as well as, collecting
device properties like Vdsat). The interface is simple can be easily extended to
support any simulator.
PyOPUS provides an extensible library of postprocessing functions which enable you to easily extract performance measures like gain, bandwidth, rise time, slew-rate, etc. from simulation results. The collected performance measures can be further post-processed to obtain a user-defined cost function which can be used for guiding the optimization algorithms toward better circuits.
At a higher elvel of abstraction PyOPUS provides sensitivity analysis, parameter screening, worst case performance analysis, worst case distance analysis (deterministic approximation of parametric yield), and Monte Carlo analysis (statistical approximation of parametric yield). Designs can be sized efficiently across a large number of corners. PyOPUS fully automates the procedure for finding a circuit that exhibits the desired parametric yield. Most of these procedures can take advantage of parallel computing which significantly speeds up the process.
Parallel computing is supported through the use of the MPI library. A
cluster of computers is represented by a VirtualMachine object which
provides a simple interface to the underlying MPI library. Parallel programs
can be written with the help of a simple cooperative multitasking OS. This
OS can outsource function evaluations to computing nodes, but it can also
perform all evaluations on a single processor.
Writing parallel programs follows the UNIX philosophy. A function can be run
remotely with the Spawn
OS call. One or more remote functions can be
waited on with the Join
OS call. The OS is capable of running a parallel
program on a single computing node using cooperative multitasking or on a set
of multiple computing nodes using a VirtualMachine object. Parallelism can be
introduced on multiple levels of the program (i.e. parallel performance
evaluation across multiple corners, parallel optimization algorithms, solving
multiple worst case performance problems in parallel, ...).
PyOPUS provides a plotting mechanism based on MatPlotLib and wxPython with
an interface and capabilities similar to those available in MATLAB.
The plots are handled by a separate thread so you can write your programs
just like in MATLAB. Professional quality plots can be
easily exported to a large number of raster and vector formats for inclusion
in your documents. The plotting capability is used in the pyopus.visual
module
that enables the programmer to visualize the simulation results after an
optimization run or even during an optimization run.
Contents:
- 1.
pyopus.simulator
— Simulator support module- 1.1.
pyopus.simulator.base
— Base class for simulator objects - 1.2.
pyopus.simulator.spiceopus
— SPICE OPUS simulator support - 1.3.
pyopus.simulator.spectre
— Cadence Spectre simulator support - 1.4.
pyopus.simulator.rawfile
— Support for reading and writing SPICE OPUS raw files - 1.5.
pyopus.simulator.hspice
— HSPICE simulator support - 1.6.
pyopus.simulator.hspicefile
— Support for reading HSPICE result files
- 1.1.
- 2.
pyopus.evaluator
— Performance evaluation - 3.
pyopus.parallel
— Parallel processing support - 4.
pyopus.optimizer
— Optimization algorithms- 4.1.
pyopus.optimizer.base
— Base classes for optimization algorithms and plugins - 4.2.
pyopus.optimizer.cache
— Caching of function and constraint values, and annotations - 4.3.
pyopus.optimizer.optfilter
— Filter-based point acceptance - 4.4.
pyopus.optimizer.coordinate
— Box constrained coordinate search optimizer - 4.5.
pyopus.optimizer.hj
— Box constrained Hooke-Jeeves optimizer - 4.6.
pyopus.optimizer.nm
— Unconstrained Melder-Mead simplex optimizer - 4.7.
pyopus.optimizer.grnm
— Grid-restrained Nelder-Mead simplex optimizer - 4.8.
pyopus.optimizer.sanm
— Unconstrained successive approximation Nelder-Mead simplex optimizer - 4.9.
pyopus.optimizer.sdnm
— Unconstrained sufficient descent Nelder-Mead simplex optimizer - 4.10.
pyopus.optimizer.boxcomplex
— Box’s constrained simplex optimizer - 4.11.
pyopus.optimizer.de
— Box constrained differential evolution optimizer - 4.12.
pyopus.optimizer.psade
— Box constrained parallel SADE global optimizer - 4.13.
pyopus.optimizer.qpmads
— Mesh adaptive direct search with quadratic programming
- 4.1.
- 5.
pyopus.problems
— Test problems for optimizaion algorithms- 5.1.
pyopus.problems.cpi
— Common problem interface - 5.2.
pyopus.problems.glbc
— Global optimization test functions - 5.3.
pyopus.problems.cec13
— Problems from the IEEE CEC 2013 competition - 5.4.
pyopus.problems.mgh
— More-Garbow-Hillstrom set of test functions - 5.5.
pyopus.problems.mwbm
— More-Wild set of test functions for DFO, data profile generation - 5.6.
pyopus.problems.madsprob
— Mesh adaptive direct search test problems - 5.7.
pyopus.problems.lvns
— Lukšan-Vlček set of nonsmooth problems - 5.8.
pyopus.problems.lvu
— Lukšan-Vlček set of unconstrained problems - 5.9.
pyopus.problems.karmitsa
— Large scale nonsmooth test functions (Karmitsa set) - 5.10.
pyopus.problems.cuter
— Wrapper for accessing CUTEr problems - 5.11.
pyopus.problems.cutermgr
— CUTEr problem manager - 5.12.
pyopus.problems.cuteritf
— CUTEr problem binary interace source code
- 5.1.
- 6.
pyopus.design
— Design automation support- 6.1.
pyopus.design.sensitivity
— Finite difference sensitivity computation and parameter screening - 6.2.
pyopus.design.wc
— Worst case performance computation - 6.3.
pyopus.design.wcd
— Worst case distance computation - 6.4.
pyopus.design.mc
— Monte Carlo analysis - 6.5.
pyopus.design.cbd
— Sizing across corners - 6.6.
pyopus.design.yt
— Yield targeting (design for yield) - 6.7.
pyopus.design.sqlite
— Support for sqlite database
- 6.1.
- 7.
pyopus.plotter
— Threaded plotting support based on Matplotlib and PyQt5- 7.1.
pyopus.plotter.plotwidget
— PyQt5 canvas for displaying Matplotlib plots - 7.2.
pyopus.plotter.manager
— Manager for Matplotlib plot windows - 7.3.
pyopus.plotter.interface
— Functional interface to the plot window manager - 7.4.
pyopus.plotter.evalplotter
— A PyQt5 and Matplotlib based simulation results plotter - 7.5.
pyopus.plotter.optplugin
— An optimization algorithm plugin for visualization of simulation results
- 7.1.
- 8.
pyopus.netlister
— Netlisting support for EDA packages - 9.
pyopus.misc
— Misclellaneous functions - 10. PyOPUS Library Tutorials
- 10.1. Plotting facilities in PyOPUS
- 10.1.1. Opening plot windows
- 10.1.2. Adding axes and traces to plot windows
- 10.1.3. Creating subplots (multiple axes in a single plot window)
- 10.1.4. Manually specifying subplot size and position
- 10.1.5. Logarithmic plots
- 10.1.6. Scaling the axes
- 10.1.7. Polar plots and aspect ratio
- 10.1.8. Annotating plots
- 10.1.9. Saving a plot to a file
- 10.1.10. 3D plots
- 10.2. Using the virtual machine abstraction layer
- 10.3. Algorithm parallelization
- 10.3.1. Context switching in cooperative multitasking
- 10.3.2. Remote tasks (task outsourcing)
- 10.3.3. Dispatching a set of tasks and collecting the results
- 10.3.4. Dispatching an unknown number of tasks, collecting results with a results collector
- 10.3.5. Writing a custom dispatcher
- 10.3.6. Performing many differential evolution runs on a cluster of workstations
- 10.4. Simulators and result evaluation
- 10.4.1. SPICE OPUS simulator interface
- 10.4.2. HSPICE simulator interface
- 10.4.3. SPECTRE simulator interface
- 10.4.4. Using the performance evaluator
- 10.4.5. Plotting simulation results
- 10.4.6. Constructing an aggregate cost function
- 10.4.7. Optimizing a circuit
- 10.4.8. Plotting the circuit’s response during optimization
- 10.5. How to use KiCad with PyOPUS
- 10.5.1. Using the pyopus.lib library in eeschema
- 10.5.2. Customizing netlister behavior with component fields
- 10.5.3. Customizing netlister behavior with .json files
- 10.5.4. Customization example: netlisting MOS devices as subcircuits
- 10.5.5. Customization example: generating MOS mismatch parameters
- 10.6. Miller opamp design with PyOPUS
- 10.1. Plotting facilities in PyOPUS
- 11. PyOPUS design automation GUI
- 11.1. Introduction
- 11.2. Setting up a project
- 11.3. A simple circuit evaluation task
- 11.4. Viewing the results and postprocessing saved waveforms
- 11.5. Nominal design task
- 11.6. Running a task on multiple processors
- 11.7. Design across multiple corners
- 11.8. Inspecting a results database file from command line