Cadence Tutorial 3

The following Cadence CAD tools will be used in this lab: You may want to revisit Tutorial 1 and Tutorial 2before doing this new tutorial.

Running the Cadence tools

Please setup your environment, go to your cadence directory and start icfb:

. cadence
cd cadence
icfb &

For more information on the various Cadence tools I encourage you again to read the corresponding user manuals. You can open the on-line manuals by typing:

openbook &

You can also get to the manuals by pressing the Help button on any Cadence window (e.g. CIW). Spend some time browsing the manuals to understand what is available. During the semester you will have to look for information in the on-line manuals to complement the (limited) info given by the tutorials.

Now start the Library Manager by going to Tools -> Library Manager on the Tools menu of the CIW. Now the Tutorial library that you created previously should still appear in the Library Manager window. You can still use the same library for now. Let's start our third schematic now!

SYMBOL CREATION

In this Tutorial 3 we are going to create a hierarchical schematic at the logic (gate) level by using symbols for lower level schematics. First we need to create a symbol for the inverter schematic that we created in Tutorial 2. There are two possibilities for doing this: create a symbol from scratch or edit an existing symbol. To create a symbol from scratch you do that in Composer by going to Design -> Create Cellview -> From Cellview and you get a dialogue box which has the default settings from schematic to symbol which is what we want.

schsym

By pressing OK you can create a default inverter symbol. The only disadvantage with this method is that the default shape is a box and you would need to change that (no big effort really). Since the inverter is a very common gate it is likely that a symbol with the desired shape already exists and we can use it without having to explicitely create the symbol from scratch. For this go to the sample library and choose the symbol view of the inv cell.

invsym

Now do Edit -> Copy and let the From entries unchanged but fill the To entries with the symbol view of your inverter schematic in the lab1 Library.

invto

Press OK. If you go to your Tutorial library to the inverter cell you should find that it now has two views, schematic and symbol. Open both the schematic view and the symbol view by double clicking on the schematic and the symbol view in the Library Manager window. You can notice that the input and output ports have different names (IN and OUT in the schematic and A and Y in the symbol). You need to edit the symbol to change the two port names, go to Edit -> Properties -> Objects and then click on the small square representing the input pin. Change A to IN and Display from off to value.

atoin

Click OK. Similarly change Y to OUT. Now notice that there are still the two labels A and Y that need to be deleted.

delinv

Delete them by clicking on the Delete button on the left (looks like a pencil) or by doing Edit -> Delete and then click on the lables (A and Y). Then you can click and drag the IN and OUT pin values to more convenient locations. You should get something like this.

invsymb

Now you need to save your symbol (click on the left Save button or do Design -> Save, and then go to the schematic window and do Check and Save. You should get no errors or warnings, if you get any you need to go back and fix them. Close the inverter schematic and symbol windows.

HIERARCHICAL SCHEMATIC CAPTURE

Now we can create a hierarchical schematic that uses the symbols that we just created. Go to the Library Manager and with the Tutorial library highlighted do File -> New -> Cell View and create a schematic view for a cell named InvRing. The Composer schematic editor window should open up. Let's create a schematic of a ring oscilator with 11 inverters. Click on instance and choose the symbol view of the cell inverter. We are going to place 6 inverters first and we can do that with just one command by filling the Array inputs, let's say Rows 1 and Columns 6 (all 6 inverters will be arranged horizontally).

addinst

Now click once to place the left most inverter, then move the mouse to the right and click again to place the remaining ones. If you make a mistake you can always do Edit -> Undo and try again.

sixinv

Press ESC. Now we need to place the other remaining 5 inverters but they need to face left. For this we do again place instance with 1 Row and 5 Columns but before we place the inverters we need to click twice on the right mouse button, this will rotate the inverter symbol by 180 degrees. Then click the left mouse button once for the right most inverter, then move the mouse to the left and place the remaining inverters.

elevinv

Now we only need to wire the 11 inverters into a ring and add a vdd and a gnd symbol from the analogLib library (leave them unconnected on the top). Do Check and Save and make sure you have no errors or warnings.

ringinv

SIMULATION

First we will perform a transient simulation to see that our inverter works correctly. In the Composer window go to Tools -> Analog Artist. The design should be set to the right Library, Cell and View. Go to Setup -> Model Libraries and choose (you can type directly or use Browse)
/net/sr10/hplp/models/ptm/100nm/bsim100nm.scs then click Add, then OK. We also need to set up inputs and power supply since we don't have explicit voltage sources as in Tutorial 1. Go to Setup -> Stimuli. We only need to setup the global sources (power supply) since there are no other inputs or outputs for the ring oscillator. Click on the Global Sources, you should have only one (vdd!). Click on Enabled, Function dc, Type Voltage, DC voltage 1.5, Source type dc, and click on Apply. The vdd! should turn from OFF to ON. CAUTION Cadence is very fragile concerning this dialog box, make sure you enter the numbers exactly as above (i.e. no space between the digit and n, etc.). If you get syntax errors later in siumlation they are most likely because of this. Now you need to choose the type of simulation, go to Analyses -> Choose... In this case we will choose tran which is the default, 2n as the Stop time and moderate as the accuracy default. Now go to Outputs -> Save All and make sure allpub is checked for signals to save (default). Click OK. CAUTION In general, once you have a big schematic, you will want to only save a few signals for simulation, this will make your simulation faster. For small circuits as we have now it doesn't make a big difference though.

In order to help with convergence we can also set up some initial conditions, for example make the left-most node a zero. Go to Simulation -> Convergence Aids -> Initial Condition then click on the left most node in the schematic. A big zero should appear on top of the net.

zeroinv

Also the net should appear in the Select Initial Condition dialog box.

zerodia

Now we can finally simulate! Click on the Netlist and Run button (looks like a green light) on the right or go to Simulation -> Netlist and Run. Click OK on the Welcome to Spectre window which should start the simulation. In case you have errors you will need to go back and correct them. This can be tricky! You may need to do Simulation -> Netlist -> Recreate if you change the schematic. CAUTION Each time you change the schematic you have to do Check and Save!. Assuming there are no errors you can now admire the simulation results. Go to Results -> Direct Plot -> Transient Signal which will pop-up your schematic window. Now you have to click on the signals you want to see. Since this is a transient analysis we want to see a few voltages. In order to do this you have to click on the desired nets, then the ESC key. You should finally get the desired simulation results, some glorious periodic signals as expected from an ring oscillator. You can determine the period of oscillation, measure the inverter delay and compare that with the formula in the book.

ringfinal

Now we can measure tpLH, tpHL for the second and third inverters. To do this accurately we are going to use the waveform calculator. Go to Tools -> Calculator in the Analog Environment window which should pop up the calculator. Get familiarized with the calculator, you may also want to consult Openbook. The calculator works with a "stack" in which you first input a waveform or more and then you perform an operation. After each operation it's recommended that you clear the stack (clst). To view the stack you have to enable it (click on the button Display Stack). Now click on wave in the calculator window and then click on the later wave in the waveform window. A wave should be displayed in the calculator. Now press on the earlier wave which should push the first wave in the stack and bring this new wave in the calculator. IMPORTANT: Note that we entered the waves in reverse order (the late first, then the early one), this is a "feature" of the stack operation of the calculator.

calc

Now go to Special Functions in the calculator window and click on delay. Fill 0.75 as the threshold values (50% of Vdd = 1.5V) and keep the edges as 1 and edge types as either (in other situations you may want to make different choices here) then click OK.

delmeas

Notice the change in the calculator window. Now click on Evaluate buffer and you should get the value of tpLH for the second inverter. Clear Evaluate buffer and the stack and now measure tpHL for the second inverter. You need to got through the same steps except choose Edge Number 2 in the Threshold Delay dialogue box. It is a good idea to save your state before exiting the simulator in case you want to redo some of the simulations you can start by loading a saved state. Congratulations, this is the end of Tutorial 3.