Monte Carlo analysis is a statistical way to analyze a circuit. This simulation allows us **to test the process variation and mismatching** between devices in a single chip or wafer.

Contents

## What is the difference with the corner analysis?

The **Corner analysis** simulates your design with the minimum and maximum value of each parameter. But it does not reproduce the mismatching between devices! The corner analysis makes the problem much harder than it really is. It simulates **extreme cases, that in real fabrication process will never occur**, because of the correlation between parameters are not taken in account.

A basic corner analysis can be around 65 simulations, taking the maximum and minimum of the process variables:

**CMOS thickness:**wp, ws, wo, wz.**Resistor value:**wp, ws.**Capacitor value:**wp, ws.**Temperatures:**(typ.)-20 to 85ºC**Voltage supply:**depend on your supply source, etc.

Typical number of simulations: tm+ 4CMOS*2RES*2CAP*2TEMP*2Vsupply = 65

Where:

- ws = worse speed
- wp = worse power
- wo = worse one
- wz = worse zero

For example, if the CMOS gate oxide thickness is big for NMOS, it will be also big for the NMOS. It is not realistic to simulate the case when the thickness of the NMOS is minimum and the PMOS is maximum.

**Corner analysis will guarantee that the circuit will work**, of course, under all possible consideration, **but it will overdesign your circuit**.

## Monte Carlo Simulation in Circuit Design

**Monte Carlo** is** based on statistical** distributions. It will simulate mismatching and process variation in a realistic way. On **each** **simulation** **run**, it will **calculate every parameter randomly** according to statistical distribution model. With this analysis you will see in which region your circuit will work the most of the time.

The **drawback** of Monte Carlo is the large **amount of simulations** required to have acceptable results. It should be **at least 250**. This is much higher comparison than the Corner analysis.

For the previous example with the gate oxide thickness, the Corner analysis will simulate the worst case of the minimum and maximum values of the thickness parameter in this case as the following table shows:

But in reality if the NMOS is thin, the PMOS transistor will have also similar thickness. This area is shown in the yellow region.

Another type of corner analysis is known as **“statistical corner models”**, here thousands of real produced wafers are measured. Now the statistical corner analysis considers correlations of map parameters. This analysis **improves the Monte Carlo** pure statistical method with the feedback of the real wafer measurements.

**Actualization: Example of Monte Carlo simulation in Cadence**

In **this example a clock is going to be simulated**.This clock has a configurable frequency output from 0.84MHz to 1.88MHz depending on the digital input of 4 bits.

First **make sure that the simulation is working** fine in **nominal conditions** and try to short the time as much as possible. If you want to run hundreds of even thousands of simulations, you have to save time and only simulate the minimal amount of time.

In the following picture, the results for the clock are shown. The frequency f_0 and f_15 are the values to be tested on the simulation. The nominal values are 836kHz and1.89MHz. Let’s see later how much do the change…

Before Monte Carlo, normally a corner simulation is performed, in order to see what to expect. For this case the Process corners simulations looked like:

Select Monte Carlo Sampling and choose the number of simulations on the configuration window:

later go to the Corners set-up, as shown on the picture below, and choose if you want to vary the temperature or other parameters. In my case I want variations on the temperature (-20-to+85°C) and in VDD (the power supply from 1.1V to 1.3V). Then depending on the technology used, you will have another Monte Carlo model files.

Deactivate the nominal simulation. Run the Monte Carlo. The results “Yield” window will appears similar to the picture below. There the average, standard deviation, etc are shown.

To plot the histogram click on the icon and the select “histogram”:

here you can play with the parameters or which data you want to plot. If you want to combine all the cases you plotted (in my case 4 cases because of 2 temperatures and 2 VDD). You can press “Combine” to plot all together as shown in the next picture:

Then you can export the graph with white background to insert it on your documentation or reports:

**Example of Monte Carlo simulation in Cadence with ADE-XL**

In this example a cascade circuit is going to be used to make the Monte Carlo simulation.

Add the Dc- simulation to save the operation point of the circuit.

To have a good performance, you can put many jobs in parallel, depending on how many cores does your machine has. In this case I am using a 8 core machine, so I set 8 simulations in parallel.

Go to Options>> Job setup.

Make a DC-simulation a plot the currents.

Add this values from the calculator into the output window in the ADE XL.

Copy this expression and paste them on the ADE XL.

You can add them by Outputs>>Setup

You should get something like. Delete every corner and leave one, that we are going to use as a reference.

We want to make the Monte Carlo Simulation for the nmos transistor, we chose the model cmosmc (Monte Carlo). If we wanted the Monte Carlo for the resistor you should chose “resmc”.

Select it on the Data View.

Go to options for the Monte Carlo Simulation

Set the configuration parameters. Set to process if you want to check the changes on the process in the electrical parameters. If you want to test the changes by matching on the transistors, select then Mismatch. And the number of points, start with something low, for testing, then you can increase it to a larger amount of simulations.

After the simulation, you can right-click and select “historiogram” to plot the results.

For a larger number of simulations:

Can you provide more detail regarding the models? I am mainly interested in how to setup a monte-carlo simulation from scratch.

I am quite bus right now, but when I have more detailed information i will update the post!

Best Regards