time = 20.00ns irsim>set myvec 10 set myvec to 10 i.e. make a=1, b=0 irsim>s
step time = 30.00ns irsim>set myvec 01 set myvec to 01 i.e. make a=0, b=1 irsim>
s.
University of Southern California EE 477L - MOS VLSI Circuit Design
Contents 1. 2. 3. 4. 5.
The Design Flow Magic IRSIM HSPICE Taking Printouts
© Brandon L Fernandes 2002
Design Flow in EE477L
Step 1
Magic Layout
Step 2
IRSIM – Logical Verification
Step 3
HSPICE – Timing Verification
Setting your account to run Magic Append the following to your .cshrc file: source ~ee577/577a.setup
Step 1 Magic Layout To start the Magic program , the command is magic or magic filename example magic nand Some of the most useful commands of Magic are cited below: :pai :Used for painting a specified region with a layer. “layer” can include : m1: the first layer of metal m2: the second layer of metal m3: the third layer of metal m4: the fourth layer of metal m5: the fifth layer of metal via: metal1 to metal2 contact pwell: p well region nwell :n well region nwc :n well contact pwc: p well contact ndiff: n-diffusion layer poly: poly-silicon ndc: n-diffusion contact to metal1 pc: poly to metal1contact
pdiff: P-diffusion layer pdc: P-diffusion contact to metal1 example : pai m1 will paint metal 1 :lab Used to label a node. example :lab Vdd will label a node as Vdd :erase For erasing a specified layer in the window example: :erase poly will erase poly from within the box specified. u – undo last action . – redo q, w , e , r – move box left, down, up, right Q, W, E, R – stretch selection left, down, up, right (to make a selection, make a box around what you want to select and then press a) b -display the dimension of a box a - select the layout under the box c -copy selection d -delete selection grid : to set the size of grid to the value that you specify. The value should be an integer. Example : grid 1 The figure below is a fairly “optimized” 2 input Nand Gate and an “unoptimized” 2 input Nor Gate with inputs a, b and output out. Since we designed a 2 input Nand/Nor gate in our first lab, most of the description in this text is with reference to the very same two input Nand gate.
After you complete the layout, type in the following commands in the Magic terminal: :save or :save This command saves your layout, creating a nand.mag file :ext This command extracts electrical information from the layout and creates a nand.ext file. :cif This command generates a file nand.cif .CIF (Caltech Intermediate Form) is a layout description language. This file contains mask information. :q this command quits Magic
Later, it you wish to reopen the same layout, the command you type in at the terminal screen is : magic example magic nand
Step 2 - Logical VerificationIRSIM The next step is to verify if the circuit operates correctly in the logic domain. IRSIM is used for this purpose. If you have set up your account to run Magic, you should be able to run IRSIM using the following commands: ext2sim -t! example: ext2sim –t! nand.ext This command creates a file nand.sim from nand.ext, which is used by the IRSIM tool irsim example: irsim nand.sim This command starts the IRSIM tool. The irsim prompt is displayed on the terminal as irsim> At the irsim prompt type in the following commands: irsim>vector myvec a b we define a vector named myvec, which consist of inputs a and b
irsim>ana a b out myvec irsim>set myvec 00 irsim>s time = 10.00ns irsim>set myvec 11 irsim>s time = 20.00ns irsim>set myvec 10 irsim>s time = 30.00ns irsim>set myvec 01 irsim>s
analyze the signals a b out and myvec on the GUI set myvec to 00 ie make a=0, b=0 step set myvec to 11 i.e. make a=1, b=1 step set myvec to 10 i.e. make a=1, b=0 step set myvec to 01 i.e. make a=0, b=1 step
time = 40.00ns The analyzer window looks like:
Stimulus using a command file The sequence of IRSIM commands can be written in a command file, using a text editor, and all the commands can be executed in sequence by simply calling the command file name. For example , using a text editor , we could create a file stimulus.cmd which has the following data. vector myvec a b set myvec 00 s set myvec 11 s set myvec 10 s set myvec 01 s This file must be saved in the directory, from where you invoked the IRSIM tool. Now to invoke the stimulus in the file, just type the name of the command file in the irsim prompt as shown: irsim> stimulus After that, type in the name of the signals you want to analyze at the irsim prompt. irsim>ana a b out myvec analyze the signals a b out and myvec on the GUI
This will cause the analyzer GUI to open and display the waveforms. Stimulus Without using a “Vector” Defining vectors are useful when we have a large number of inputs. However when we have few inputs, then the stimulus can be given as follows: At the irsim prompt type in the following commands: irsim>ana a b out irsim>l a b irsim>s time = 10.00ns irsim>h a b irsim>s time = 20.00ns irsim>l b irsim>s time = 30.00ns irsim>h b irsim>l a irsim>s
analyze the signals a b out on the GUI low a , b i.e. make a , b low step high a, b i.e. make a=1, b=1 step set b=0, a retains its old value of 1 step set b=1, a retains its old value of 1 set a=0 , b retains its old value of 1 step
Other useful commands in IRSIM include: flush q stepsize
– Used to clear the waveform GUI window - Quit - Used to set the stepsize
Setting to run Hspice Copy the tsmc25.spice file to the directory where you are working using the command: cp ~ee577/cad/lib/spice/tsmc25.spice .
Step 3 - Running Hspice and MWaves 1 . Use the following command to create the . spice file. ext2spice
example: ext2spice nand.ext This command creates a .spice file from your .ext file. 2 Open this .spice file created, using a text editor. It will look like: * HSPICE file created from test.ext - technology: scmos .option scale=0.15u m0 out a vdd vdd pfet w=3 l=2 + ad=22 pd=20 as=38 ps=36 m1 vdd b out vdd pfet w=3 l=2 + ad=0 pd=0 as=0 ps=0 m2 a_26_21 a gnd Gnd nfet w=3 l=2 + ad=9 pd=12 as=28 ps=22 m3 out b a_26_21 Gnd nfet w=3 l=2 + ad=28 pd=22 as=0 ps=0 ** hspice subcircuit dictionary
3. Append the following lines to the .spice file and save. .option post .include tsmc25.spice VVdd Vdd Gnd 2.5V VGnd Gnd 0 0V Vin1 a Gnd pulse(0v 2.2v 0.5n 0.1ns 0.1ns 2ns 4ns) Vin2 b Gnd pwl(0ns 0v 35ns 5V 35.1ns 0V 55ns 0V 55.1ns 5v 89.9ns 5V 90ns 0V) .tran 0.1ns 99ns .end Explanation of the lines appended VVdd Vdd Gnd 2.5V
Define Vdd as =2.5
VGnd Gnd 0 0V
Define Gnd as 0V
.option post
Post results of analysis
.include tsmc25.spice
Include technology file
.tran 0.1ns 99ns .end
Do transient analysis from 0 to 99ns marks end of file
4. Run the spice program by typing in the following: hspice nand.spice
If spice runs successfully, it will display in its output on the terminal screen: ***** job concluded
If Spice Aborts, then go back to editing yo ur .spice file and correct the error. 5. If Spice concludes successfully, then Run MWaves using the command: mwaves For example, type in : mwaves nand (Note that you do not need to type in mwaves nand.st0 or nand.tr0 . Just mwaves nand would work fine) In the Results Browser box, click on Transient. Double click on curves to be displayed (a,b,out ) in the Results Browser dialog box. Now close the dialog box
Select Stack/ovelay mode from Window menu to show curves separately rather than overlapping.
Stimulus Types There are two types of stimulus that we widely use in this class 1> The pulse mode 2> The piecewise linear mode The following figure, shows the graph generated in response to the pwl (piecewise linear) input stimulus applied between b and Gnd. Vin2 b Gnd pwl(0ns 0v 35ns 5V 35.1ns 0V 55ns 0V 55.1ns 5v 89.9ns 5V 90ns 0V) This means that At 0ns we are at 0V At 35 ns we are at 5V At 35.1ns we are at 0V At 55ns we are at 0V At 55.1ns we are at 5V ……….and so on
(point A) (point B) (point C) (point D) (point E)
Now all these points are joined with straight lines to generate the following stimulus graph:
This stimulus is applied to the b input of the Nand gate.
The following figure below, shows the stimulus generated in response to the pulse input stimulus.
Vin1 a Gnd pulse(0v 2.2v 0.5n 0.1ns 0.1ns 2ns 4ns) This means that you are creating a pulse waveform, Varying from 0V to2.2V, with a delay of 0.5ns with a rise time of 0.1ns , with a fall time of 0.1ns , with a time period of 4ns and a high level time of 2ns. A more general form of the syntax is: Vin1 node Gnd pulse (level 1, level 2, delay, rise time, fall time, time” level 2” is maintained, time period)
This stimulus is applied to the a input of the Nand gate. Now you can find various delays (such as high-to- low and low-to-high propagation delays) by adding PointToPoint measures from Measure menu.
You can print the waveforms using the Print command from the Tools menu
HOW DO YOU TAKE A PRINT OUT? For the magic layout Convert the .cif to .ps using the following command: pplot -o nand.ps nand.cif Do you want a plot (Yes/No/ChangeScale) [y] ? y At this stage nand.ps file is created. To send this file to the sal printer the command is lpr -Pps_sal125 nand.ps For the HSPICE / IRSIM waveforms The waveform plots are directly created in .ps format so directly send it to the sal printer
using lpr -Pps_sal125 nand.ps