Cadence Tutorial General notes: Upper and lower case characters make a difference in UNIX-based systems – be careful. You will run into fewer problems if you eliminate spaces in filenames. Use the underscore character instead of a space. Getting Started: Before you start Cadence for the first time you will need to do the following – 1) Copy the essential files needed into your working directory: cp cp cp cp cp /software/Cadence/ece4540/cdsinit ./.cdsinit /software/Cadence/ece4540/cdsplotinit ./.cdsplotinit /software/Cadence/ece4540/bk.il ./bk.il /software/Cadence/ece4540/NCSU_setup.csh . /software/Cadence/ece4540/cds.lib . Keep in mind that above commands are all case-sensitive. Notice ‘C’ in ‘Cadence’. 2) Create a link in your present working directory: ln -s /software/Cadence/NCSU1.2/local/lib NCSU 3) Enter the following command – tail .cdsinit This will display the last 10 lines of the file “.cdsinit”. Check the last line and it should show: loadi "bk.il" Otherwise you will have to open the .cdsinit file in an editor say “vi”: vi .cdsinit at the end of the file insert the line: loadi "bk.il" You will only have to do these things one time. There is a tutorial for other design kits available at: http://www.ee.vt.edu/~ha/cadtools/cadence/unix_env.html To begin using Cadence: To start the Cadence application do the following – 1) Type in the following command at the prompt and hit ‘enter’ key – tcsh It changes the current shell environment to the one needed to run Cadence. 2) At the prompt, you will have to declare the source of the libraries using the following command - source NCSU_setup.csh Note: if you do not do this you will encounter problems later in Cadence 3) Now type in the command below at the prompt and Cadence will show up in the screen icfb & The “&” is used to put the Cadence application running in the background of the current command prompt so that you can still use the terminal. Once in Cadence: On your first execution of Cadence you will have to create a new library. This is the library that the files you create will be stored in. It might be a good idea to make a new library for each project/homework, to prevent confusing which NAND gate, etc. is which (as you will continually use different layouts for different assignments) 1) In the main window that appears, go to File->New->Library. Name the library whatever you want. Make the path the working directory you have decided on. Make sure you choose the ‘Attach to existing tech library’ radio button! Select AMI 1.6u ABN (2P, NPN) from the tech library dropdown menu. http://www.seas.upenn.edu/~eecad/cadence/libraries.html is a good tutorial on-line for libraries 2) Next you will need to create a new design file. Click on the name of the library you just created. Then File->New->Cell View Name the cell, if you are making an inverter, name it inv or inverter (something that makes sense), Make the view name layout for layouts (schematic for schematics). Make sure you select Virtuoso as your tool from the ‘Tool’ dropdown menu for layouts. Click ‘OK’. Virtuoso and LSW windows should both appear at this point (assuming you selected Virtuoso as the tool and that you are creating a layout). From here on follow the tutorial on how to create an inverter layout at: http://www.seas.upenn.edu/~eecad/cadence/layout.html. Practice Inverter with all layers including Well, Active, P-select, N-select, Poly, Contact Cut, Poly Cut, Metal1, Via, Metal 2, making instances of cells. Design Rule Checking: http://www.seas.upenn.edu/~eecad/cadence/drc.html Checking correct functionality of a circuit using Hspice (Inverter example) Once the layout is drawn completely for an inverter and DRC check shows no error, then do the following – 1) Go to Verify and click on Exract. Extractor window will appear. Click on “Set Switches” button. The “Set Switches” window will pop up. Select “Extract_parasitic_caps” from the list and press OK. “Extract_parasitic_caps” will be selected in the “Switch Names” field and hit OK. It will create the extracted version of the layout and in the “Library Manager” there will be a new entry under View called extracted. 2) Double click on the extracted view and another layout window will open up and you can view the extracted lay out. 3) Now the functional correctness of the circuit will be checked. Go to Tools->Analog Environment. A new window will pop up. Click on Setup->Simulator/Directory/Host. Check if the simulator is selected as “hspiceS”. Next click on Setup->Environment Here do the following – a) Insert “extracted” before “hspiceS” on the Switch View List. b) Insert “ivpcell” before “hspiceS” on the Stop View List. c) Select the Include/Stimulus File Syntax to be hspice. Now click on Simulation -> Netlist -> Create Final. This will create the netlist file without the stimulus. A window will pop up to display the netlist file if there is no error in netlist generation. You can check the message in the icfb window. It should show “successful” if there is no error. 4) Now we have to go to the directory in which the netlist is generated. The path is – <home>/cadence/simulation/<cellname>/hspiceS/extracted/netlist/ The netlist filename is hspiceFinal Open the file in an editor and add the following lines before the tag *END OF NETLIST for simulation – .tran 50p 20n .print tran v(inp) v(output) cload output 0 1f vdd vdd! 0 5 vin inp 0 pulse 0 5 .5n .5n .5n 1.5n 4n This is the stimulus to the inverter circuit. This will change depending on the circuit you will create as a layout. There will be a line with content .OPTION INGOLD=2 ARTIST=2 PSF=2 near the end of the file. Replace that line with .OPTION POST. This is very important because it will create the .tr0 file for waveform generation. 5) Now at the command prompt type HSpice and hit ‘enter’. The prompt will change. Type the following command hspice hspiceFinal > hspiceFinal.lis and press ‘enter’. Hspice simulation will run and the log is stored in hspiceFinal.lis. If there is any error then it will be there in the log file. If it is successful then there will be 3 files generated hspiceFinal.ic0 hspiceFinal.st0 hspiceFinal.tr0 6) Now type CScope and press ‘enter’. This will open the Cosmoscope which is used to view the graph generated by Hspice simulation. Do the following File->Open->Plotfiles A small window will pop up. Click on Files of Type. Select Hspice(*.tr*,*.ac*,*.sw*,*.ft*) It will show the file hspiceFinal.tr0 Double-click on that and select appropriate signals to be displayed.