Cadence Tutorial
Cadence Tutorial
Table of Contents
Introduction.......................................................... .............................2
Shorthand Conventions..................................................................4
Troubleshooting.............................................................................4
Simulation.......................................................................................19
Analysis...........................................................................................26
Calculate Values..........................................................................27
Introduction
This tutorial will introduce the use of Cadence for simulating circuits in 6.012.
Cadence is a suite of tools for IC design. It allows for schematic capture, simulation,
layout and post-layout verification of analog and digital designs. We will be using a
portion of the analog design flow, which can handle up to 200,000 devices.
We will use Composer to enter/capture the schematics of circuits that we will
simulate and the test benches with which we will simulate them. We will use Analog
Design Environment (ADE) to configure a simulator, in this case Spectre to simulate
our circuit with device models that represent the transistors in our circuit.
This tutorial will explain how to set Cadence up on the MIT Server. An overview of the work
flow in Cadence is shown in Figure 1. Starting from near the top of the figure we will
use the Command Interface Window (CIW) to start the schematic composer. We will
capture a schematic of an inverter. We will create a symbol for the inverter. We will
create a test bench to test the inverter. We will create device models for our FETs in a
text editor. We will open ADE and configure and run our simulation in spectre. Then
we will plot our results.
A circuit simulator is a tool. In order to design circuits efficiently you need to use
this new tool effectively. The simulator is good at solving thousands of operating
points. A good way to use the simulator is to first understand the circuit and then
sweep the simulation over the entire area where the solution lies.
We know that the DC transfer function of a well behaved inverter always has a cross
over point VM where vin =vout, which we want to find. We will simulate the DC
transfer function of the inverter by simulating every point on the curve. Then we can
select VM by inspection. Because we understand the inverter's behaviour we know
that if we sweep the input from 0 to VDD we will find the VM if it exists.
It is easy to use the simulator ineffectively. The simulator is not your brain; it can't
understand anything about the circuit. If you are just collecting data and not thinking
about it, then you are wasting time. The simulator isn't a pen and paper calculation.
If you are running single point calculations and aiming for exact agreement with hand
calculations you will be frustrated. Instead of running single point simulations and
stabbing in the dark, you should think about sweeping some parameter to collect data
with trends that you can think about.
The previous three paragraphs were the most important paragraphs of this tutorial.
Now we will proceed to become lost in the details of this particular simulator.
6.012 Microelectronics Devices and Circuits Fall 2005
3
Shorthand Conventions
The following are shorthand conventions used in this tutorial
1. When navigating a series of submenus, the tutorial will abbreviate the instruction,
“Start in the Command Interface Window (CIW) and click on Tools, then click on
Library Manager” to
Click on CIW->Tools->Library Manager.
2. Cadence has many keyboard shortcuts. When the tutorial writes a letter of a
command in parentheses it means that letter is the short cut. Capitalization is
significant. For example i is the shortcut for (i)nstantiate.
Troubleshooting
This is a very brief section on trouble shooting. Keep in mind that this is an exercise
to configure and run some simple simulations in Cadence. The problems are computer
or programming problems. Remember the adage, “Stop the bus. Get out of the bus.
Close the doors. Open the doors. Get in the bus. Start the bus.” So at any step if you
think you have worked Cadence into a weird state. Save your work. Copy it to a new
cell, new saved state etc. Exit Cadence if you think it is that hosed. (This is very
possible). Go back to the last known good position and start again. The major section
heading of this tutorial are good checkpoints.
6.012 Microelectronics Devices and Circuits Fall 2005 5
General Setup
The cadence script starts up icfb (IC Fab) and will open two windows: the CIW
(command interface window) and a Library Manager window. If it also opened a
What's New in 5.0 window, then close that window.
In the Library Manager you can see that things in Cadence are organised into
libraries, cells and cellviews. Libraries are used to categorize cells that belong
together. You can look through the analogLib and basic libraries which contain all of
the basic analog components that we will use: voltage sources (vdc), current sources
(idc), grounds(gnd), resistors (res), capacitors(cap) and other basic things. Cells are
names of individual parts/circuits that you can place in a schematic. You can place
cells within cells to create a hierarchy. Views/cellviews are ways of looking at a cell.
We will use the schematic and symbol views. Close the Library Manager for now.
6.012 Microelectronics Devices and Circuits Fall 2005 6
Create a Library.
First we need to create a library for our Cadence work.
1. Click on CIW->Files->New->Library. The CIW is the only window left.
2. Change to directory ~/cds/libs. If necessary, create it in unix.
3. Choose a library name.
4. Click on “Don't need a techfile”.
5. Click OK.
This will open a blank Composer schematic capture window. Along the left are
buttons that do things. Along the top are pull down menus that do more things. Now
is an excellent time to play with all of the buttons and menus, except for the Tools
menu. You will notice that many of the command have letters beside them which are
their hotkeys, or bindkeys in Cadence parlance.
Before we start here are some useful commands that we will use later. (i)nstantiate
creates a new object in the schematic. (p) creates pins to allow signals to leave the
schematic. (c)opy allows you to copy objects. (m)ove with a lower case m moves
objects and drags their wiring with them. (M)ove with an uppercase m moves objects
after disconnecting their wires. (l) allows you to create labels for wires so that they
don't get stuck with the default names, like net994875. (q)uery opens a dialog box
that shows an object properties. (w)ire allows you to create wires. After you type w,
left click to start a wire, left click to make a corner and double left click to end the
wire. Some commands like copy, move and wire have dialog boxes with more options
that can be hidden. (F3) displays these dialog boxes. Also note that Cadence
commands use the bottom line of window as an information bar.
Now we will create the inverter schematic. First we place an NMOS instance from
the analogLib library.
1. Press i.
6.012 Microelectronics Devices and Circuits Fall 2005 8
2. Click on Browse. Go to the analogLib library and click on the nmos4 cell. Then
click on the symbol view. Then click close. nmos4 is a 4 terminal device, which
means that the bulk/well terminal is explicitly shown on the symbol.
3. We now have a form with all of the options that we can set for an nmos4. Fill it out
as shown below.
4. Now go back to the Composer window and left click somewhere in the black space
to place an instance of the nmos device. Placing an instance uses the value in the
form when you left click in the composer window. If you later want to change those
values, select the object and press (q)uery to edit the form.
5. Place an analogLib pmos4 symbol with parameters model=pmos6012, w=6u, and
l=1.5u above the nmos4.
6. Place an analogLib vdd symbol and an analogLib gnd symbol somewhere as well.
7. Type p to create pins. Change the name to in and the type to input. Your form will
look like:
10. To save your schematic press X, or click the check mark right under the Tools
menu. This will check and save your schematic. It will report anything it considers
an error or a warning. Before you can simulate you need to clear all errors.
11.You are done creating the inverter schematic.
6.012 Microelectronics Devices and Circuits Fall 2005 11
2. Pins can be placed on the left right top or bottom. We want our in pin on the left
and our out pin on the right. Shrewd observers will have noticed that there are no
pins in the list for vdd and gnd, which will need to be connect to a power supply.
The vdd and gnd symbols create nets called vdd! and gnd! which are global nets
that are implicitly connected everywhere even without pins. Click OK.
3. Now a symbol editor window will pop open. The default symbol is good enough,
but if you want to improve it use the Add->Shape->Polygon, Add->Shape->Line,
Add->Shape->Circle, (c)opy, (m)ove/stretch and delete (delete key) commands to
make the symbol look as below.
To make the symbol below, you will need to delete the original green box. Grab
the edge, stretch it, click in the middle of it and then delete it.
Note the following things. The red bounding box is the area that you will be able
to click on in higher level schematics to select your inverter, so don't delete it. If
you accidentally delete the pins, it is easier to go back to the inverter schematic and
start over.
Each time that you create a MOS device in a schematic it is called an instance. The
following table lists all of the instantiated parameters that can be changed for each
instance or device that you create.
W and L are in this table and for that we happy. Think about and write formulae in
terms of l, w and ldiff (the length of the source/drain diffusion) for the diffusion area
(lds, ldd), the diffusion perimeter and number of squares of the source and drain to fill
in the empty values on the table. You will need to change these every time that you
change the w and l device sizes. We will look at a more sophisticated model in the
second tutorial that automatically calculates expected values for these.
You may have noticed that lambda is in the non-instantiated parameter table and we
want it to depend on length. Our more unsophisticated model will also overcome this
problem.
Simulation
3. Add the models that we just created. Click on Setup->Model Libraries. Click
Browse. Go to the ~/cds/models/ directory and select mos6012.scs. Click OK.
Click Add. Check that the window looks like the example and then click OK.
4. Click Setup->Temperature and change the temperature to 25 degrees and click OK.
5. Every time that you setup a simulation, where you do not load a previous state you
will have to repeat these steps, unless you find out how to save these as your
Cadence default. If your TA discovers that you have changed your Cadence
defaults and that is the source of your woes, it will go badly for you.
3. Set the simulator to save everything. Click on Outputs->Save All. Select save =
allpub, current = all, then click OK.
In general this is a bad idea, because the simulator can generate gigabytes of
data, which may cause the simulating machine to crash. Furthermore, writing all of
that data slows down the simulation and the network. So, if you know what data
you want to look at, then only save that data. We have a very small circuit so we
will save everything.
6.012 Microelectronics Devices and Circuits Fall 2005 22
6. If you are happy with your simulation setup then save it. Click Session->Save
State. Give it name and decide what you want to save (everything) and click OK.
You can use this after you have plotted data, or created equations to save some or
all of the setup that created those results. This doesn't save your data, just the
simulation setup.
6.012 Microelectronics Devices and Circuits Fall 2005 25
Analysis
Plot Results.
Here we will plot the DC transfer function of the inverter and calculate the crossover
voltage where vin = vout and calculate the gain at the crossover voltage.
First lets plot the DC transfer function
1. Click Results ->Direct Plot->Main Form.
2. Select the output and the input wires on the schematic. They should turn different
colours. Press Esc.
3. Titles and labels can be changed under Annotation. You can print this to an eps file
under Window->Hardcopy.
6.012 Microelectronics Devices and Circuits Fall 2005 27
Calculate Values.
Now we will calculate the crossover voltage. We can see it clearly on the plot. We will
open the calculator and find where vin = vout. One way to do this is to find where
vout-vin crosses zero.
The calculator allows you to make expressions of the data from the simulation. We can
do arithmetic on and calculate common parameters of interest to designers.
1. Open the calculator. Click Tools->Calculator. Turn on Display Stack (middle of the
window). The calculator is an RPN calculator and viewing the stack makes it easier
to understand what is happening.
2. Form the expression Vout-Vin. The buttons in the second column from the left refer
to types of data: vt,it (transient data voltage and current), vdc,idc (single point dc
operating point) and vs,is (dc sweep data).
a) Click vs.
c) Click on the input wire on the schematic window. Notice that the VS
3. Calculate the crossover voltage. Click Special Functions(near right side) ->cross.
Set the threshold value to 0 and click OK.
6.012 Microelectronics Devices and Circuits Fall 2005 28
4. You could plot this if you want, but as it is a single data point it makes more sense
to display it in the output section of the ADE window. Plot it and then delete it to
make sure that your expression is correct. There needs to be a space after the
minus sign.
Click ADE->Outputs->Setup. Call it vcross. Click Get Expression. Leave
plotted/evaluated selected so that it recomputes every time you run the simulation.
Click Add. Click on the word vcross in the Table of Outputs frame. It should look
like the picture. Click OK.
6.012 Microelectronics Devices and Circuits Fall 2005 29
5. Now every time you run the simulation it will calculate vcross. Force it to calculate
it now by clicking ADE->Results->Plot Outputs->Expressions.
Now that we have calculated the crossover voltage, we will calculate the gain and the
gain at the crossover voltage. Gain in this case is the slope of the sweep output curve
VS(“/output”).
1. With VS(“/output”) in the Calculator window select Special Functions->deriv.
2. Plot this by opening a new waveform window (ADE->Tools->Waveform) and then
clicking Calculator->plot. You can notice from the plot that the gain of the inverter
peaks very sharply at one voltage. We hope that the voltage is the crossover
voltage.
6.012 Microelectronics Devices and Circuits Fall 2005
30
6. Now is good time to save your ADE state. ADE->Session->SaveState. This will
mean that you can reuse your expressions and setup on another circuit.
Play time.