Professional Documents
Culture Documents
QUARTUS II INTRODUCTION
USING VERILOG DESIGN
FEB – 18 - 2007
A TYPICAL FPGA CAD FLOW
Design Entry
Synthesis
Functional Simulation
No
Design correct?
Yes
No
Timing requirements met?
Yes
VHDL
AHDL…
Design Entry (2 of 2)
Design Entry by a schematic diagram
Design Entry by a hardware description
language
Synthesis
The entered design is synthesized into a
circuit that consists of the logic elements
(LEs) provided in the FPGA chip.
LE is the smallest unit of logic of Altera’s
FPGA. It’s compact and provides advanced
features with efficient logic ultilization.
This course doesn’t cover the architecture
of Altera’s FPGA
LE logic element
Fitting (placement and routing)
2
• Target device family and device
• EDA tool settings
You can change or add the settings of
the project with the Settings
command (Assignment menu)
Quartus II Project – Directory, Name, Top-
Level Entity
• You can choose any
directory name if you
prefer. If we have not yet
created the directory of
the project, Quartus II
asking if it should create
the desired directory.
Click Next if we do
not have any existing
files.
3
Quartus II Project – Family and Device
Settings
To specify the type of
device in which the
designed circuit will be
implemented. In case of
DE2 board, we choose:
• The device is
EP2C35F672C6 which
is the FPGA used on
DE2 board
Quartus II Project – EDA Tools
Settings
To specify any third-
party tools that
should be used. EDA
is means Electronic
Design Automation,
a commonly used
term for CAD
software for
4 electronic circuits.
Quartus II - Summary
5
Design Entry using Verilog – An
example
module light(x1,x2,f);
input x1,x2;
output f;
assign f = (x1&~x2)|(~x1&x2);
endmodule
Design Entry using Verilog – Quartus II
Text Editor (1 of 6)
Select File >
New to get
3
the right
1 figure, then
choose
Verilog HDL
2
File, and
click OK
4
Design Entry using Verilog – Quartus II
Text Editor (2 of 6)
Quartus II open the
Text Window
Editor. The default
name of design file
is Verilog1.v. The
first step is to
specify a name for
the file that will be
created. Select File
> Save As
Design Entry using Verilog – Quartus II
Text Editor (3 of 6)
In the box labeled Save
as type choose Verilog
HDL File.
In the box labeled
File name , type light
Put a checkmark in the
box Add file to current
project
Click Save
Design Entry using Verilog – Quartus II
Text Editor (4 of 6)
Type the Verilog
code of our
design into Text
Editor.
Save the file
light.v by choose
File > Save.
Design Entry using Verilog – Quartus Text
Editor (5 of 6)
Design Entry using Verilog – Quartus II Text
Editor (6 of 6)
We can change
the options of
Text Editor of
Quartus II by
the settings in
Tools >
Options > Text
Editor
Design Entry using Verilog – Adding
Design Files
If light.v is not a part of
the project, this file must
be added to the project.
For example: if you did
not use the Quartus II
Text Editor, then you
place a copy of the file
light.v, which you created
using some other text
editor, into the directory
introductorial. To add this
file to the project, click on
the light.v file and click
Open
Compilation (1 of 2)
Verilog code in the design file
light.v is processed by the
application program called the
Compiler.
The Compiler :
1
- Analyze the code
- Synthesize the circuit
- Generate an implementation of
the circuit for the target chip.
2 Selecting Processing > Start
Compilation
Compilation (2 of 2)
3
Pin Assignment
Purpose: map the I/O signals of your design to
the physical pins of selected FPGA.
Pin assignments are made by:
• Assignment Editor (manual), or
• Import a pin assignment from a special file
format – comma separated value (CSV)
format.
Note: All relevant pin assignments for the DE2
board are given in the file called
DE2_pin_assignments.csv in the CD-ROM or
on the Altera’s DE2 web pages.
Pin Assignment – Assignment Editor
1 module light1(SW,LEDG);
2 input [1:0]SW;
3 output [0:0]LEDG;
4 assign LEDG[0] =
(SW[0]&~SW[1])|(~SW[0]&SW[1]);
5 endmodule
Pin Assignments – Using
DE2_pin_assignments.csv
1
1
2
3
Simulating
5
Simulating
6
7
8 Simulating
10. Enter 200ns in this dialog box
11
24
21 22
Simulating
26
Simulating
27. Click on x1 to draw
the waveforms for x1
node.
To setting x1 to 1 in the
time interval 100 to
Simulating
200ns, you do as follows:
34
35
Simulating – Functional simulating
36
37
38
Simulating – Functional Simulation
39
40
Simulating – Functional Simulating
41
Simulating – Functional Simulating
42
43
Simulating – Functional Simulating
44
Simulating – Functional Simulating
If your report window does
not show the entire time range
(200ns) you do as follows:
45
46
Simulating – Functional Simulating
47
48
Simulating – Timing Simulation
49
50
51
Simulating – Timing Simulation
52
53
Simulating – Timing Simulation
54
Simulating – Timing Simulation
55
56
Programming and Configuring –
JTAG Programming
57
58. If not ready
choose by default,
select JTAG in the
Mode box
Programming and Configuring –
JTAG Programming
59
60
Programming and Configuring –
JTAG Programming
62
65
66
Programming and Configuring – AS
Programming
67
68
Programming and Configuring – AS
Programming
69
70
71
Programming and Configuring – AS
Programming
72
Programming and Configuring – AS
Programming
74
Programming and Configuring –
JTAG Programming
75
76
Programming and Configuring – AS
Programming
77
78. If not ready
choose by default,
select Active Serial
Programming in the
Mode box
Programming and Configuring – AS
Programming