Академический Документы
Профессиональный Документы
Культура Документы
Functional verification, in electronic design automation, is the task of verifying that the logic
design conforms to specification. In everyday terms, functional verification attempts to answer
the question "Does this proposed design do what is intended?" This is a complex task, and takes
the majority of time and effort in most large electronic system design projects.
Functional verification is very difficult - it is equivalent to program verification, and is NP-
hard or even worse - and no solution has been found that works well in all cases. However, it
can be attacked by many methods. None of them are perfect, but each can be helpful in certain
circumstances:
The generator[disambiguation needed] (or irritator) generates input vectors. Modern generators
generate random, biased, and valid stimuli. The randomness is important to achieve a high
distribution over the huge space of the available input stimuli. To this end, users of these
generators intentionally under-specify the requirements for the generated tests. It is the
role of the generator to randomly fill this gap. This mechanism allows the generator to
create inputs that reveal bugs not being searched for directly by the user. Generators also
bias the stimuli toward design corner cases to further stress the logic. Biasing and
randomness serve different goals and there are tradeoffs between them, hence different
1|Page
generators have a different mix of these characteristics. Since the input for the design must
be valid (legal) and many targets (such as biasing) should be maintained, many generators
use theConstraint satisfaction problem (CSP) technique to solve the complex testing
requirements. The legality of the design inputs and the biasing arsenal are modeled. The
model-based generators use this model to produce the correct stimuli for the target design.
The drivers translate the stimuli produced by the generator into the actual inputs for the
design under verification. Generators create inputs at a high level of abstraction, namely, as
transactions or assembly language. The drivers convert this input into actual design inputs
as defined in the specification of the design's interface.
The simulator produces the outputs of the design, based on the design’s current state
(the state of the flip-flops) and the injected inputs. The simulator has a description of the
design net-list. This description is created by synthesizing the HDL to a low gate level net-
list.
The monitor converts the state of the design and its outputs to a transaction abstraction
level so it can be stored in a 'score-boards' database to be checked later on.
The checker validates that the contents of the 'score-boards' are legal. There are cases
where the generator creates expected results, in addition to the inputs. In these cases, the
checker must validate that the actual results match the expected ones.
The arbitration manager manages all the above components together.
Different coverage metrics are defined to assess that the design has been adequately exercised.
These include functional coverage (has every functionality of the design been exercised?),
statement coverage (has each line of HDL been exercised?), and branch coverage (has each
direction of every branch been exercised?).
Functional Verification Tools
Avery Design Systems: SimCluster (for parallel logic simulation) and Insight (for formal
verification)
Cadence Design Systems
EVE/ZeBu
Mentor Graphics
Nusym Technology
Obsidian Software
Synopsys
2|Page
Test Bench
A test bench is a virtual environment used to verify the correctness or soundness of a design or
model (e.g., a software product).
The term has its roots in the testing of electronic devices, where an engineer would sit at a lab
bench with tools of measurement and manipulation, such as oscilloscopes, multimeters,
soldering irons, wire cutters, and so on, and manually verify the correctness of the device under
test.
In the context of software or firmware or hardware engineering, a test bench refers to an
environment in which the product under development is tested with the aid of a collection of
testing tools. Often, though not always, the suite of testing tools is designed specifically for the
product under test.
A test bench or testing workbench has four components.
1.INPUT: The entrance criteria or deliverables needed to perform work
2.PROCEDURES TO DO: The tasks or processes that will transform the input into the output
3.PROCEDURES TO CHECK: The processes that determine that the output meets the standards.
4.OUTPUT: The exit criteria or deliverables produced from the workbench
First create an empty folder in desktop to keep all your files and name it as “exercise”
3|Page
Now change your working directory to “exercise” folder
Click ok
4|Page
To create a new project, go to
5|Page
Observe there is one project tab added, in which your project name is counter
6|Page
Double click counter.v, and start coding for counter in open space
Click library tab, work is default working library of modelsim. It is empty because we have not yet
compiled our counter code.
7|Page
Click New File, name counter_test and type as “Verilog” and click ok
8|Page
Now select both files counter.v and counter_test.v ( use ctrl key to select both files)
9|Page
Simulate Start Simulation
10 |
Page
11 |
Page
All the waves in design are added to the waveform window.
Click on Simulate button , all the input vectors written in testbench are applied to the dut and
waveforms are displayed in the window aas shown below.
After doing basic simulation, click on view and select dataflow. This option is useful for
debugging porpose.
12 |
Page
Once, we add a signal to wave, following wizard pops up. This is helpful for debugging. If any of
the output is X, then by using dataflow command the backtrace can be done and the source that
causes X can be found.
Code coverage
This is useful for any design which helps the verification engineer to apply all cases to the DUT
and check whether all lines of code is covered or not. There are different types of code coverages
like Statement Coverage, Line Cloverage, Expression Coverage etc.
13 |
Page
Compile all the files in design.
14 |
Page
Click Start Simulation
15 |
Page
Enable Code Coverage
16 |
Page
Again run simulation with the selected coverage directives.
All the coverages can be found with 0% covered because we did not apply he inpu stimulus till
now.
17 |
Page
Once we run simulation, alll the coverage directives will be displayed.
18 |
Page
Synsthesis
After Functional verification is done, we now do synthesis.
In electronics, logic synthesis is a process by which an abstract form of desired circuit behavior
(typically register transfer level (RTL)) is turned into a design implementation in terms oflogic
gates. Common examples of this process include synthesis of HDLs, including VHDL and Verilog.
Some tools can generate bitstreams for programmable logic devices such asPALs or FPGAs,
while others target the creation of ASICs. Logic synthesis is one aspect of electronic design
automation.
The roots of logic synthesis can be traced to the treatment of logic by George Boole (1815 to
1864), in what is now termed Boolean algebra. In 1938, Claude Shannon showed that the two-
valued Boolean algebra can describe the operation of switching circuits. In the early days, logic
design involved manipulating the truth table representations as Karnaugh maps. The Karnaugh
map-based minimization of logic is guided by a set of rules on how entries in the maps can be
combined. A human designer can typically only work with Karnaugh maps containing up to four
to six variables.
The first step toward automation of logic minimization was the introduction of the Quine–
McCluskey algorithm that could be implemented on a computer. This exact minimization
technique presented the notion of prime implicants and minimum cost covers that would
become the cornerstone of two-level minimization. Nowadays, the much more
efficient Espresso heuristic logic minimizer has become the standard tool for this operation.
Another area of early research was in state minimization and encoding of finite state
machines (FSMs), a task that was the bane of designers. The applications for logic synthesis lay
primarily in digital computer design. Hence, IBM and Bell Labs played a pivotal role in the early
automation of logic synthesis. The evolution from discrete logic components to programmable
logic arrays (PLAs) hastened the need for efficient two-level minimization, since minimizing
terms in a two-level representation reduces the area in a PLA.
With a goal of increasing designer productivity, research efforts on the synthesis of circuits
specified at the behavioral level have led to the emergence of commercial solutions in 2004[1],
which are used for complex ASIC and FPGA design. These tools automatically synthesize circuits
specified at C level to a register transfer level (RTL) specification, which can be used as input to
a gate-level logic synthesis flow.[1] Today, high-level synthesis, also known as ESL synthesis and
behavioral synthesis, essentially refers to circuit synthesis from high level Languages like ANSI
C/C++ or SystemC etc., whereas Logic Synthesis refers to synthesis from structural or functional
description to RTL.
20 |
Page
TalusDesign by Magma Design Automation
21 |
Page
To start Precision follow this path.
Following window pops up, where we can create new project or open an existing project.
22 |
Page
To crate a new project, click new project
Enter project name and browse the path, where it should be saved.
23 |
Page
Now a new project is created named Techlabs_synthesis.
To add new .v or .vhd files, right click on input files and select add input files.
24 |
Page
We need to add only design files , no need to add test bench files here.
25 |
Page
Click on synthesis design.
After synthesis, many files are added to the output files as shown below.
26 |
Page
All the information in the output files can be viewed by double clicking on the file.
Technology Schematic.
27 |
Page
Area Report.
28 |
Page
All the options that can be accessed under each category is listed below.
29 |
Page
After running the process one can view all the files of different implementations for same project.
30 |
Page
Programs
adder_8bit.v
//outputs
output [7:0] sum;
output cout;
//wires
wire [7:0] a;
wire [7:0] b;
wire cin;
adder_1bit.v
module adder_1bit ( a , b, cin , sum, cout );
//inputs
input a , b , cin;
//outputs
output sum, cout;
31 |
Page
assign sum = a ^ b ^cin;
assign cout = cin(a^b) + ab;
endmodule
test_adder.v
// test bench for 8-bit adder
module test_adder();
reg [7:0] a;
reg [7:0] b;
reg cin;
initial begin
a = 8'b00000000;
b = 8'b00000000;
cin = 1'b0;
#100 $finish;
end
endmodule
32 |
Page
address_decoder.v
module decoder_using_case (
binary_in , // 4 bit binary input
decoder_out , // 16-bit out
enable // Enable for the decoder
);
input [3:0] binary_in ;
input enable ;
output [15:0] decoder_out ;
endmodule
33 |
Page
test_decoder.v
module test_decoder;
reg [3:0] binary_in;
reg enable;
wire [15:0] decoder_out;
initial begin
binary_in = 4'h0;enable = 0;
#10
enable = 1;
#10
binary_in = 4'h1;
#10
binary_in = 4'h7;
#10
binary_in = 4'hA;
#10
binary_in = 4'hF;
#10
binary_in = 4'h3;
end
endmodule
mux using if
module mux_4to1_using_if (a, b, c, d, s, o);
input a,b,c,d;
input [1:0] s;
output o;
reg o;
always @(a or b or c or d or s)
34 |
Page
begin
if (s == 2'b00)
o = a;
else if (s == 2'b01)
o = b;
else if (s == 2'b10)
o = c;
else
o = d;
end
endmodule
test_mux.v
module test_mux;
reg a, b, c, d;
reg [1:0] s;
wire o;
initial begin
a=1;b=1;c=0;d=0;
s=00;
#20
s=01;
#20
s=10;
#20
s=11;
end
endmodule
Multiplier
module multiplier_4bit( a , b , out);
//inputs
input [3:0] a;
35 |
Page
input [3:0] b;
//output
output [8:0] out;
//wires
wire [3:0] a;
wire [3:0] b;
assign out = a * b;
endmodule
Test_Multiplier
module test_multiplier;
reg [3:0] a;
reg [3:0] b;
initial begin
a=4'b0000, b=4'b0000;
#20
a=4'b0001, b=4'b0011;
#20
a=4'b1111, b=4'b1111;
end
endmodule
36 |
Page
Accumulator
test_accumulator
module test_acc;
wire [3:0] q;
initial begin
forever begin
clk <= 0;
#5
clk <= 1;
#5
clk <= 0;
end
end
37 |
Page
initial begin
clr = 0;
#20
clr = 1;data = 0001;
#20
clr = 0; data = 0010;
#20
data = 0011;
#20 clr = 1
end
endmodule
Counter
module up_counter (
out , // Output of the counter
enable , // enable for counter
clk , // clock Input
reset // reset Input
);
//----------Output Ports--------------
output [7:0] out;
//------------Input Ports--------------
input enable, clk, reset;
//------------Internal Variables--------
reg [7:0] out;
//-------------Code Starts Here-------
always @(posedge clk)
if (reset) begin
out <= 8'b0 ;
end else if (enable) begin
38 |
Page
out <= out + 1;
end
endmodule
module test_upcounter;
reg clk, reset,enable ;
wire [7:0] out;
initial begin
forever begin
clk <= 0;
#5
clk <= 1;
#5
clk <= 0;
end
end
initial begin
reset = 1;
#20
reset = 0;enable = 1;
#100
enable = 0;
#150
reset = 0;
end
endmodule
39 |
Page
PRBS Generator
//inputs
input clk, reset;
//outputs
output rand;
//wires
wire rand;
//internal registors
reg [3:0] temp;
begin
if (reset)
else
temp <= {temp[0]^temp[1],temp[3],temp[2],temp[1]};
end
endmodule
40 |
Page
Test Bench for PRBS
module main;
wire rand;
initial begin
forever begin
clk <= 0;
#5
clk <= 1;
#5
clk <= 0;
end
end
initial begin
reset = 1;
#12
reset = 0;
#90
reset = 1;
#12
reset = 0;
end
endmodule
41 |
Page
Experiments 5 to 8 should be worked on Tanner. The basic working on all the tools of tanner is
explained with simple Inverter Design.
42 |
Page
To create a new design : File New Design
Enter the design name and give the path where it should be saved.
43 |
Page
Add component libraries. The path for component libraries is given below.
Click add in S-Edit window for adding the libraries and follow the path of process folder.
44 |
Page
Double click all the component libraries under Generic_250nm and add all tanner database files
(.tdb).
To add Spice commands and Spice Elements for setting spice simulation follow the path.
45 |
Page
Give a new name for cell
46 |
Page
Scroll mouse for Zoom In and Zoom Out. And to view entire design press home button on
keyboard.
To add any component either drag the component on to the design area (black region
with grids) or click Instance , then Instance Cell pops up where a user can change the
properties . Keeping the icon on the design area , components icon can be placed N
number of times. Either press ESC button on keyboard or Done on Instance Cell window
to stop placing of cells.
47 |
Page
In the same way place PMOS component on the design area.
To Zoom the design area scroll the mouse or press home button on keyboard.
48 |
Page
Now place Vdd and Gnd Instances from the Misc folder under Library.
Now place a DC Voltage and Pulse Voltage source from the Spice Elements folder under Library.
49 |
Page
To place a Voltage Source, Click Spice Elements, Under Spice Elements Click Voltage Source and
then Instance.
To place a DC voltage source, change the interface to DC and edit the voltage value . Click done
only after placing the voltage source on design area.
50 |
Page
To place a Pulse voltage source, change the interface to DC and edit the voltage value . Click
done only after placing the voltage source on design area.
Place Vdd and Gnd even for the voltage sources as shown.
51 |
Page
When an input port is placed, In port window pops up where we can edit the port name , font size
and orientation. Even the port orientation can be changed by pressing r button on key board.
Now we have placed all the components on the design window. And connections are made using
the wire as shown below
52 |
Page
Now we need to set up simulation.
53 |
Page
Now , give the path of library file.
TT is the corner model used . There are different types of Corner models in .lib file
54 |
Page
Run Simulation.
55 |
Page
To view waveforms , place PrintVoltage from Spice Commands library.
To extract the spice netlist from schematic, go to S-Edit and click the T-Spice option.
57 |
Page
The following spice netlist is extracted from the schematic which contains the information of the
circuit connections across its nodes, analysis setup , voltages applied and type of library used for
simulation.
L-EDIT
59 |
Page
The following is the path for opening L-Edit tool :
Go to File New
60 |
Page
Click Browse My Documents\Tanner EDA\Tanner Tools v15.0 \Process \Generic_250nm
\Generic_250nm_Tech and add Generic_250nm_TechSetup.tdb file and click ok.
Go to Cell New
62 |
Page
Select Lambda or microns accordingly and click ok
From layer palette, we can select layer then for drawing layer we need to switch at Drawing boxes
as follows
Now we can start layout designing. We are Taking Example of CMOS Layout design
63 |
Page
Now draw P Implant over Active with keeping in mind Lambda based design rules
64 |
Page
Now draw Contact for Active region
65 |
Page
We have designed source, gate and drain.
66 |
Page
We can perform DRC (Design Rule Check) at every stage
If we are violating any Design rule then it will be shown in Error verification navigator
67 |
Page
By clicking on the error, the tool points to the error that occur on layout.
68 |
Page
By increasing the poly density area in the layout we can minimize that error. And again run DRC
check.
69 |
Page
To define port, go to (A)
70 |
Page
Similarly we do NMOS layout.
71 |
Page
After connecting NMOS and PMOS , CMOS layout looks like as follows.
72 |
Page
73 |
Page
Click options in Setup Extract above, and uncheck all Hiper Verify Options.
Final netlist
After saving spice file, we can simulate it, W-Edit will invoked and we can check the response:
75 |
Page
LVS
(Layout Vs Schematic)
We got two output files (one from S-Edit and second from L-Edit), Now we can compare results
by using LVS
76 |
Page
Double click on LVS, and file -> new &
We need to browse spice netlist files for layout netlist and Schematic netlist
77 |
Page
After including these files, we need to run verification as follows &
78 |
Page
Experiment No. 5:
Theory :
A differential amplifier is a type of electronic amplifier that multiplies the difference between
two inputs by some constant factor (the differential gain).
Many electronic devices use differential amplifiers internally. The output of an ideal differential
amplifier is given by:
Where and are the input voltages and Ad is the differential gain.
In practice, however, the gain is not quite equal for the two inputs. This means, for instance, that
if and are equal, the output will not be zero, as it would be in the ideal case. A more
realistic expression for the output of a differential amplifier thus includes a second term.
The common-mode rejection ratio, usually defined as the ratio between differential-mode gain
and common-mode gain, indicates the ability of the amplifier to accurately cancel voltages that
are common to both inputs. Common-mode rejection ratio (CMRR):
In a perfectly symmetrical differential amplifier, Ac is zero and the CMRR is infinite. Note that a
differential amplifier is a more general form of amplifier than one with a single input; by
grounding one input of a differential amplifier, a single-ended amplifier results. An operational
amplifier, or op-amp, is a differential amplifier with very high differential-mode gain, very high
input impedances, and a low output impedance. Some kinds of differential amplifier usually
include several simpler differential amplifiers. For example, an instrumentation amplifier, a fully
differential amplifier, an instrument amplifier, or an isolation amplifier are often built from
several op-amps.
79 |
Page
Differential amplifiers are found in many systems that utilise negative feedback, where one input
is used for the input signal, the other for the feedback signal. A common application is for the
control ofmotors or servos, as well as for signal amplification applications. In discrete electronics,
a common arrangement for implementing a differential amplifier is the long-tailed pair, which is
also usually found as the differential element in most op-amp integrated circuits. A differential
amplifier is used as the input stage emitter coupled logic gates.
Design :
80 |
Page
81 |
Page
Using the lines for drawing, create a symbol for op-amp as below.
82 |
Page
Again create a symbol for the above circuit and make the connections accordingly.
Vpwr and Vpwr/2 are the instance name of the voltage souces.
Now place the spice commands for finding out the gain, bandwidth.
83 |
Page
Simulation setup
84 |
Page
Gain , Frequency and Bandwidth can be viewed from simulation window above.
85 |
Page
7th Experiment is 10 Bit Number Controlled Oscillator.
The following schematic shows 10 bit VCO. By changing the values of D0 – D9 the input pulse
applied varies accordingly.
86 |
Page
87 |
Page