Prepared by:
MR. SUSHANTH K.J
ASST. PROF, BIT, MANGALORE
Page 1
BEARYS
INSTITUTE
OF TECHNOLOGY
P.A.
COLLEGE
OF ENGINEERING
(Affiliated to
VTU, Recognized
AICTE, NBA Accredited)
Innoli,
BoliyarbyVillage
Near Mangalore University, Mangalore 574 153, Karnataka
Mangalore - 574153
LABORATORY CERTIFICATE
Register No:
Page 2
Part A
Sl.no.
1
2
3
Programs
4(a)
4(b)
4(c)
4(d)
4(e)
4(f)
5(a)
5(b)
5(c)
5(d)
5(e)
7(a)
Remarks
PageNo.
Remarks
7(b)
Page
No.
Part B
Sl.No.
1.
Programs
Design of an inverter using analog design flow
Page 3
2.
3.
4.
5.
Page 4
PART-A
DIGITAL DESIGN BASIC-DIGITAL
DESIGN FLOW
Page 5
Page 6
Page 7
Procedure:
1)Simulation
pwd- To check the present working directory.
ls- to list the contents of the directory
cd cadence_DB - to change the directory
csh- invoke C shell script
source cshrc to link cadence with c shell
Welcome to cadence_tools
mkdir (dirname)- to make a directory
cd dirname
vi (filename.v) to invoke the vi editor
Press I to go into INSERT mode
Type the program
Esc :wq to save and exit
nclaunch
launch verilog compiler with current selection
elaborate ( top level module)
launch simulator with current selection
send to waveform
run simulation
2) Synthesis
Copy the library to the current directory
rc
set_attribute library dirname/library/slow or fast.lib
read_hdl dirname/filename.v
Page 8
elaborate
gui_show
synthesize to_mapped effort medium
report timing
report gates
report gates power
report area
report summary
write_hdl > net_name.v
Page 9
Sample Program
(INVERTER)
Boot the system to Red Hat Linux
Right click on the Desktop
Click on open terminal tab
To check whether the system is connected to server, the command used is
[root@llocal host ~]ping 192.168.80.1 { press Enter }
Press ctrl+c to stop pinging
To mount into the system:
mount t nfs 192.168.80.1:/home/cadence /mnt/cadence {press Enter}
To initialize your client , the command is:
/etc/init.d/nfs restart {press Enter}
[root@local host ~]# will be displayed on the screen
Type [root@local host ~] csh to go to C shell
Then the # will be replaced with a $ symbol
[root@local host ~]$
Type [root@local host ~] $ source cshrc
If the above steps are done correctly a message will be displayed saying:
Welcome to Cadence tool suite
Page 10
Page 11
The writing of the program can be done after activating the insert mode by pressing I in the
program window
Module Program
module inv(a,y);
input a;
output y;
assign y=~a;
endmodule
To save and quit the module program press ESC and type :wq
To quit without saving press ESC and type :q!
Test bench file is used for simulation
To create a test bench file type
Page 12
Page 13
Testbench Program
module inv_test;
reg a;
wire y;
inv abc(a,y);
initial
begin
$monitor($time,"y=%d",y);
a=1'b0;
#10 a=1'b1;
#10 a=1'b0;
#10 $finish;
end
endmodule
To save and quit the module program press ESC and type :wq
To quit without saving press ESC and type :q!
Compilation of the module and the testbench program can be
done using the commands
ncvlog invertr.v mess {Press Enter}
ncvlog invertr_test.v mess {Press Enter}
To elaborate the program to the libraries
ncelab inv_test mess {Press Enter}
Simulation can be done by
ncsim inv_test {Press Enter}
To launch the simulation window the command is
nclaunch {Press Enter}
Page 14
Page 15
Page 16
Page 17
When the copying is done correctly check whether the file is present in the rtl directory by
following the below given steps
List the files within the directory and check whether the files have been copied properly, if not
repeat the copying procedure again
ls
Return back to the rclabs directory using the below given command
cd ..
Create a log file for the inverter file using the command:
rc gui logfile invertr.log
When the inverter log file is executed a new screen will open displaying rc:\> on the screen
Page 18
The below given command is used to generate the template script from the compiler by
entering:
rc:\>write_template outfile template.tcl
rc:\>include setup.g
For Synthesis
Synthesis succeeded
Page 19
Page 20
Module Program
timescale 1ns/ 1ns
module buff(a,y);
input a;
output y;
reg y,c;
always@ (a)
begin
c=~a;
y=~c;
end
endmodule
Testbench program
timescale 1ns/ 1ns
module buf_test;
reg a;
wire y;
buff al(a,y);
initial
begin
$monitor($time,y=%d,y);
a=1b0;
#10 a=1b1;
#10 a=1b0;
#10 $finish;
end
endmodule
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26
Page 27
Page 28
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
module jkff1_test;
reg clk;
reg [1:0]jk;
wire q,qb;
jkff1 abc(jk,clk,q,qb);
initial
clk=1'b0;
always
#10 clk=~clk;
initial
begin
$monitor($time,"q=%d","qb=%d",q,qb);
jk=2'b00;
#30 jk=2'b01;
#30 jk=2'b10;
#30 jk=2'b11;
#30 $finish;
end
endmodule
Bearys Institute of Technology, Dept. of ECE, Mangaluru
Page 41
Page 42
Page 43
Page 44
initial
#2000 $finish;
endmodule
Page 45
Page 46
Page 47
Page 48
module and1(a,b,c);
input a,b;
output c;
assign c=a&b;
endmodule
module tff(t,clk,q);
input t,clk;
output q;
reg q;
initial
q=1b0;
reg tq;
always@(posedge clk)
begin
if(t==0)
q=q;
else
q=~q;
end
endmodule
module and3(p,q,r,s,t);
input p,q,r,s;
output t;
assign t=p&q&r&s;
endmodule
module and2(d,e,f,g);
input d,e,f;
output g;
assign g=d&e&f;
endmodule
Testbench Program
module syncount_test;
reg cnt,e;
wire [3:0]q;
syncount zzz(cnt,e,q);
initial
begin
cnt=0;
e=1;
end
always #100 cnt=~cnt;
endmodule
Bearys Institute of Technology, Dept. of ECE, Mangaluru
Page 49
Page 50
Page 51
Page 52
Page 53
PART-B
ANALOG DESIGN FLOW
Page 54
3. If the Whats New ... window appears, close it with the File Close command.
Page 55
Lab 1: AN INVERTER
Schematic Capture
Execute Tools Library Manager in the CIW or Virtuoso window to open Library Manager.
Creating a New library
1. In the Library Manager, execute File - New Library. The new library form appears.
2. In the New Library form, type myDesignLib (arbitrary name) in the Name section.
Page 56
4. In the field of Directory section, verify that the path to the library is set
to ~/cadence_DB/cadence_ms_lab_614 and click OK.
5. In the next Technology File for New library form, select option Attach to an existing
techfile and click OK.
6. In the Attach Design Library to Technology File form, select gpdk180 from the cyclic
field and click OK.
Page 57
7. After creating a new library you can verify it from the library manager.
8. If you right click on the myDesignLib and select properties, you will find that gpdk180
library is attached as techlib to myDesignLib.
Do not edit the Library path file and the one above might be different from the path shown in
your form.
3. Click OK when done the above settings. A blank schematic window for the Inverter design
appears.
Adding Components to schematic
Bearys Institute of Technology, Dept. of ECE, Mangaluru
Page 58
If
place
Library name
Cell Name
Properties/Comments
gpdk180
pmos
gpdk180
nmos
you
a
You can rotate components at the time you place them, or use the
Edit Rotate command after they are placed.
Page 59
Direction
vin
Input
vout
Output
Make sure that the direction field is set to input/output/inputOutput when placing
theinput/output/inout pins respectively and the Usage field is set to schematic.
3. Select Cancel from the Add pin form after placing the pins.
In the schematic window, execute Window Fit or press the f bindkey.
Page 60
3. Follow the prompts at the bottom of the design window and click left on the destination point
for your wire. A wire is routed between the source and destination points.
4. Complete the wiring as shown in figure and when done wiring press ESC key in the schematic
window to cancel wiring.
Saving the Design
1. Click the Check and Save icon in the schematic editor window.
Page 61
Editing a Symbol
In this section we will modify the inverter symbol to look like a Inverter gate symbol.
1. Move the cursor over the automatically generated symbol, until the green rectangle
Page 62
Page 63
3. Click OK when done. A blank schematic window for the Inverter_Test design appears.
Building the Inverter_Test Circuit
1. Using the component list and Properties/Comments in this table,
build the Inverter_Test schematic.
Library name
Cellview name
Properties/Comments
myDesignLib
Inverter
Symbol
analogLib
vpulse
analogLib
vdc, gnd
vdc=1.8
Note: Remember to set the values for VDD and VSS. Otherwise, your circuit will have no
power.
2. Add the above components using Create Instance or by pressing I.
3. Click the Wire (narrow) icon and wire your schematic.
Tip: You can also press the w key, or execute
Create Wire (narrow).
4. Click Create Wire Name or press L to name the input (Vin) and output (Vout) wires as
in the below schematic.
Page 64
6. Leave your Inverter_Test schematic window open for the next section.
Analog Simulation with Spectre
Objective: To set up and run simulations on the Inverter_Test design
Page 65
This section demonstrates how to view and select the different types of analyses to
complete the circuit when running the simulation.
Page 66
2u
Click Change and notice the update in the Table of Design Variables.
3. Click OK or Cancel in the Editing Design Variables window.
Selecting Outputs for Plotting
Bearys Institute of Technology, Dept. of ECE, Mangaluru
Page 67
1. Execute Simulation Netlist and Run in the simulation window to start the
Simulation or the icon, this will create the netlist as well as run the simulation.
2. When simulation finishes, the Transient, DC plots automatically will be popped up along with
log file.
Page 68
Page 69
4. To Move a component, Select the component and execute Edit -Move command.
Making interconnection
the
2. Move the mouse pointer over the device and click LMB to get the connectivity information,
which shows the guide lines (or flight lines) for the inter connections of the components.
3. From the layout window execute Create Shape Path/ Create wire or Create Shape
Rectangle (for vdd and gnd bar) and select the appropriate Layers from the LSW window and
Vias for making the inter connections
Creating Contacts/Vias
You will use the contacts or vias to make connections between two different layers.
Page 70
Contact Type
Metal1-Poly
Metal1-Psub
Metal1-Nwell
Page 71
1. Open the Inverter layout form the CIW or library manger if you have closed that.
Press shift f in the layout window to display all the levels.
2. Select Assura - Run DRC from layout window.
The DRC form appears. The Library and Cellname are taken from the current
design window, but rule file may be missing. Select the Technology as gpdk180. This
automatically loads the rule file.
Your DRC form should appear like this
Page 72
6. If there any DRC error exists in the design View Layer Window (VLW) and Error
Layer Window (ELW) appears. Also the errors highlight in the design itself.
7. Click View Summary in the ELW to find the details of errors.
8. You can refer to rule file also for more information, correct all the DRC errors and
Re run the DRC.
9. If there are no errors in the layout then a dialog box appears with No DRC errors
found written in it, click on close to terminate the DRC run.
ASSURA LVS
Running LVS
1. Select Assura Run LVS from the layout window.
The Assura Run LVS form appears. It will automatically load both the schematic and layout
view of the cell.
2. Change the following in the form and click OK.
Page 73
4. If the schematic and layout matches completely, you will get the form displaying Schematic
and Layout Match.
5. If the schematic and layout do not matches, a form informs that the LVS completed
successfully and asks if you want to see the results of this run.
6. Click Yes in the form.
LVS debug form appears, and you are directed into LVS debug environment.
7. In the LVS debug form you can find the details of mismatches and you need to
correct all those mismatches and Re run the LVS till you will be able to match the
schematic with layout.
Assura RCX
Running RCX
1. From the layout window execute Assura Run RCX.
2. Change the following in the Assura parasitic extraction form. Select output type under Setup
tab of the form.
Page 74
3. In the Extraction tab of the form, choose Extraction type, Cap Coupling Mode and specify the
Reference node for extraction.
4. In the Filtering tab of the form, Enter Power Nets as vdd!, vss! and Enter Ground Nets as
gnd
Page 75
4. Click Use template at the bottom of the New Configuration form and select
Spectre in the cyclic field and click OK.
The Global Bindings lists are loaded from the template.
Page 76
5. Change the Top Cell View to schematic and remove the default entry from the
Library List field.
6. Click OK in the New Configuration form.
The hierarchy editor displays the hierarchy for this design using table format.
7. Click the Tree View tab. The design hierarchy changes to tree format. The form should look
like this:
Page 77
2. In the form, turn on the both cyclic buttons to Yes and click OK.
The Inverter_Test schematic and Inverter_Test config window appears. Notice the
window banner of schematic also states Config: myDesignLib Inverter_Test config.
3. Execute Launch ADE L from the schematic window.
4. Now you need to follow the same procedure for running the simulation. Executing Session
Load state, the Analog Design Environment window loads the previous state
Page 78
2. From the functions select delay, this will open the delay data panel.
3. Place the cursor in the text box for Signal1, select the wave button and select
the input waveform from the waveform window.
4. Repeat the same for Signal2, and select the output waveform.
5. Set the Threshold value 1 and Threshold value 2 to 0.9, this directs the
calculator to calculate delay at 50% i.e. at 0.9 volts.
6. Execute OK and observe the expression created in the calculator buffer.
7. Click on Evaluate the buffer icon
returned after execution.
Page 79
A pull down menu appears. Select av_extracted view from the Set Instance view menu, the
View to use column now shows av_extracted view.
6. From the Analog Design Environment window click Netlist and Run to
start the simulation again.
7. When simulation completes, note the Circuit inventory conditions, this time the list shows
all nets, designed devices, sources and parasitic devices as well.
8. Calculate the delay again and match with the previous one. Now you can conclude how much
delay is introduced by these parasites, now our main aim should to minimize the delay due to
these parasites so number of iteration takes place for making an optimize layout.
Generating Stream Data
Streaming Out the Design
1. Select File Export Stream from the CIW menu and Virtuoso Xstream out form appears
change the following in the form.
Page 80
4. In the Virtuoso XStream Out form, click Translate button to start the stream translator.
5. The stream file Inverter.gds is stored in the specified location.
Streaming In the Design
1. Select File Import Stream from the CIW menu and change the following
in the form.
Page 81
You need to specify the gpdk180_oa22.tf file. This is the entire technology file that
has been dumped from the design library.
4. In the Virtuoso XStream Out form, click Translate button to start the stream translator.
5. From the Library Manager open the Inverter cellview from the GDS_LIB
library and notice the design.
6. Close all the windows except CIW window, which is needed for the next lab.
Page 82
Page 83
Simulation
Page 84
Now, open the ADE L, from LAUNCH ADE L , choose the analysis set the ac response and
run the simulation, from Simulation Run. Next go to ResultsDirect plot select AC dB20
and output from the schematic and press escape.
Page 85
Test Circuit
Page 86
Layout Capture
Page 87
Library name
Cellview name
Properties/Comments
myDesignLib
cd_amplifier
Symbol
Define pulse specification as
analogLib
vsin
AC Magnitude= 1; DC Voltage= 0;
Offset Voltage= 0; Amplitude= 5m;
Frequency= 1K
analogLib
vdd,vss,gnd
Page 88
Test Circuit
Page 89
Library name
Cellview name
Properties/Comments
myDesignLib
op-amp
Symbol
Define pulse specification as
analogLib
vsin
AC Magnitude= 1; DC Voltage= 0;
Offset Voltage= 0; Amplitude= 5m;
Frequency= 1K
analogLib
vdc, gnd
analogLib
Idc
Dc current = 30u
Page 90
Note: Remember to set the values for vdd and vss. Otherwise your circuit will have no power.
Test Circuit
Page 91
Layout Capture
Page 92
Page 93
What are set up time & hold time constraints? What do they signify?
Setup time: Time before the active clock edge of the flip-flop, the input should be stable. If the
signal changes state during this interval, the output of that flip-flop cannot be predictable (called
metastable).
Hold Time: The after the active clock edge of the flip-flop, the input should be stable. If the
signal changes during this interval, the output of that flip-flop cannot be predictable (called
metastable).
Explain Clock Skew?
clock skew is the time difference between the arrival of active clock edge to different flip-flops
of the same chip.
Why is not NAND gate preferred over NOR gate for fabrication?
NAND is a better gate for design than NOR because at the transistor level the mobility of
electrons is normally three times that of holes compared to NOR and thus the NAND is a faster
gate. Additionally, the gate-leakage in NAND structures is much lower.
What is Body Effect?
In general multiple MOS devices are made on a common substrate. As a result, the substrate
voltage of all devices is normally equal. However while connecting the devices serially this may
result in an increase in source-to-substrate voltage as we proceed vertically along the series chain
(Vsb1=0, Vsb2 0).Which results Vth2>Vth1.
Why is the substrate in NMOS connected to Ground and in PMOS to VDD?
we try to reverse bias not the channel and the substrate but we try to maintain the drain, source
junctions reverse biased with respect to the substrate so that we dont loose our current into the
substrate.
What is the fundamental difference between a MOSFET and BJT ?
In MOSFET, current flow is either due to electrons (n-channel MOS) or due to holes(p-channel
MOS) - In BJT, we see current due to both the carriers..Electrons and holes. BJT is a current
controlled device and MOSFET is a voltage controlled device
In CMOS technology, in digital design, why do we design the size of pmos to be higher than
the nmos. What determines the size of pmos wrt nmos. Though this is a simple question try
to list all the reasons possible?
In PMOS the carriers are holes whose mobility is less[ aprrox half ] than the electrons, the
carriers in NMOS. That means PMOS is slower than an NMOS. In CMOS technology, nmos
Bearys Institute of Technology, Dept. of ECE, Mangaluru
Page 94
helps in pulling down the output to ground PMOS helps in pulling up the output to Vdd. If the
sizes of PMOS and NMOS are the same, then PMOS takes long time to charge up the output
node. If we have a larger PMOS than there will be more carriers to charge the node quickly and
overcome the slow nature of PMOS . Basically we do all this to get equal rise and fall times for
the output node.
Why PMOS and NMOS are sized equally in a Transmission Gates?
In Transmission Gate, PMOS and NMOS aid each other rather competing with each other. That's
the reason why we need not size them like in CMOS. In CMOS design we have NMOS and
PMOS competing which is the reason we try to size them proportional to their mobility.
What happens when the PMOS and NMOS are interchanged with one another in an
inverter?
If the source & drain also connected properly...it acts as a buffer. But suppose input is logic 1
O/P will be degraded 1 Similarly degraded 0
Why are pMOS transistor networks generally used to produce high signals, while nMOS
networks are used to product low signals?
This is because threshold voltage effect. A nMOS device cannot drive a full 1 or high and pMOS
cant drive full '0' or low. The maximum voltage level in nMOS and minimum voltage level in
pMOS are limited by threshold voltage. Both nMOS and pMOS do not give rail to rail swing.
Whats the difference between Testing & Verification?
Testing: A manufacturing step that ensures that the physical device , manufactured from the
synthesized design, has no manufacturing defect.
Verification: Predictive analysis to ensure that the synthesized design, when manufactured, will
perform the given I/O function
What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you
avoid Latch Up?
A latch up is the inadvertent creation of a low-impedance path between the power supply rails of
an electronic component, triggering a parasitic structure(The parasitic structure is usually
equivalent to a thyristor or SCR), which then acts as a short circuit, disrupting proper functioning
of the part. Depending on the circuits involved, the amount of current flow produced by this
mechanism can be large enough to result in permanent destruction of the device due to electrical
over stress - EOS
What is slack?
Page 95
The slack is the time delay difference from the expected delay(1/clock) to the actual delay in a
particular path. Slack may be +ve or -ve.
Explain the working of Nmos and Pmos?
Explain the fabrication steps of nmos ,pmos and CMOS?
What happens if we interchange the nmos and pmos in an inverter?
Explain the DC and transient characteristics of inverter?
What is the Need for DRC? And explain the design rules.
Working of flip flops ,counters and adders..
Difference between combinational and sequential circuits?
Difference between MOSFET and BJT?
Difference between latch and flip flops?
Steps involved in digital and analog design.
Why germanium is not used generally for nmos and pmos manufacturing
Moores law
Regions of operation of nmos/pmos.
Page 96