Optimize Analog Circuit Sizes with ESSAB Using msbOptimizer
R2026bThis example shows how to use the msbOptimizer class with the ESSAB (Efficient Surrogate Model-Assisted Sizing for Analog Building Blocks) solver to optimize transistor sizes of a single-stage CMOS operational transconductance amplifier (OTA). The design is simulated in Cadence® Virtuoso® and optimized from MATLAB® using the optimizeDesign method. ESSAB uses a neural network surrogate combined with Differential Evolution to efficiently explore the analog design space. The example also compares ESSAB against the RBF-based surrogateopt solver to illustrate when each approach is most effective. This example considers these OTA performance specifications:
bandwidth (3dB),
current,
gain,
slew rate, and
unity gain bandwidth
Click on "Open Live Script" to access the example files including the design database which is contained in OTAdesignDatabase.zip. The maestro view to be used in this example is under the hierarchy: msbOptim library, tb_opamp cell, maestro view. Follow the steps below in Cadence to setup the PDK and the required libraries:
Download the generic pdk "GPDK045" from the Cadence support page and place it in the same location as the project folder "msbOptim".
Edit the "cds.lib" file to update the library paths as needed.
Right-click on the test "JESD_RX_tb_opamp_1" in maestro view and set the path to "gpdk045.scs" under "Model Libraries".
The maestro view in the database under library "msbOptim" and cellname "tb_opamp" is already set up to run the optimization process. This includes setting up the design specifications in Outputs Setup of maestro view and declaring the device parameters to optimize.
Import adeInfo (Handle to Cadence Simulation Data)
Run a nominal simulation by disabling the Parameters and then launch MATLAB from the Results tab on maestro view. This makes the adeInfo object available in the workspace so you can also launch Cadence simulation from MATLAB.

Optimization Workflow
The first two steps in the workflow use Cadence Virtuoso while the third and fourth steps use MATLAB. The first two steps are already performed in the design provided with this example. You can skip to Start the optimization routine if you are using the design provided. But if you are using a different design for optimization, start from Setup optimization specifications.
Setup optimization specifications in the Outputs Setup of Cadence maestro view.
Declare optimization variables to be the transistor device parameters in the Cadence maestro view. Also define the range of values that the parameters can take.
Start the optimization routine which results in several simulation runs. Optimization routine stops when the goals or stop criteria are met.
Set the optimized parameter values to device parameters.
Setup Optimization Specifications
Define the performance specifications in the Outputs Setup of the maestro view. Then import them into MATLAB as optimization specifications.

To configure the specifications in the output table:
Add a Spec column to the output table in maestro view. Each spec defines the design goal for that metric. Examples:

minimize 100u(minimize current toward 100 uA),maximize 80(maximize gain toward 80 dB),< 500u(current below 500 uA),> 2e6(bandwidth exceeds 2 MHz),range 1M 10M(bandwidth between 1-10 MHz),tolerance 5M 10(within +/-10% of 5 MHz).Engineering suffixes (
n,u,m,k,M,G) are supported for convenient specification of IC-scale values.
The Weight column is no longer required. The optimizer treats all specifications as constraints and optimizes them simultaneously.
Save the maestro view.
Declare Optimization Variables in Cadence
Optimization variables or parameters are the quantities that you vary to meet the design specifications. Follow the steps below to declare and setup device parameters as optimization variables. Setting up device parameters is explained in Virtuoso ADE Assembler User Guide under the section Working with Device Instance Parameters.
Add parameters to be optimized in the maestro view. This opens the schematic view which lets you set parameter range and also select the device parameters those need to be matched. For example, select the input transistors of an op-amp as matched parameters.

Set the range of values that each parameter can take in the format
Min:Step:Maxusing the scientific or exponential notation. For example, if the parameter M24I can vary between 3 um and 10 um with a step size of 0.1 um, set the parameter as3e-6:0.1e-6:10e-6. Similarly, if the parameter M24W can vary between 3 um and 40 um with a step size of 0.1 um, set the parameter as3e-6:0.1e-6:40e-6.If you want to save the setup state to rerun the optimization process, click File > Save Setup State on the maestro view.
Select all the parameters, right click on the selection, and select Group as Parametric Set. Enable the Parameters and save the maestro view. More information about Parametric sets can be found in this Cadence blog post.
Start the Optimization Routine Using msbOptimizer
The msbOptimizer class provides a unified interface that handles all the optimization setup internally. You do not need to write objective functions, constraint tables, or custom plot functions manually.
Create the msbOptimizer Object
Before creating the optimizer, run a nominal simulation (single corner) in the Cadence ADE Assembler to verify that the testbench is configured correctly and all metrics can be measured. After the simulation completes successfully, enable the design variables for optimization in the Parameters section of the Data View panel, then click the M button in the ADE toolbar . This launches a MATLAB session connected to Cadence and places the adeInfo object in the base workspace. The adeInfo object contains the full design state including output specifications, design variable ranges, and corner definitions. Now create the optimizer:
%% Create optimizer with ESSAB solver % Prerequisites: % 1. Run a nominal simulation in Cadence ADE Assembler % 2. Enable optimization parameters in the Data View panel % 3. Launch MATLAB from Cadence using the M button % (this places 'adeInfo' in the base workspace) moptimizer = msbOptimizer(SimulationEnvironment="cadence", ... Solver="essabopt", ... DesignName="tb_opamp")
The msbOptimizer object automatically reads the Outputs Setup (performance specifications) and Parameters (design variables with ranges) from the Cadence maestro session via adeInfo. Verify the imported settings:
%% Verify imported specs and parameters
disp(moptimizer.OutputsSetup)
disp(moptimizer.ParametersSetup)


Run the Optimization
Run the optimization using the optimizeDesign method. Use MetricToPlot to select which metric is displayed on the progress plot. Here we track "gain" to monitor OTA gain during optimization.
%% Run ESSAB optimization % - NumParallelSims: Number of Cadence simulations to run in parallel % - MaxNumberSims: Total simulation budget % - MetricToPlot: Metric to display on the progress plot (default: first metric) % - RngSeed: For reproducibility [solution, metrics] = moptimizer.optimizeDesign( ... NumParallelSims=8, ... MaxNumberSims=120, ... MetricToPlot="gain", ... RngSeed=42)
The ESSAB solver uses a neural network surrogate model combined with Differential Evolution to efficiently search the design space. It initializes with max(20, 5*nvar) random simulations (50 for 10 variables), then uses the trained ANN to guide subsequent evaluations.

Inspect Results
After optimization completes, inspect the solution and metrics directly from the optimizer object:
%% View optimized results disp(moptimizer.BestSolution) disp(moptimizer.BestMetrics) fprintf('Exit flag: %d\n', moptimizer.Eflag);

Continue from Checkpoint
If the optimizer does not meet all specifications within the simulation budget, continue from where it stopped using the checkpoint file:
%% Continue optimization from checkpoint % MaxNumberSims specifies the additional budget on top of already-completed sims [solution, metrics] = moptimizer.optimizeDesign( ... UseCheckPoint=true, ... MaxNumberSims=60, ... NumParallelSims=8)
The ESSAB population state, ANN training history, and best-known solutions are all preserved when resuming from a checkpoint.
Set Optimized Parameter Values
If you are satisfied with the performance specifications after optimization, the optimized parameter values are stored in moptimizer.BestSolution. To apply them back to the Cadence design:
%% Apply best solution to Cadence disp(moptimizer.BestSolution) % Set the optimized values in Cadence one parameter at a time: for i = 1:height(moptimizer.BestSolution) adeSet(paramName=moptimizer.BestSolution.Name(i), paramValue=moptimizer.BestSolution.Value(i)) end
Alternatively, to backannotate the optimized parameters as design values in Cadence schematic, go to maestro view, select the optimization run that meets all specifications, right click and select Backannotate. This is the recommended approach as it updates both the schematic and the maestro view simultaneously.
