Cadence Tutorial A: Schematic Entry and Functional Simulation
Cadence Tutorial A: Schematic Entry and Functional Simulation
Cadence Tutorial A: Schematic Entry and Functional Simulation
Document Contents
Introduction
Environment Setup
Creating a Design Library
Creating a Schematic Cellview
Functional Simulation (transient analysis)
Introduction
This document is a tutorial for using CADENCE Custom IC Design Tools for a typical
bottom-up digital circuit design flow with the AMI06 process technology and NCSU design kit.
This document, Tutorial A, covers setup of the Cadence environment on a Linux platform, use
of the Virtuoso schematic entry tool, and use of the Affirma analog simulation tool.
Note: Your paths may be different depending on the project you are working on. Also note that
you can find additional tutorials and notes on the web from courses at other
universities. These may be helpful in learning Cadence, but because of differences in the
environment setup, you probably will not be able to follow a different tutorial step by step.
For more information about Cadence Virtuoso or the Affirma tool, see the manuals.
Environment Setup
Before beginning this tutorial you must setup Cadence to work with your account.
Some of the dialog boxes you see may be different from the ones given in this tutorial. This is
because different versions of Cadence are used in SEECS.
If you have not already done so, launch Cadence now by going to your working directory and
typing icfb& at the command prompt. A Command Interpreter Window (CIW) similar to the
example below will appear. When all the configuration files have been read, the END OF SITE
CUSTOMIZATION message will be displayed indicating the startup was successful. With each
new session, Cadence starts a new CDS.log file in your home directory where all the messages
that appear in the CIW will be stored.
Along with the CIW window, you should also see the Library Manager window that lists the
libraries in your working directory. For now the NCSU-Analog-Parts library is the important
one since it has basic circuit elements like transistors, current sources, voltage sources, ground,
resistors, capacitors etc.
1
Command Interpreter Window
In this tutorial, a simplified convention will be used to show the sequence of steps for the pull
down menu. For example, File => Exit will indicate that you open the pull down menu for File
and then click on Exit. Another example could be Tools => Analog Artist => Simulation, which
will indicate that you pull down the Tools menu, then click on the Analog Artist button and
finally click on the Simulation button.
Note: If at anytime during this tutorial you want to quit Cadence, make sure you save your work
by selecting Design => Save and close the design windows by selecting Close from the menu.
After you have closed all your working windows, select File => Exit and click Yes in the pop-up
confirmation window to end the Cadence session.
2
A library (which actually appears as a directory in Linux) contains cells (subdirectories), which
in turn contain views. Each library contains a catalog of all cells, viewed along with the actual
LINUX paths to the data files. Each cell in a library uses the same mask layers, colors,
design rules, symbolic devices, and parameter values (i.e. the information contained in the
technology file). A cell is the basic design object. It forms an individual building block of a chip
or system. It is a logic, rather than a physical, design object. Each cell has one or more views,
which are files that store specific data for each cell. A cellview is the virtual data file created to
store information in Cadence. A cell may have many cellviews, signifying different ways to
represent the same data represented by the cell (for example, a layout, schematic, etc).
Example Organization:
Library: logic_gates
Cell: inv
View: schematic
View: symbol
Cell: nand2
View: schematic
View: symbol
View: layout
View: extracted
Library: ripple_carry_adder
Cell: 1bit_adder
View: schematic
Cell: 2bit_adder
View: schematic
3
Creating a Schematic Cellview
STEP 2: Create a new schematic
Go to the Library Manager window and click/select your library (for example tutorial).
Now select File => New => Cellview. Use the Create New File window that pops up to
create the schematic view for an inverter cell.
Enter the Cell Name inv.
Click on Tool drop-down list and select Composer-Schematic. This is where you choose
which Cadence tool you want to use and the appropriate View Name for each tool will be
filled in automatically. Here we will be creating the schematic view.
Click the OK button. The Virtuoso schematic editing tool will open with an empty
Schematic Editing window as shown below.
4
STEP 3: Add an nFET to the schematic
In the Schematic Editing window Select Add => Instance to activate the Add Instance tool
for adding components (transistors, sources, etc.) to your schematic. You can also invoke
this tool by clicking on the Instance icon on the left-hand toolbar, or by typing the hot key i
with your mouse over the Schematic Editing window. Two windows (Component Browser
window and Add Instance) will pop open.
5
In the Component Browser window, under Library select NCSU_Analog_Parts. A list of
parts will be displayed near the bottom of this window. From the parts list, click on
N_transistors and a list of available nFET transistor elements will be displayed. Pick up the
nmos4 element by clicking on it. This will attach the component to your mouse pointer.
If necessary, click on the Rotate, Sideways, or Upside-down buttons in the Add Instance
window to manipulate the component you are adding.
Click on schematic area of the Schematic Editing window (main black area of the window)
and the nmos4 component will appear in your schematic. Clicking on the schematic window
again will add another copy of the component (dont do this). Pressing ESC on the keyboard
will end the Add Instance function (but dont do this yet).
6
Follow the same procedure to add output pin Y. to the right of the transistors between the
drain nodes. Be sure to use the correct pin direction. Press ESC when you are done.
8
The Symbol Editing window will pop up showing the default symbol, a rectangle with red
square dots for input and out pins. You can keep this symbol, but it would be helpful if you
modified it to a more meaningful symbol (such as a triangle for an inverter). Explore the
options on this window and the tips below to define your symbol graphic.
When the symbol is complete, save it. In the Symbol Editing window select Design => Save
or click on the Save icon at the top of the toolbar.
In the Symbol Editing window, select Window => Close to close the symbol.
9
Simulation with Affirma Analog Circuit Design Environment
To verify a circuit is working and test the functionality of the schematic we must simulate the
circuit. For this we will use the Cadence Affirma analog simulation tool. For now we will just
run a simple transient analysis to confirm the circuit designed above is operating as an inverter
should be. Additional information for running simulations with Cadence tools will be provided
later in the class.
10
In Affirma Analog Circuit Design Environment, click on Setup => Environment.
Next to Use SPICE Netlist Reader(spp):, click the box Y. This is necessary because the
AMI06 transistor model libraries use SPICE netlist syntax. Click OK to close this window.
You will need to use a text editor in order to create a stimulus text file. You can use any editor
you are familiar with. You can name the stimulus file any name, and put it wherever you wish.
In this tutorial, we will call the file stimulus.txt and place it in your directory. If you are new
to LINUX, you may want to nedit by doing the following:
Open a terminal screen (or use any one that is already open).
Make sure you are in your Cadence directory. If unsure, type
cd /home/<groupname>/<userid>
Type nedit & to create a new file.
Once you have opened a text editor, type in the following three lines to define the simulator
language (spectre), the DC supply voltage and a square wave pulse input voltage that will be
useful for a transient analysis simulation to verify functionality of the inverter circuit. Note
that the input waveform used may vary with the type of analysis needed, although the supply
voltage source will generally remain constant.
o simulator lang=spectre
o vdd (vdd! 0) vsource dc=3
o V1 (A 0) vsource type=pulse val0=0 val1=3 delay=0 rise=0.05n
fall=0.05n width=10n period=20n
Note: Each bulleted item represents one line in your stimulus file. The third bullet item
(voltage pulse) is broken into two lines due to the document margins, but should only take up
one line in your stimulus file.
Make sure that you always end the last line by pressing Enter. This adds a new line character
to the line, and informs the simulator that the voltage definition is complete. If you do not do
this, you will likely get a netlist read error when you try to Netlist and Run the simulation.
11
Save the text file. If you are using Nedit, this can be done by
o Selecting Files => Save As
o In the New File Name: box, the current path will be displayed. Click on the
blinking cursor and add stimulus.txt to the path.
o Click OK. This will save the file
You can exit the text editor at this point (nedit: select File=>Exit). However, you may want
to keep it open if you plan on making changes to the file during simulation.
where the default units are volts and seconds. The n on the time values sets them to
nanoseconds (i.e. n is a 10-9 multiplier). Although you can vary the timing values as necessary
to meet simulation goals, the rise and fall times listed are good for the AMI-C5N technology and
should not be modified unless you are sure you know what you are doing.
Once you have written a stimulus file, open (refocus) the Affirma Analog Circuit Design
Environment window. Click on Setup => Simulation Files.
Click on the box that is labeled Stimulus File so that a blinking cursor appears in it.
Click the Browse button to open a file browser window.
Navigate to where you have saved the file stimulus.txt if you have followed the
tutorial exactly, it should appear in the default directory opened by the file browser.
Click on the name stimulus.txt and then click OK. The file browser should close, and
the absolute pathname for your stimulus file should appear in the Stimulus File box.
Click OK to apply changes and close this window.
12
wish to simulate the response of our inverter to a simple square wave input and verify that the
output is indeed being inverted. For this we will setup a transient (over time) analysis.
Alternative analysis types, including DC analysis, that are used to simulate different performance
characteristics of a circuit are covered later in the course.
In Affirma Analog Circuit Design Environment window, select Analyses => Choose.
In the window that pops up, select tran to choose a transient analysis.
Enter the time limits for simulation by entering a Stop Time of 50n.
Choose Enabled at the bottom of the screen and press OK.
13
Run.
When the simulation is complete, the CIW should show "Reading Simulation Data ......
Successful". If the simulation was not successful, go to Simulation => Output Log in your
Affirma Analog Circuit Design Environment to find out what the problem was.
If the simulation results shows a typical inverter response (i.e. output high when input is low
and visa versa) then the circuit is working properly. If not, you will need to go back to the
schematic to track down the problem and rerun simulations until you get the proper response.
To separate input and output signals, in the Waveform Window click on Axes => To Strip.
When this simulations results are correct, you have completed this tutorial.
14