UNIVERSITY OF CALIFORNIA

College of Engineering

Department of Electrical Engineering and Computer Sciences

Last modified on September 14, 2003 by Liang Teck Pang ()

Borivoje Nikolic Lab #5: Switch Level Simulation EECS 141

1. Objective

This week you will be working extensively with IRSIM, the switch level simulator. You will find this lab particularly important for your project, because it demonstrates one of the fastest ways to verify that your logic designs work.

2.  Background: Using IRSIM

The IRSIM switch level simulator gives you access to a powerful tool for rapidly verifying that your circuit designs are functionally correct.

In Lab 4, you learnt how to extract circuit netlists from Cadence. You learnt to extract a HSPICE netlist and convert it to a SIM format that can be used with IRSIM. We will now reuse the inverter.sim netlist obtained from Lab4 and run a functional simulation in IRSIM.

Information on IRSIM can be found in http://bwrc.eecs.berkeley.edu/Classes/icbook/IRSIM/irsim.pdf

Also, you can type man irsim at the UNIX prompt to get the manual pages of irsim. Finally, in IRSIM, you can type help or help <command> to get information on the IRSIM commands.

a.  Type the following command to convert hspice netlist to the sim format.

/usr/xpg4/bin/awk –f hspice2sim -v "l=0.12" "n=TSMC25DN" "p=TSMC25DP" inverter.hsp >! inverter.sim

b.  Run IRSIM with the following command

/share/b/bin/irsim /share/b/cad/src/irsim/test-input/scmos60.prm inverter.sim

This calls up IRSIM and load in the parameter file and the netlist. The parameter file used here is for an older technology and thus timing information will not be accurate.

  1. Run the waveform analyzer and put all the nets in the analyzer using the following commands

irsim> ana in out vdd gnd

The values of vdd and gnd are automatically given as 1 and 0 respectively. Advance by a time step and check that all the signals have the right values.

irsim> s

Set the value of in to 1, advance by a time step, then set it to zero. Observe the waveform for out.

irsim> h in

irsim> s

irsim> l in

irsim> s

  1. If you want to save your results from IRSIM, click on “print/file”. It will then prompt you to enter a name for the postscript file it will save to. To print, copy the file from your UNIX directory to the local machine using SSH Secure File Transfer, open in GSview, and print.

3.  Tasks

a.  Complete the truth tables for the following schematics. For your convenience the blank truth tables are provided on the following page. Go from left to right, top to bottom.

Circuit 1 (Top Left)
GEN / CIN / PROP / COUTINV
0 / 0 / 0
0 / 0 / 1
0 / 1 / 0
0 / 1 / 1
1 / 0 / 0
1 / 0 / 1
1 / 1 / 0
1 / 1 / 1
Circuit 2 (Top Right)
GENINV / CININV / PROPINV / COUT
0 / 0 / 0
0 / 0 / 1
0 / 1 / 0
0 / 1 / 1
1 / 0 / 0
1 / 0 / 1
1 / 1 / 0
1 / 1 / 1
Circuit 3 (Center Left)
CIN
/ PROP / PROPINV / CININV / SUM
0 / 0 / 0 / 0
0 / 0 / 0 / 1
0 / 0 / 1 / 0
0 / 0 / 1 / 1
0 / 1 / 0 / 0
0 / 1 / 0 / 1
0 / 1 / 1 / 0
0 / 1 / 1 / 1
1 / 0 / 0 / 0
1 / 0 / 0 / 1
1 / 0 / 1 / 0
1 / 0 / 1 / 1
1 / 1 / 0 / 0
1 / 1 / 0 / 1
1 / 1 / 1 / 0
1 / 1 / 1 / 1
Circuit 4 (Center Right)
A / B / GENINV / GEN
0 / 0
0 / 1
1 / 0
1 / 1
Circuit 6 (Bottom Center)
A
/ AINV
0
1
Circuit 7 (Bottom Right)
B
/ BINV
0
1
Circuit 5 (Bottom Left)
A
/ AINV / B / BINV / PROP
0 / 0 / 0 / 0
0 / 0 / 0 / 1
0 / 0 / 1 / 0
0 / 0 / 1 / 1
0 / 1 / 0 / 0
0 / 1 / 0 / 1
0 / 1 / 1 / 0
0 / 1 / 1 / 1
1 / 0 / 0 / 0
1 / 0 / 0 / 1
1 / 0 / 1 / 0
1 / 0 / 1 / 1
1 / 1 / 0 / 0
1 / 1 / 0 / 1
1 / 1 / 1 / 0
1 / 1 / 1 / 1

c. Why do you think this adder generates both an output signal and its complements? What are some of the advantages and disadvantages of this technique?

d. Open up Cadence and draw out the schematics. The result should be ONE circuit with inputs A, B, CIN, CININV and outputs SUM, COUT, COUTINV.

e. Create a sim netlist. (NOTE: Use the “hierarchical” netlist option in Cadence to preserve the device and node names). Launch IRSIM and using this derive a truth table for the adder. (Generate all the possible input combinations and read the outputs). DO NOT assume that CININV is the complement of CIN. Why do the outputs become undefined (filled with cross hatches) during part of the transitions? Observe the outputs and intermediate signals; are they what you expected? What happened when CIN and CININV had the same value? Would this ever happen in a real life application of this circuit?

f. Your lab ends here. For your project, you would continue the design flow by generating a layout for the circuit in the same manner done in the max tutorial, connecting all the fly-lines, and performing a cross probe between the layout and schematics to verify the validity of the layout.

4. What To Turn In

a. The completed truth tables from above.

b. The answers to the questions presented above.

c. Printouts verifying that your IRSIM simulations are (in)valid. Use as little paper as possible, but make sure the plots are readable.