Set-Up for Cadence from Home and Getting Started

(This is the version for Spring 2023. If you access this later, the information might be outdated!)

In this course's lab tasks you’ll use a professional ASIC layout tool to conduct simulations of circuits with a high level of detail, much more detail than the simple models used in the course book. The program runs under Linux and it will be set up to simulate circuits implemented in a 65nm CMOS technology.

Important: please always close Cadence if you are not using it and before logging out! We do have only a limited number of licences and if you leave Cadence running the licence might not be returned to the licence server correctly for someone else to use.

1) Working from home or a UiO computer

To use Cadence you’ll have to log in onto a RedHat 7 Linux server at IFI via the cluster name rh7login.ifi.uio.no. That can be done from home or from a machine at UiO.

NOTE: Many of the machines that you can use are Red Hat Linux 8 (RH8) machines. login.ifi.uio.no is a collection of RH8 servers for instance, while Cadence runs only on RH7 for now.

For Windows:

In short: you should use VMvare to interface to a Linux workstation by the name 'ifi workstation'. From there you'll follow the instructions for Linux and Mac to get to the rh7login.ifi.uio.no cluster.

Check if VMware is installed on your computer: type VMware in the 'search' window. If it is not yet installed:

a) on your home machine:

in a web browser go to https://view.uio.no . There you'll get the option of either running VMware in your web browser, or (recommended) install the VMware client on your Windows machine. For the latter you find a link in the lower part of the page. If you install and start the client, there is an icon for view.uio.no that you select.

b) on UiO machines:

you may try to install VMware yourself using Software Center. Type 'Software Center' in the search window and start the app. It gives you a list of programs that may be installed on UiO Windows machines. Select VMware and follow instructions.

Then (either in the browser version or the client) you select and log in on view.uio.no with your UiO credentials. Then you get a whole selection of icons to either access different servers or to run some applications. One of the servers is the Linux server 'IFI workstation'. Select it with a double click! A full screen session on that Linux server will open. You can change that into a smaller window if you like (top toolbar pull down menu next to 'Exit Fullscreen'). On the top tool bar on the left choose 'Activities' and open a 'terminal' (the black command window icon on the vertical tool bar that drops down). Then follow the instructions for Linux machines below.

For Linux and MacOS:

For MacOS there is also a VMware client, so you may just follow the instructions for windows above. However, in both Linux and MacOS you can use a more direct method as well and run ssh from a command line window. On the Mac you also need to install a X11 server if you do not have one. This is very easy and free, just download and install from XQuartz.org and then install the latest version that supports your version of macOS.

use the command:

>ssh -Y rh7login.ifi.uio.no

If you sign on from a system where your username is not your UiO user name add an additional parameter to the command:

>ssh -Yl <UiOusername> rh7login.ifi.uio.no

Once you are logged in on rh7login.ifi.uio.no you need to make sure to run a BA-shell, so execute the command:

> bash

2 ) Cadence, “Schematics Editor”

In order to use Cadence you’ll have to make a working directory, named for example “tsmc65nm”. Follow the instructions on this web page (NOTE: only accessible if your browser runs ona IFI machine! So for example, open Firefox on the rh7login.ifi.uio.no server.):

https://nano.wiki.ifi.uio.no/Startup_TSMC65nmLPRF_OA_Cadence617

to set up and start Cadence.

Library manager

In the main window (icfb window) choose “tools->library manager” and the library manager will pop up. In the left hand side column you’ll see a list of libraries. In the editable field on top of that list, enter a new library name for your working library in which you will create your cell containing the schematic to simulate. Compose the name of your initials first followedby the technology identifier “TSMC65” and then a name of your choice,all seperated by underscores, so in case of the lecturer the library is called “PH_TSMC65_IN3170”. (This naming convention is not terribly important for this exercise, but should you start a master project with NANO and collaborate on a layout where different people share their libraries this will be convenient.) After having written the name, hit “return”. You will first be asked to confirm the name. Hit “ok”. Then there will be a pop-up asking for a “technology file”. Tick off “attach to an existing techfile” andhit “ok”. In the next pop-up select the file “cdsDefTechLib” and hit “ok”.

Schematics editor

In the second column in the library manager you’ll see “cells” defined for the library that is selected on the left. Select your new library on the left! In the case of your new library, there are no cells yet. Create one by writing a name in the editable field on top of the second column,e.g. “lab1”, and hit “return”. A pop-up will ask you for a view name, which should be “schematic” and a tool which should be “Schematic L”. If that is set correctly hit “ok”. (Cells can have different views, typically a “schematic” that describes the cell on that level, and a “layout” containing the layout that corresponds to that schematic, and also a “symbol” that you can use hierarchically in other schematics to represent this circuit with a simple symbol, but this need not concern you here and now.)

Now a blank schematic editor will pop-up, to which you can add a number of circuit “instances” that you’ll need to run your simulation. Select “Create->instance...” from the top tool-bar. A pop-up will ask you which instance of a cell and cell view to add. Usually you will only instantiate “symbol” cell views into a schematic. The cells you are going to use for the exercises are to be found in two libraries: “analogLib” and “tsmcN65”. “tsmcN65” contains the transistors, cell names “nch” and “pch”. “analogLib” contains the symbols for the global power nodes“vdd”, and “gnd”, as well as a dc voltage source (“vdc”) and an a bit more dynamic voltage signal source (“vpulse” that allows you to provide pulsesand ramps) for simulation purposes (corresponding current sources are“idc” and “ipulse”). With these elements, you can now draw the circuit you want to simulate.

If you select a component in your schematics and hit the key “Q” you’ll get a list of parameters for this instance of a cell. In this pop-up window you can for instance set W and L of transistors, set the “DC voltage” for “vdc” and define the behaviour of the output of “vpulse”. For the parameters, instead of numbers, you can also write in a variable name. These variables can then be used in the simulation tool "ADE L" to set these parameter values at simulation time, instead of in the design itself. Some simulation options will also allow you to sweep those variables instead of just giving them a constant value.

Note that “vdd” is but a global electrical node and not a power supply by itself: you will always have to place a “vdc” between an instance of “vdd” and “gnd” and set its “DC voltage” to 1.2V (for this65nm technology) for the simulation to run correctly. Only then will all nodes connected to the Vdd symbol be powered by that "vdc"

You can draw connections by selecting “Create -> Narrow Wire” from the top tool bar. You can name wires/electrical nodes by selecting “Create -> Wire Name” from the tool bar. Naming wires is quite useful to identify electrical nodes easily in the simulation output.

3 ) Cadence, “Analog Design Environment” (ADE) simulation tool

ADE explorer simulation tool

To run a simulation choose “launch->ADE explorer” from the drop-down menu bar of the schematics editor. A new  sub-window to set simulation parameters and run simulations will appear in the schematics editor. You can swap back and forth between the simulation parameter editor and schematics editor by choosing the appropriate banner at the top of the editing window. Later you may also reopen the simulation window by chosing the cell view "maestro" in the library manager. Then it will open in a completely separate window.

In the drop-down menu bar at the top select “outputs->to be plotted->Select on schematic”, and select the nodes that you want to see the voltages or currents of. By clicking on a cable you’ll select a voltage to be displayed, by clicking on a pin of a component you’ll select the current coming out of that node. Click “Analyses” -> "Click to add analysis" in the left hand menu, and then select “tran” in the pop-up (or later also "dc" or "ac", see below). Set the stop time to an appropriate value: this will depend on how you setup your signal sources for the simulation (e.g. “vpulse”). Always select “Design->Check and Save (X)” in the schematics editor before finally running a simulation. If you have edited your schematics and have not saved it, the simulation may fail to run without a very understandable error message. To run the simulation select “run” in the right hand tool bar (the green play button). Some text window then shows the progress of the simulation and when finished, the selected outputs will be plotted in a graph.

Types of simulation

As you click “Click to add analysis” in the left hand menue of the ADE explorer tool, you get several choices for simulations to set up:

a) dc

Makes a DC analysis where you typically sweep one variable, such as a gate voltage of a transistor or the circuit temperature, and produce a plot of all outputs. For circuit parameters you can use variables that you have defined for one of your components, e.g. a voltage of a "vdc" or also a "vpulse" or "vsine" source: here only the parameter "DC voltage/current" is used (write a string instead of a value there to define a variable), and the respective waveform you have defined is ignored (it is only used for "trans" simulations). Then you define a range for the parameter you want to sweep.

b) ac

Here the simulation will do a small-signal analysis and produce a frequency plot, analyseing the filter properties of your circuit. You define a frequency range, and the simulation uses the parameters "ac magnitude" for the components that provide input to your circuit and "DC voltage/current" for all sources to set the point of operation. Again, the specific waveforms from sources such as "ipulse" or "vsine" are ignored. The value of "ac magnitude" is typically 1 if you have but a single source of input. The magnitude plot is then the result of a small signal analysis and the vlues given relative to that input value. If you have multiple inputs with relative input amplitudes you can use values other than one.

Bode plots including the phase plot can be obtained by clicking on "Results->Direct Plot->Main Form ..." in the ADE L tool. Then you can select what you want to plot, e.g. "ac" and "dB20" or "phase" and click on the node you want plotted in the schematic.

c) trans

Here now the waveforms of your input sources do matter. You can simulate things like a step response or a digital counter.

4) MATLAB:

We will be using MATLAB (also available for UiO students for installation at home from https://www.winprog.uio.no/ for Windows and https://www.macprog.uio.no for Mac) for some excersises and it’s the best tool for plotting all of your results as nice graphs.Thus, you should bring a working knowledge of MATLAB to this course. If you have none, get a crash course from a fellow student who has used it! Itis a powerful mathematics tool with a command line interface. One usefulfunction is ‘help’. ‘help <commandname>’ will display an explanationon how to use ‘<commandname>’. Another help function that helps you find functions that you do not know the exact name of is ‘lookfor’. Type‘help lookfor’ to learn more.

There are several ways to export data from the simulation results from Cadence to MATLAB. One is to copy the following command into the main Cadence (icfb) window:

ocnPrint(v("/out" ?result 'tran) ?numberNotation 'none ?output "out.m" )

This will create a file “out.m” in your cadence working directory containing the voltage of node “out” of your simulation as a two column matrix where the first column is the time and the second is the voltage. To actually load this into MATLAB you’ll have to import it using a little parser function i wrote called readCadenceOcnPrint.m that you can download here clicking on it. It needs to be in the directory where you run Matlab and in Matlab you can write the command:

m = readCadenceOcnPrint( "out.m" )

and the the matrix m will contain the result where the first column is the time and the second the voltage/current value.

5) Collaboration through Cadence-Library sharing

If you work together remotely or at different times, it is possible that one of you shares his Cadence library such that the others in a work group can edit schematics and simulation setups and conduct simulations. Just coordinate this well to avoid simultaneous editing which can lead to overwriting of changes one of you makes.

There will be 3 steps to allow multiple users to edit the same Cadence library:

1) Include your work group members in your personal file-system user group

2) Grant read/write access to all user group members to the library. You'll have to repeat this whenever someone has edited a schematic (or other cellview).

3) The other group members have to reference the library in their Cadence library manager to make it visible in Cadence. IMPORTANT: everybody will still have their own local Cadence working directory where they start Cadence!

We shall use file groups to allow access to files belonging to one person by others: in Linux, each file has an owner and a group-ID. By default, files you create in your home directory will have yourself as owner and will belong to your personal group. The latter has the exact same name as your user name, but do not confuse this: it is a group ID not a user ID. So if you have a Cadence work directory in your home directory by the name of 'cadence617_tsmc65rf_oa' and your user ID is 'philipph', the total path to it from other Linux-machines that anyone can access that has permission will be '/hom/philipph/cadence617_tsmc65rf_oa' . Type:

> ls -dla /hom/philipph/cadence617_tsmc65rf_oa'

and you get something like:

dr-xr-xr-x. 8 philipph philipph 2048 Jul 22  2011 cadence617_tsmc65rf_oa

The string 'dr-x--x---' shows the permissions granted to owner, group, and others of this directory, where the first 'r-x' are the permissions of the owner, the next '--x' are the permissions for users belonging to the group 'philipph', the last '---' are the permissions for everybody. The first philipph is the owner of the file and the second philipph is the group of the file.

1) So first you'll have to include your work group members into your personal user group.

IMPORTANT: this may give the group members access to other files in your home directory, Make sure this is OK for you, before you do this. If you want to protect some directories in your home directory from acces of the user group members, you can explicitly exclude access for group members of a directory  (<dirname>)  and others with the command:

> chmod go-rwxs <dirname>

Let's assume you want to add a group member with the user name 'olanor'. You (philipph) have to open a web-browser and open:

https://brukerinfo.uio.no

Log in! Then choose the 'groups' banner at the top, choose your personal group 'philipph', add user 'olanor'. If olanor is logged in on a Linux machine at the time, he needs to log out and log in again before his new group membership becomes active. In a Linux terminal he can type 'groups' to get a list of groups he is member of. 'philipph' should be one of them now.

2) cd to your working directory and change the permissions for the group to read/write/execute/inherit content in this directory recursively (for all subdirectories and files), i.e.:

> cd /hom/philipph/cadence617_tsmc65rf_oa

> chmod -R g+rwxs .

NOTE: this chmod command has to be execute again and again, each time you edit and save something in Cadence. This is because when you save a file in Cadence, it often is deleted and recreated, and thus looses the old permissions you have specified again.

3) Now olanor has to add the library of philipph in his Cadence session to make it visible. Let's say philipph has a library 'PH_TSMC65_IN3170_lab3' he'd like to share. So olanor has to choose in the Cadence library manager tool: edit->library path ... Then add a entry:

PH_TSMC65_IN3170_lab3

/hom/philipph/cadence617_tsmc65rf_oa/PH_TSMC65_IN3170_lab3

  And save the library path definitions. Now the library manager tool should show the library PH_TSMC65_IN3170_lab3 and all its content should be accessible.

If someone else edits something you look at a) this person has to run the chmod command again and b) you will sometimes nned to choose the banner 'view->refresh...' in the library manager to update what you are seeing.

 

By Philipp H?fliger
Published Feb. 6, 2023 3:24 PM - Last modified Apr. 14, 2023 3:10 PM