Vlsi Lab
Vlsi Lab
AIM: To Design and Implement all logic gates using verilog HDL.
TOOLS: XILINX ISE 9.2i Version
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
Input Input Output Output Output Output Output Output Output Output
a b s=0 s=1 s=2 s=3 s=4 s=5 s=6 s=7
0 0 0 0 0 1 1 1 1 1
0 1 0 1 1 0 1 1 0 0
1 0 0 1 1 0 1 0 0 1
1 1 1 1 0 0 0 0 1 0
SOURCE CODE:
module allgates(a,b,y0,y1,y2,y3,y4,y5,y6,y7,);
input a,b;
output y0,y1,y2,y3,y4,y5,y6,y7;
BUF (y0,a);
NOT (y1,a);
AND (y2,a,b);
NAND (y3,a,b);
OR (y4,a,b);
NOR (y5,a,b);
XOR (y6,a,b);
XNOR(y7,a,b);
endmodule
TEST BENCH:
allgates uut (
.a(a),
.b(b),
.y0(y0),
.y1(y1),
.y2(y2),
.y3(y3),
.y4(y4),
.y5(y5),
.y6(y6),
.y7(y7),
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
// Wait 100 ns for global reset to finish
#100;
end
endmodule
SCHEMATIC DIAGRAM
SIMULATION WAVEFORMS:
SYNTHESIS REPORT:
RTL Top Level Output File Name : allgates.ngr
Top Level Output File Name : allgates
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : Yes
Target Technology : Automotive 9500XL
Macro Preserve : YES
XOR Preserve : YES
Clock Enable : YES
wysiwyg : NO
Design Statistics
# IOs : 6
Cell Usage :
# BELS : 56
# AND2 : 18
# INV : 19
# OR2 : 16
# OR3 : 2
# XOR2 : 1
# IO Buffers : 6
# IBUF : 5
# OBUF : 1
CONCLUSION: Hence the all gates design is implemented using verilog HDL.
2(i).DESIGN OF HALF ADDER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
Input a Input b Output sum Output carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
SOURCE CODE:
module hadf(a,b,s,c);
output s,c;
input a,b;
s wire s,c,a,b;
assign s=a^b;
assign c=a&b;
endmodule
TEST BENCH:
module HA_v;
// Inputs
reg a;
reg b;
// Outputs
wire s;
wire c;
.a(a),
.b(b),
.s(s),
.c(c)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
#100;
a = 0;
b = 1;
#100;
a = 1;
b = 0;
#100;
a = 1;
b = 1;
#100
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
=====================================================================
* Synthesis Options Summary *
=====================================================================
---- Source Parameters
Input File Name : "hadf.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "hadf"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : hadf
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 24
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : hadf.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
CONCLUSION: Hence the half adder has been designed and implemented using
Verilog HDL.
2(ii).DESIGN OF FULL ADDER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
SOURCE CODE:
module fulladderdirect(a,b,c,sum,carry);
output sum,carry;
input a,b,c;
wire sum,carry,a,b,c;
assign sum=a^b^c;
assign carry=(a&b)|(b&c)|(c&a);
endmodule
TEST BENCH:
module fulladderdirect_tb;
// Inputs
reg a;
reg b;
reg c;
// Outputs
wire sum;
wire carry;
// Instantiate the Unit Under Test (UUT)
fulladderdirect uut (
.a(a),
.b(b),
.c(c),
.sum(sum),
.carry(carry)
);
initial begin
// Initialize Inputs
a = 0;
b = 0;
c = 0;
// Wait 100 ns for global reset to finish
#100;
a = 0;
b = 1;
c = 0;
#100;
a = 0;
b = 1;
c = 1;
#100;
a = 1;
b = 0;
c = 0;
#100;
a = 1;
b = 0;
c = 1;
#100;
a = 1;
b = 1;
c = 0;
#100;
a = 1;
b = 1;
c = 1;
#100;
end
endmodule
a = 1;
b = 0;
c = 1;
#100;
a = 1;
b = 1;
c = 0;
#100;
a = 1;
b = 1;
c = 1;
#100;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
RTL Top Level Output File Name : fulladderdirect.ngr
Top Level Output File Name : fulladderdirect
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : Yes
Target Technology : Automotive 9500XL
Macro Preserve : YES
XOR Preserve : YES
Clock Enable : YES
wysiwyg : NO
Design Statistics
# IOs : 5
Cell Usage :
# BELS : 8
# AND2 : 3
# INV : 1
# OR2 : 2
# XOR2 : 2
# IO Buffers : 5
CONCLUSION: Hence the full adder has been designed and implemented
usingVerilog HDL.
2(iii). Design Of Serial Binary Adder
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module adder_4bit ( a ,b ,sum ,carry );
input [3:0] a ;
wire [3:0] a ;
input [3:0] b ;
wire [3:0] b ;
integer i;
reg [4:0]s;
always @ (a or b) begin
s[0] = 0;
for (i=0;i<=3;i=i+1) begin
sum [i] = a[i] ^ b[i] ^ s[i];
s[i+1] = (a[i] & b[i]) | (b[i] & s[i]) | (s[i] & a[i]);
end
carry = s[4];
end
endmodule
TEST BENCH:
module add_v;
// Inputs
reg [3:0] a;
reg [3:0] b;
// Outputs
wire [3:0] sum;
wire carry;
initial begin
// Initialize Inputs
a = 0;
b = 0;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
===========================================================
* Synthesis Options Summary *
=========================================================
---- Source Parameters
Input File Name : "adder_4bit.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "adder_4bit"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : adder_4bit
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 24
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : adder_4bit.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
CONCLUSION: Hence the binary adder has been designed and implemented using
Verilog HDL.
2(iv).DESIGN OF CARRY LOOK AHEAD ADDER
AIM: To Design and Implement carry look ahead adder using verilog HDL.
TOOLS: XILINX ISE 9.2i Version
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module CLA_4bit(
output [3:0] S,
output Cout,PG,GG,
input [3:0] A,B,
input Cin
);
wire [3:0] G,P,C;
assign G = A & B; //Generate
assign P = A ^ B; //Propagate
assign C[0] = Cin;
assign C[1] = G[0] | (P[0] & C[0]);
assign C[2] = G[1] | (P[1] & G[0]) | (P[1] & P[0] & C[0]);
assign C[3] = G[2] | (P[2] & G[1]) | (P[2] & P[1] & G[0]) | (P[2] & P[1] & P[0] & C[0]);
assign Cout = G[3] | (P[3] & G[2]) | (P[3] & P[2] & G[1]) | (P[3] & P[2] & P[1] & G[0]) |(P[3] &
P[2] & P[1] & P[0] & C[0]);
assign S = P ^ C;
TEST BENCH:
module clad_v;
// Inputs
reg [3:0] A;
reg [3:0] B;
reg Cin;
// Outputs
wire [3:0] S;
wire Cout;
wire PG;
wire GG;
initial begin
// Initialize Inputs
A = 0;
B = 0;
Cin = 0;
// Wait 100 ns for global reset to finish
#100;
A=4'b0001;B=4'b0000;Cin=1'b0;
#10 A=4'b100;B=4'b0011;Cin=1'b0;
#10 A=4'b1101;B=4'b1010;Cin=1'b1;
#10 A=4'b1110;B=4'b1001;Cin=1'b0;
#10 A=4'b1111;B=4'b1010;Cin=1'b0;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
===========================================================
* Synthesis Options Summary *
===========================================================
---- Source Parameters
Input File Name : "CLA_4bit.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
CONCLUSION: Hence the carry look ahead adder has been designed and implemented using
Verilog HDL
3.DESIGN OF 2 T0 4 DECODER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
Input E Input Input Output Output Output Output
W1 W0 Y0 Y1 Y2 Y3
0 X X 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
SOURCE CODE:
module dec2to4 (W, Y, En);
input [1:0] W;
input En;
output [0:3] Y;
reg [0:3] Y;
TEST BENCH:
module dec24_v;
// Inputs
reg [1:0] W;
reg En;
// Outputs
wire [0:3] Y;
initial begin
// Initialize Inputs
W = 0;
En = 0;
W = 01;
En = 1;
#100;
W = 10;
En = 1;
#100;
W = 11;
En = 1;
#100;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
=====================================================================
* Synthesis Options Summary *
=====================================================================
CONCLUSION: Hence the full adder has been designed and implemented using
Verilog HDL.
4.DESIGN OF AN 8 TO 3 ENCODER
AIM: To Design and Implement an 8X3encoder using verilog HDL.
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
Input Input Input Input Input Input Input Input Output Output Output
i0 i1 i2 i3 i4 i5 i6 i7 y0 y1 y2
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
SOURCE CODE:
module encoder(i,y);
input [7:0]i;
output [2:0]y;
reg [2:0]y;
always @ (i)
begin
case(i)
8'b00000001:y=3'b000;
8'b00000010:y=3'b001;
8'b00000100:y=3'b010;
8'b00001000:y=3'b011;
8'b00010000:y=3'b100;
8'b00100000:y=3'b101;
8'b01000000:y=3'b110;
8'b10000000:y=3'b111;
default :y=3'b000;
endcase
end
endmodule
TEST BENCH:
module encoder_tb;
// Inputs
reg [7:0] i;
// Outputs
wire [2:0] y;
// Instantiate the Unit Under Test (UUT)
encoder uut (
.i(i),
.y(y)
);
initial begin
// Initialize Inputs
i = 00000000;
// Wait 100 ns for global reset to finish
#100;
i = 00000010;
#100;
i = 00000100;
#100;
i = 00001000;
#100;
i = 00010000;
#100;
i = 00100000;
#100;
i = 01000000;
#100;
i = 1000000;
#100;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
RTL Top Level Output File Name : encoder.ngr
Top Level Output File Name : encoder
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : Yes
Target Technology : Automotive 9500XL
Macro Preserve : YES
XOR Preserve : YES
Clock Enable : YES
wysiwyg : NO
Design Statistics
# IOs : 11
Cell Usage :
# BELS : 67
# AND2 : 17
# AND3 : 2
# AND4 : 1
# INV : 25
# OR2 : 20
# OR3 : 2
# IO Buffers : 11
# IBUF : 8
# OBUF : 3
CONCLUSION: Hence an 8X3encoder has been designed and implemented using Verilog HDL.
5.DESIGN OF 8X1 MULTIPLEXER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
SOURCE CODE:
module MUX8TO1(sel, A,B,C,D,E,F,G,H, MUX_OUT);
input [2:0] sel;
input A,B,C,D,E,F,G,H;
output reg MUX_OUT;
always@(A,B,C,D,E,F,G,H,sel)
begin
case(sel)
3'd0:MUX_OUT=A;
3'd1:MUX_OUT=B;
3'd2:MUX_OUT=C;
3'd3:MUX_OUT=D;
3'd4:MUX_OUT=E;
3'd5:MUX_OUT=F;
3'd6:MUX_OUT=G;
3'd7:MUX_OUT=H;
default:; // indicates null
endcase
end
endmodule
TEST BENCH:
module mux_v;
// Inputs
reg [2:0] sel;
reg A;
reg B;
reg C;
reg D;
reg E;
reg F;
reg G;
reg H;
// Outputs
wire MUX_OUT;
initial begin
// Initialize Inputs
sel = 000;
A = 1;
// Wait 100 ns for global reset to finish
#100;
sel = 001;
B = 0;
#100;
sel = 010;
C = 1;
#100;
sel = 011;
D = 1;
#100;
sel = 100;
E = 1;
#100;
sel = 101;
F = 1;
#100;
sel = 110;
G = 1;
#100;
sel = 111;
H = 1;
#100;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
* Synthesis Options Summary *
===========================================================
---- Source Parameters
Input File Name : "MUX8TO1.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
CONCLUSION: Hence the 8X1 multiplexer has been designed and implemented using Verilog
HDL.
6.DESIGN OF 4 BIT BINARY TO GRAY CODE CONVERTER
AIM: To Design and Implement design of 4 bit binary to gray code converter
using verilog HDL.
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module GTBmod(out,in);
input [3:0]in;
output [3:0]out;
assign out[3]=in[3];
xor(out[2],out[3],in[2]);
xor(out[1],out[2],in[1]);
xor(out[0],out[1],in[0]);
endmodule
TEST BENCH:
module btg_v;
// Inputs
reg [3:0] in;
// Outputs
wire [3:0] out;
initial begin
// Initialize Inputs
in = 0000;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
===========================================================
* Synthesis Options Summary *
===========================================================
---- Source Parameters
Input File Name : "GTBmod.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "GTBmod"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : GTBmod
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 24
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : GTBmod.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
CONCLUSION: Hence the4 bit binary to gray code converter has been designed and
implemented using Verilog HDL.
7(i).DESIGN OF 4:1 MULTIPLEXER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module mux1( select, d, q );
input[1:0] select;
input[3:0] d;
output q;
wire q;
wire[1:0] select;
wire[3:0] d;
assign q = d[select];
end module
TEST BENCH:
module mux_tb;
reg[3:0] d;
reg[1:0] select;
wire q;
Integer i;
initial
begin
#1 $monitor("d = %b", d, " | select = ", select, " | q = ", q
);
end
end module
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
* Synthesis Options Summary *
=========================================================================
---- Source Parameters
Input File Name : "mux1.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "mux1"
Output Format : NGC
Target Device : xa3s400-4-pqg208
- Source Options
Top Module Name : mux1
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 8
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : mux1.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
CONCLUSION: Hence the 4 :1 Multiplexer has been designed and implemented using Verilog
HDL.
7(ii).DESIGN OF 1:4 DEMULTIPLEXER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module demultiplexer1_4 ( din ,x ,y ,a ,b ,c ,d );
output a ;
output b ;
output c ;
output d ;
input din ;
input x ;
input y ;
assign a = din & (~x) & (~y);
assign b = din & (~x) & y;
assign c = din & x & (~y);
assign d = din & x & y;
endmodule
TEST BENCH:
module tb_demux_v;
// Inputs
reg din;
reg x;
reg y;
// Outputs
wire a;
wire b;
wire c;
wire d;
// Instantiate the Unit Under Test (UUT)
demultiplexer1_4 uut (
.din(din),
.x(x),
.y(y),
.a(a),
.b(b),
.c(c),
.d(d)
);
initial begin
// Initialize Inputs
din = 0; x = 0; y = 0; #100;
din = 0; x = 0; y = 1; #100;
din = 0; x = 1; y = 0; #100;
din = 0; x = 1; y = 1; #100;
din = 1; x = 0; y = 0; #100;
din = 1; x = 0; y = 1; #100;
din = 1; x = 1; y = 0; #100;
din = 1; x = 1; y = 1; #100;
SCHEMATIC DIAGRAM:
\
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
* Synthesis Options Summary *
=====================================================================
---- Source Parameters
Input File Name : "demultiplexer1_4.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "demultiplexer1_4"
Output Format : NGC
Target Device : xa3s400-4-pqg208
---- Source Options
Top Module Name : demultiplexer1_4
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 8
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
CONCLUSION: Hence the 1:4Demultiplexer has been designed and implemented using
Verilog HDL.
7(iii).DESIGN OF 4 BIT COMPARATOR
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module compare (A, B, AeqB, AgtB, AltB);
input [3:0] A, B;
output AeqB, AgtB, AltB;
reg AeqB, AgtB, AltB;
always @(A or B)
begin
AeqB = 0;
AgtB = 0;
AltB = 0;
if(A == B)
AeqB = 1;
else if (A > B)
AgtB = 1;
else
AltB = 1;
end
endmodule
TEST BENCH:
module comp4_v;
// Inputs
reg [3:0] A;
reg [3:0] B;
// Outputs
wire AeqB;
wire AgtB;
wire AltB;
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
=====================================================================
* Synthesis Options Summary *
=====================================================================
---- Source Parameters
Input File Name : "compare.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "compare"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : compare
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 24
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : compare.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
CONCLUSION: Hence the 4 bit comparator has been designed and implemented using Verilog
HDL.
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
FULL ADDER IN DATA FLOW MODEL
Module half_add(x,y,s,c);
Input x,y;
Output s,c;
Xor sum(s,x,y);
And carry(c,x,y);
endmodule
Module full_add(A,B,CI,S,CO);
Input A,B,CI;
Output S,CO;
Wire S1,C1,C2;
Half_add PARTSUM(A,B,S1,C1);
SUM(S1,C1,SW,C2);
Carry(c0,c2,c1);
Endmodule
Module fa_bhv(a,b,ci,s,co);
Input a,b,ci;
Output s,co;
always@(a or b or ci)
begin
s=a^b^ci;
end
endmodule
TEST BENCH:
module full_adder
(in_x, in_y, carry_in, sum_out,
carry_out);
input in_x;
input in_y;
input carry_in;
output sum_out;
output carry_out;
wire w_sum1;
wire w_carry1;
wire w_carry2;
half_adder u1_half_adder
(
.in_x(in_x),
.in_y(in_y),
.out_sum(w_sum1),
.out_carry(w_carry1)
);
half_adder u2_half_adder
(
.in_x(w_sum1),
.in_y(carry_in),
.out_sum(sum_out),
.out_carry(w_carry2)
);
endmodule
SCHEMATIC DIAGRAM:
SYNTHESIS WAVEFORM:
SYNTHESIS REPORT:
* Synthesis Options Summary *
---- Source Parameters
Input File Name : "full_adder.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
Design Statistics
# IOs : 5
Cell Usage :
# BELS : 8
# AND2 : 3
# INV : 1
# OR2 : 2
# XOR2 : 2
# IO Buffers : 5
# IBUF : 3
# OBUF : 2
=========================================================================
CPU : 1.92 / 2.39 s | Elapsed : 2.00 / 3.00 s
-->
CONCLUSION: Hence Full adder has been designed and implemented using Verilog HDL.
9(i).DESIGN OF SR FLIPFLOP
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
SOURCE CODE:
module srffdf(s,r,clk,q,qb);
input s,r,clk;
inout q,qb;
wire s1,r1;
assign r1=!(r&clk);
assign q=!(s1&qb);
assign qb=!(r1&q);
endmodule
TEST BENCH:
module srff_v;
// Inputs
reg s;
reg r;
reg clk;
// Bidirs
wire q;
wire qb;
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
===========================================================
* Synthesis Options Summary *
===========================================================
---- Source Parameters
Input File Name : "srffdf.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "srffdf"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : srffdf
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 24
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : srffdf.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
CONCLUSION: Hence the SR flipflop has been designed and implemented using Verilog HDL.
9(ii).DESIGN OF D FLIPFLOP
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
SOURCE CODE:
module dflipflopmod(q, d, clk);
output q;
input d;
input clk;
reg q;
q=d;
endmodule
TEST BENCH:
module dfg_v;
// Inputs
reg d;
reg clk;
// Outputs
wire q;
initial begin
// Initialize Inputs
d = 0;
clk = 0;
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
=====================================================================
* Synthesis Options Summary *
=====================================================================
---- Source Parameters
Input File Name : "dflipflopmod.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "dflipflopmod"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : dflipflopmod
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
CONCLUSION: Hence the D flipflop has been designed and implemented using
Verilog HDL.
9(iii).DESIGN OF JK FLIPFLOP
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
SOURCE CODE:
module JK_flip_flop ( j ,k ,clk ,reset ,q ,qb );
output q ;
reg q ;
output qb ;
reg qb ;
input j ;
wire j ;
input k ;
wire k ;
input clk ;
wire clk ;
input reset ;
wire reset ;
always @ (posedge (clk)) begin
if (reset) begin
q <= 0;
qb <= 1;
end
else begin
if (j!=k) begin
q <= j;
qb <= k;
end
else if (j==1 && k==1) begin
q <= ~q;
qb <= ~qb;
end
end
end
endmodule
TEST BENCH:
module JK_v;
// Inputs
reg j;
reg k;
reg clk;
reg reset;
// Outputs
wire q;
wire qb;
// Instantiate the Unit Under Test (UUT)
JK_flip_flop uut (
.j(j),
.k(k),
.clk(clk),
.reset(reset),
.q(q),
.qb(qb)
);
initial begin
// Initialize Inputs
j = 0;
k = 0;
clk = 1;
reset = 1;
// Wait 100 ns for global reset to finish
#100;
j = 0;
k = 1;
clk = 1;
reset = 1;
#100;
j = 1;
k = 0;
clk = 1;
reset = 1;
#100;
j = 1;
k = 1;
clk = 1;
reset = 1;
#100;
end
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
=========================================================================
* Synthesis Options Summary *
=========================================================================
---- Source Parameters
Input File Name : "JK_flip_flop.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
TRUTH TABLE:
SOURCE CODE:
module t(t,clk,q,qb);
input t;
input clk;
output reg q,qb;
initial
begin q=0;qb=1; end
always@(posedge clk)
begin
if(clk)
begin
case(t)
1'b0:begin q=q;qb=qb; end
1'b1:begin q=~q;qb=~qb; end
endcase
end
end
endmodule
TEST BENCH:
module tfft_v;
// Inputs
reg t;
reg clk;
// Outputs
wire q;
wire qb;
initial begin
// Initialize Inputs
t = 0;
clk = 0;
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
===========================================================
* Synthesis Options Summary *
===========================================================
---- Source Parameters
Input File Name : "t.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
CONCLUSION: Hence the T flipflop has been designed and implemented using
Verilog HDL.
10(i).DESIGN OF 4 BIT BINARY COUNTER
AIM: To Design and Implement 4 bit binary counter using verilog HDL.
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module Counter_4Bit ( clk ,reset ,dout );
input clk ;
wire clk ;
input reset ;
wire reset ;
initial dout = 0;
TEST BENCH:
module bc4_v;
// Inputs
reg clk;
reg reset;
// Outputs
wire [3:0] dout;
initial begin
// Initialize Inputs
clk = 0;
reset = 0;
endmodule
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
=====================================================================
* Synthesis Options Summary *
=====================================================================
---- Source Parameters
Input File Name : "Counter_4Bit.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "Counter_4Bit"
Output Format : NGC
Target Device : xc3s100e-5-vq100
---- Source Options
Top Module Name : Counter_4Bit
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Safe Implementation : No
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Asynchronous To Synchronous : NO
Multiplier Style : auto
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 24
Register Duplication : YES
Slice Packing : YES
Optimize Instantiated Primitives : NO
Use Clock Enable : Yes
Use Synchronous Set : Yes
Use Synchronous Reset : Yes
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Library Search Order : Counter_4Bit.lso
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Read Cores : YES
Write Timing Constraints : NO
Cross Clock Analysis : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
Verilog 2001 : YES
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
CONCLUSION: Hence the 4 bit binary counter has been designed and implemented using
Verilog HDL.
10(ii).DESIGN OF 4 BIT BCD COUNTER
Family - Spartan 3
Device - XC3S400
Package - PQ208
Speed- -4
Synthesis-XST
Simulator-ISE Simulator
ARCHITECTURE:
SOURCE CODE:
module BCD_Counter ( clk ,reset ,dout );
TEST BENCH:
module bcdc4_v;
// Inputs
reg Clock;
reg Clear;
reg E;
// Outputs
wire [3:0] BCD1;
wire [3:0] BCD0;
initial begin
// Initialize Inputs
Clock = 0;
Clear = 0;
E = 0;
SCHEMATIC DIAGRAM:
SIMULATION WAVEFORM:
SYNTHESIS REPORT:
===========================================================
* Synthesis Options Summary *
===========================================================
---- Source Parameters
Input File Name : "BCD_Counter.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
CONCLUSION: Hence the 4 bit BCD counter has been designed and implemented using
Verilog HDL.
Introduction to Cadence User Manual (IC614)
This User Manual is provided by the Cadence Design Systems Support Team and has been
integrated into our lab manual.Objective of this lab is to learn the Virtuoso tool as well learn the
flow of the Full Custom IC design cycle. You will finish the lab by running DRC, LVS and
Parasitic Extraction on the various designs. In the process you will create various components like
inverter, differential amplifier, operational amplifier etc.Start the lab by creating a library called
“myDesignLib” and attach the library to a technology library called “gpdk180”. Attaching a
technology library will ensure that you can do front to back design.
Create a new cell called “Inverter” with schematic view and hence build the inverter
schematic by instantiating various components. Once inverter schematic is done, symbol for
“Inverter” is generated. Now you will create a new cell view called “Inverter_Test”, where you
will instantiate “Inverter” symbol. This circuit is verified by doing various simulations using
spectre. In the process, you will learn to use spectre, waveform window options, waveform
calculator, etc...You will learn the Layout Editor basics by concentrating on designing an
“Inverter” through automatic layout generation. Then you will go ahead with completing the
other layouts. After that, you will run DRC, LVS checks on the layout, Extract parasitics and back-
annotate them to the simulation environment.After completing the parasitic back- annotation flow,
design is ready for generating GDSII.
General Notes
There are a number of things to consider before beginning these lab exercises. Please read
through this section completely, and perform any needed steps in order to ensure a successful
workshop. These labs were designed for use with Incisive Unified Simulator82, IC613 and
Assura32.
Before running any of these labs, ensure that you’ve set up IUS82, IC613, MMSIM71 and
Assura32 correctly:
%> setenv CDSHOME <IC614-installation-home>
You will also need to ensure that the IUS82 is setup correctly for lab 5.
To setup the lab environment, please perform the following steps:
1. Ensure the software mentioned above is correctly setup.
2. Source the C-Shell related commands file i.e. (cshrc file).
These labs were designed to be run using Cadence Virtuoso tool and Assura tool.
3. To verify that the path to the software is properly set in the cshrc file, type the below command
in the terminal window and enter:
>which virtuoso
It gives the complete path of IC614 tool Installation.
>which spectre
It gives the complete path of MMSIM71 tool Installation.
>which assura
It gives the complete path of Assura32 tool Installation.
>which ncsim
It gives the complete path of IUS82 tool Installation.
Starting the Cadence Software
Use the installed database to do your work and the steps are as follows:
1. Change to the course directory by entering this command:
> cd ~/Database/cadence_analog_labs_614
You will start the Cadence Design Framework II environment from this directory because it
contains cds.lib, which is the local initialization file. The library search paths are defined in this
file.
The Cadence_Analog_labs_614 directory contains Solutions folder and also Work folder.
Inside Work folder you can create new cell / modifications of the cell locally without affecting
your Source cell present inside Solutions directory.
3.If the “What’s New ...” window appears, close it with the File— Close command.
3. 4. Keep opened CIW window for the labs.
1.Introduction to Layout Design Rules
➢ These rules usually specify the minimum allowable line widths for physical
objects on-chip such as metal and polysilicon interconnects or diffusion areas,
minimum feature dimensions, and minimum allowable separations between two
such features.
➢ The main objective of design rules is to achieve a high overall yield and
reliability while using the smallest possible silicon area, for any circuit to be
manufactured with a particular process.
➢ The layout design rules which are specified for a particular fabrication process
normally represent a reasonable optimum point in terms of yield and density
➢ A layout which violates some of the specified design rules may still result in an
operational circuit with reasonable yield, whereas another layout observing all
specified design rules may result in a circuit which is not functional and/or has
very low yield.
➢ To summarize, we can say, in general, that observing the layout design rules
significantly increases the probability of fabricating a successful product with
high yield.
✓ Micron rules, in which the layout constraints such as minimum feature sizes and
minimum allowable feature separations, are stated in terms of absolute dimensions in
micrometers, or,
✓Lambda rules, which specify the layout constraints in terms of a single parameter (?) and,
thus, allow linear, proportional scaling of all geometrical constraints.
Lambda-based layout design rules were originally devised to simplify the industry- standard
micron-based design rules and to allow scaling capability for various processes.
It must be emphasized, however, that most of the submicron CMOS process design
rules do not lend themselves to straightforward linear scaling.
The use of lambda-based design rules must therefore be handled with caution in sub-
micron geometries. In the following, we present a sample set of the lambda-based layout
design rules devised for the MOSIS CMOS process.
MOSIS Layout Design Rules (sample set)
RULE L-
Description
Number Rule
R1 3L
Minimum active area width
2 L
R10 Poly contact size
Below steps explain the creation of new library “myDesignLib” and we will use the
same throughout this course for building various cells that we going to create in the
next labs. Execute Tools – Library Manager in the CIW or Virtuoso window to open
Library Manager.
1. In the Library Manager, execute File - New – Library. The new library form
appears.
2.In the “New Library” form, type “myDesignLib” in the Name section.
3.In the field of Directory section, verify that the path to the library is set
to ~/Database/cadence_analog_labs_613 and click OK.
Note: A technology file is not required if you are not interested to do the layouts
for the design.
4.In the next “Technology File for New library” form, select option Attach to an
existing techfile and click OK.
5.In the “Attach Design Library to Technology File” form, select gpdk180 from the
cyclic field and click OK.
6.After creating a new library you can verify it from the library manager.
7.If you right click on the “myDesignLib” and select properties, you will find
that gpdk180 library is attached as techlib to “myDesignLib”.
Creating a Schematic Cellview
In this section we will learn how to open new schematic window in the new
myDesignLib” library and build the inverter schematic as shown in the figure at the
start of this lab.
Do not edit the Library path file and the one above might be different from the path
shown in your form.
2. Click OK when done the above settings. A blank schematic window for the
Inverter design appears.
1. In the Inverter schematic window, click the Instance fixed menu icon to display
2.Click on the Browse button. This opens up a Library browser from which you can
select components and the symbol view .
You will update the Library Name, Cell Name, and the property values given in
the table on the next page as you place each component.
3.After you complete the Add Instance form, move your cursor to the schematic
window and click left to place a component.
Use the Edit— Move command if you place components in the wrong location.
You can rotate components at the time you place them, or use the Edit— Rotate
command after they are placed.
2.After entering components, click Cancel in the Add Instance form or press Esc with
your cursor in the schematic window.
1. Click the Pin fixed menu icon in the schematic window. You can also
execute
2. Type the following in the Add pin form in the exact order leaving space between the
pin names.
Vin Input
Vout Output
Make sure that the direction field is set to input/output/inputOutput when placing the
input/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
You can also press the w key, or execute Create — Wire (narrow).
2. In the schematic window, click on a pin of one of your components as the first
point for your wiring. A diamond shape appears over the starting point of this wire.
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.
1. Click the Check and Save icon in the schematic editor window.
symbol Creation
2. Verify that the From View Name field is set to schematic, and the To View
Name
field is set to symbol, with the Tool/Data Type set as SchematicSymbol.
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 is highlighted, click left to select it.
2. Click Delete icon in the symbol window, similarly select the red rectangle and
delete that.
8. After creating symbol, click on the save icon in the symbol editor window to save
the symbol. In the symbol editor, execute File — Close to close the symbol view
window.
Building the Inverter_Test Design
Objective: To build an Inverter Test circuit using your Inverter
You will create the Inverter_Test cellview that will contain an instance of the Inverter
cellview. In the next section, you will run simulation on this design
Inverter_Test schematic.
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.
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)
8.Leave your Inverter_Test schematic window open for the next section.
In this section, we will run the simulation for Inverter and plot the transient, DC
characteristics and we will do Parametric Analysis after the initial simulation.
Choosing a Simulator
Set the environment to use the Spectre® tool, a high speed, highly accurate analog
simulator. Use this simulator with the Inverter_Test design, which is made-up of
analog components.
Setup— Simulator/Directory/Host.
1. In the Choosing Simulator form, set the Simulator field to spectre(Not spectreS)
and click OK.
Setting the Model Libraries
The Model Library file contains the model files that describe the nmos and pmos
devices during simulation.
Model Library Setup form appears. Click the browse button to add
gpdk.scs if not added by default as shown in the Model Library Setup form.
Remember to select the section type as stat in front of the gpdk.scs file. Your Model
Library Setup window should now looks like the below figure.
To view the model file, highlight the expression in the Model Library File field
and Click Edit File
2. To complete the Model Library Setup, move the cursor and click OK. The Model
Library Setup allows you to include multiple model files. It also allows you to use the
Edit button to view the model file.
Choosing Analyses
This section demonstrates how to view and select the different types of analyses
to complete the circuit when running the simulation.
The Choosing Analysis form appears. This is a dynamic form, the bottom of the form
changes based on the selection above.
2. To setup for transient analysis
a. In the Analysis section select tran
b. Set the stop time as 200n
c. Click at the moderate or Enabled button at the bottom, and then click
Apply.
f. Select “DC Voltage” in the Select Component Parameter form and click
OK.
g.In the analysis form type start and stop voltages as 0 to 1.8 respectively.
h. Check the enable button and then click Apply.
Set the values of any design variables in the circuit before simulating. Otherwise, the
simulation will not run.
In the Simulation window, click the Edit Variables icon.
2. Set the value of the wp variable: With the wp variable highlighted in the Table of
Design Variables, click on the variable name wp and enter the following:
2u
Value(Expr)
Click Change and notice the update in the Table of Design Variables.
3. Click OK or Cancel in the Editing Design Variables window.
2. Follow the prompt at the bottom of the schematic window, Click on output net
Vout, input net Vin of the Inverter. Press ESC with the cursor in the schematic after
selecting it.
2. Set the Save as field to state1_inv and make sure all options are selected under
what to save field.
Parametric Analysis yields information similar to that provided by the Spectre® sweep
feature, except the data is for a full range of sweeps for each parametric step. The
Spectre sweep feature provides sweep data at only one specified condition.
You will run a parametric DC analysis on the wp variable, of the PMOS device of the
Inverter design by sweeping the value of wp.
Run a simulation before starting the parametric tool. You will start by loading
the state from the previous simulation run.
Run the simulation and check for errors. When the simulation ends, a single
waveform in the waveform window displays the DC Response at the Vout node.
A selection window appears with a list of all variables in the design that you can
sweep. This list includes the variables that appear in the Design Variables section of
the Simulation window.
5. Execute Analysis—Start.
The Parametric Analysis window displays the number of runs remaining in the
analysis and the current value of the swept variable(s). Look in the upper right corner
of the window. Once the runs are completed the wavescan window comes up with the
plots for different runs.
Note: Change the wp value of pmos device back to 2u and save the schematic before
proceeding to the next section of the lab. To do this use edit property option.
Creating Layout View of Inverter
1. From the Inverter schematic window menu execute
Launch – Layout XL. A Startup Option form appears.
2. Select Create New option. This gives a New Cell View Form
3. Check the Cellname (Inverter), Viewname (layout).
4. Click OK from the New Cellview form.
LSW and a blank layout window appear along with schematic window.
4. To Move a component, Select the component and execute Edit -Move command.
Making interconnection
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.
1. Execute Create — Via or select command to place different Contacts,
as given in below table
Connection Contact Type
Connection
For Metal1-Nwell
Metal1-
Nwell
Connection
Saving the design
1. Save your design by selecting File — Save or click to save the layout,
and layout should appear as below.
Physical Verification
Assura DRC
Running a DRC
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
3. Click OK to start DRC.
4. A Progress form will appears. You can click on the watch log file to see the
log file.
5. When DRC finishes, a dialog box appears asking you if you want to view
your DRC results, and then click Yes to view the results of this run.
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
In this section we will perform the LVS check that will compare the schematic netlist
and the layout netlist.
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.
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
In this section we will extract the RC values from the layout and perform analog
circuit simulation on the designs extracted with RCX. Before using RCX to extract
parasitic devices for simulation, the layout should match with schematic completely
to ensure that all parasites will be backannoted to the correct schematic nets.
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.
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!
5. Click OK in the Assura parasitic extraction form when done. The RCX progress
form appears, in the progress form click Watch log file to see the output log file.
6.When RCX completes, a dialog box appears, informs you that Assura RCX
run Completed successfully.
7.You can open the av_extracted view from the library manager and view the
parasitic.
Creating the Configuration View
In this section we will create a config view and with this config view we will run
the Simulation with and without parasitic.
1. In the CIW or Library Manager, execute File – New – Cellview
3. Click OK in create New File form. The Hierarchy Editor form opens and a
New Configuration form opens in front of it.
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.
5. Change the Top Cell View to schematic and remove the default entry from the
The hierarchy editor displays the hierarchy for this design using table format.
6. Click the Tree View tab. The design hierarchy changes to tree format. The
form should look like this:
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.
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.
The simulation takes a few seconds and then waveform window appears.
6.
7. In the CIW, note the netlisting statistics in the Circuit inventory section.
This list includes all nets, designed devices, source and loads. There are no
134
1. In the waveform window execute Tools – Calculator.
2. Place the cursor in the text box for Signal1, select the wave button and
select the input waveform from the waveform window.
3. Repeat the same for Signal2, and select the output waveform.
4. 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.
1. Open the same Hierarchy Editor form, which is already set for Inverter_Test config.
2. Select the Tree View icon: this will show the design hierarchy in the tree format.
135
A pull down menu appears. Select av_extracted view from the Set Instance view
5. From the Analog Design Environment window click Netlist and Run to
start the simulation again.
6. When simulation completes, note the Circuit inventory conditions, this time
the list shows all nets, designed devices, sources and parasitic devices as well.
7. 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.
136
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.
3. In the Virtuoso XStream Out form, click Translate button to start the
stream translator.
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.
137
2(ii).CMOS NAND GATE
Schematic Capture
138
Schematic Entry
Use the techniques learned in the Lab2.1 to complete the schematic of NAND
gate. This is a table of components for building the nand gate schematic.
Type the following in the ADD pin form in the exact order leaving space between
the pin names.
vout Output
139
Symbol Creation
Use the techniques learned in the Lab2.1 to complete the symbol of NAND gate
140
Building the NAND Test Design
Define pulse
specification as In lab
analogLib vpulse 2.1
analogLib vdd,vss,gnd vdd=1.8 ; vss= 1.8
141
Analog Simulation with Spectre
Objective: To set up and run simulations on the NAND gate
design.
Use the techniques learned in the Lab2.1 to complete the simulation of NAND
gate, ADE window and waveform should look like below.
142
Creating a layout view of NAND gate
Use the techniques learned in the Lab2.1 to complete the layout of NAND gate.
Complete the DRC, LVS check using the assura tool.
Extract RC parasites for back annotation and Re-simulation.
143
2(iii).CMOS XOR GATE
Schematic Capture
144
Schematic Entry
Use the techniques learned in the Lab2.1 to complete the schematic of XOR
gate. This is a table of components for building the XOR gate schematic.
Type the following in the ADD pin form in the exact order leaving space between
the pin names.
vout Output
145
Symbol Creation
Objective: To create a symbol for the XOR gate
Use the techniques learned in the Lab2.1 to complete the symbol of XOR gate
146
Library name Cellview name Properties/Comments
Define pulse
specification as In lab
analogLib vpulse 2.1
analogLib vdd,vss,gnd vdd=1.8 ; vss= 1.8
Use the techniques learned in the Lab2.1 to complete the simulation of XOR gate,
ADE window and waveform should look like below.
147
Creating a layout view of XOR gate
Use the techniques learned in the Lab1 and Lab2 to complete the layout of XOR
gate. Complete the DRC, LVS check using the assura tool.
Extract RC parasites for back annotation and Re-simulation.
148
149
2(iv). CMOS FULL ADDER
Schematic Capture
150
Schematic Entry
Use the techniques learned in the Lab2.1 to complete the schematic of FULL
ADDER gate.
This is a table of components for building the FULL ADDER gate schematic.
Type the following in the ADD pin form in the exact order leaving space between
the pin names.
Vout Output
151
Analog Simulation with Spectre
Symbol Creation
Use the techniques learned in the Lab2.1 to complete the symbol of FULL ADDER
Define pulse
specification as In lab
AnalogLib vpulse 2.1
AnalogLib vdd,vss,gnd vdd=1.8 ; vss= 1.8
152
Analog Simulation with Spectre
Use the techniques learned in the Lab2.1 to complete the simulation of FULL
ADDE, ADE window and waveform should look like below.
153
Analog Simulation with Spectre
154
Creating a layout view of FULL ADDER
Use the techniques learned in the Lab1 and Lab2 to complete the layout of FULL
ADDER.
155
2(v).LATCH
Schematic capture
156
Objective: To create a new cell view and build A LATCH
Use the techniques learned in the Lab2.1 to complete the schematic of LATCH.
This is a table of components for building the LATCH schematic.
Type the following in the ADD pin form in the exact order leaving space between
the pin names.
vout Output
157
Symbol Creation
Use the techniques learned in the Lab2.1 to complete the symbol of LATCH
158
Building the latch Test Design
159
Analog Simulation with Spectre
Use the techniques learned in the Lab2.1 to complete the simulation of LATCH,
ADE window and waveform should look like below.
160
Creating a layout view of LATCH
Use the techniques learned in the Lab1 and Lab2 to complete the layout of LATCH.
Complete the DRC, LVS check using the assura tool.
Extract RC parasites for back annotation and Re-simulation.