Programming and Configuration The design circuit is implemented in a physical FPGA chip by programming the configuration switches that configure the LEs and establish the required wiri
Trang 1QUARTUS II INTRODUCTION
USING VERILOG DESIGN
VIETNAM NATIONAL UNIVERSITY OF HOCHIMINH CITYINTEGRATED CIRCUIT DESIGN RESEARCH AND EDUCATION CENTER
(ICDREC)
FEB – 18 - 2007
By NGO DUC HOANG DEPUTY DIRECTOR
Trang 2A TYPICAL FPGA CAD FLOW
Design Entry Synthesis Functional Simulation Design correct?
Timing Analysis and Simulation Timing requirements met?
Fitting (Place and Route)
Yes No
Yes No
Trang 3QUARTUS II DEVELOPMENT
SYSTEM
Trang 5Design Entry (2 of 2)
Trang 6Design Entry by a schematic diagram
Trang 7Design Entry by a hardware description
language
Trang 8 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
Trang 9LE logic element
Trang 10Fitting (placement and routing)
The placement of the LEs defined in the netlist into the LEs in an actual FPGA chip, also choose routing wires in the chip to
make the required connections between specific LEs
Trang 11Timing Analysis
Analyze the propagation delays along the various paths in the fitted circuit
Trang 12Timing Simulation
The fitted circuit is tested to verify both its functional correctness and timing
Trang 13Programming and Configuration
The design circuit is implemented in a
physical FPGA chip by programming the configuration switches that configure the LEs and establish the required wiring
connections
Trang 14Quartus II Project Management
+ simulated (functional or timing)
+ analyzed for timing
+ used to generate programming file
Quartus II works on one project at a time and keeps all information for that project in a single directory (folder).
Trang 15Quartus II Project –New Project
Select File > New Project Wizard
New Project Wizard help us create a new project and preliminary project settings, including the following:
• Project name and directory
• Name of the top-level design entity
• Project files and libraries
• Target device family and device
• EDA tool settings
You can change or add the settings of the project with the Settings
command (Assignment menu)
1
2
Trang 16Quartus 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.
• The project must have a name, which is usually the same as the top-level design entity
Trang 17Quartus II Project – Add Files
To specify existing files should be
included in the project
Click Next if we do not have any existing files
3
Trang 18Quartus 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
• The target device family is Cyclone II
Trang 19Quartus II Project – EDA Tools
a commonly used term for CAD
software for electronic circuits.
4
Trang 20Quartus II - Summary
5
Trang 21Design Entry using Verilog – An
Trang 22Design Entry using Verilog – Quartus II
Text Editor (1 of 6)
Select File > New to get the right figure, then choose
Verilog HDL File, and click OK
1
2
43
Trang 23Design Entry using Verilog – Quartus II
specify a name for the file that will be created Select File
> Save As
Trang 24Design 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
Trang 25Design Entry using Verilog – Quartus II
Trang 26Design Entry using Verilog – Quartus Text
Editor (5 of 6)
Trang 27Design 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
Trang 28Design Entry using Verilog – Adding
editor, into the directory introductorial To add this file to the project, click on the light.v file and click
Trang 29- Analyze the code
- Synthesize the circuit
- Generate an implementation of the circuit for the target chip.
Selecting Processing > Start Compilation
1
2
Trang 30Compilation (2 of 2)
3
Trang 31Pin 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.
Trang 32Pin Assignment – Assignment Editor
Select Assignments >
Assignments Editor
We will use two toggle switches, labeled SW0 (PIN_N25) and
SW1(PIN_N26), to provide the external inputs, x1 and x2
We will connect the output
f to the green light-emitting diode labeled LEDG0
1
2
Trang 33Pin Assignment – Assignment Editor
3 Double click on the
box into the column labeled Location The drop-down menu appear Scroll down and select
PIN_N25
1 Select Pin in Category
2 Double click on the entry <<new>> which
is highlighted in blue
in the column labeled
To The drop-down menu appear Click on x1
Trang 34Pin Assignment – Assignment Editor
1 Use the same procedure to assign input x2 to
PIN_N26 and output f
to PIN_AE22.
2 Choose File
> Save
3 Recompile
Trang 35Pin Assignments – Using DE2_pin_assignments.csv
We can download DE2_pin_assign ments.csv from
http://www.altera com/education/u niv/materials/boa rds/DE2_pin_assi gnments.csv
Trang 36Pin Assignments – Using DE2_pin_assignments.csv
If we want to make the pin assignments for our circuit by importing DE2_pin_assignments.csv,
we would have to use the same names in
Trang 37Pin Assignments – Using DE2_pin_assignments.csv
Chossing Assignments > Import Assignments
Type (or browse to find) the full path to the directory that hold
DE2_pin_assignments.csv Recompile
Trang 394
5
Trang 406
7
Trang 418
9 Setting the interval time for simulating
10 Enter 200ns in this dialog box
11
Trang 4212
13 Setting displays the entire simulation range of
0 to 200ns in the waveform window
Trang 4314
15 To include the input and output nodes
of the circuit to be simulated
16 This utilityhas a filter used to indicated whattype of nodesare to be found
Trang 4417 Set the filter to Pins:all if we are interested
Trang 4519 Click on the x1 signal to select it
20 Click the > sign to add it to
Selected Nodes box
Trang 4623
2425
Trang 4726
Trang 48Simulating 27 Click on x1 to draw
the waveforms for x1
node
Trang 49To setting x1 to 1 in the
time interval 100 to
200ns, you do as follows:
28 Press the mouse
at the start of the interval (100ns)
Trang 50the logic 1 in the tool
bar at 150ns and drag it to33 Press the mouse
200ns.Then, choose the logic 1 in the tool
bar
Trang 51Simulating – Functional Simulating
34
35
Trang 52Simulating – Functional simulating
36
37
Trang 53Simulating – Functional Simulation
39
40
Trang 54Simulating – Functional Simulating
41
Trang 55Simulating – Functional Simulating
42
43
Trang 56Simulating – Functional Simulating
44
Trang 57Simulating – Functional Simulating
If your report window doesnot show the entire time range(200ns) you do as follows:
45
46
Trang 58Simulating – Functional Simulating
Check the value of f as the output of EX-OR withtwo inputs x1 and x2:
f=0 iff x1 = x2
Trang 59Simulating - Timing Simulation
47
48
Trang 60Simulating – Timing Simulation
49
50
51
Trang 61Simulating – Timing Simulation
52
53
Trang 62Simulating – Timing Simulation
54
Trang 63Simulating – Timing Simulation
There is a delay of about 6ns in producing
a change in the signal f from the time
when the input signal x1 or x2 change
the their values The delay is due to the
propagation delay in the logic element and
the wires in the FPGA device
Trang 64Programming and Configuring –
JTAG Programming
it will retain its configuration as long as the power remain turned on and lost
when the power turned off.
RUN/PROG switch of DE2 board into the RUN position
Trang 65Programming and Configuring –
JTAG Programming
55
56
Trang 66Programming and Configuring –
JTAG Programming
57
58 If not ready choose by default,select JTAG in theMode box
Trang 67Programming and Configuring –
JTAG Programming
59
60
Trang 68Programming and Configuring –
Trang 69Programming and Configuring –
JTAG Programming
63 Click on the Programm/ConfigureCheck box
64
Trang 70Programming and Configuring – AS
Programming
AS = Active Serial
If the FPGA is configured in AS mode, the configuration data has to be loaded into the configuration device, which is identified by the name EPCS16 Then, this data is loaded into the FPGA upon power up or
reconfiguration.
In this mode, you must flip the RUN/PROG switch of DE2 board into the PROG position
Trang 71Programming and Configuring –
AS Programming
65
66
Trang 72Programming and Configuring – AS
Programming
67
68
Trang 73Programming and Configuring – AS
Programming
6970
Trang 74Programming and Configuring – AS
Programming
72
Trang 75Programming and Configuring – AS
Programming
73 Recompile thedesigned circuit
Trang 76Programming and Configuring – AS
Programming
74
Trang 77Programming and Configuring –
JTAG Programming
75
76
Trang 78Programming and Configuring – AS
Programming
77
78 If not ready choose by default,select Active SerialProgramming in theMode box
Trang 79Programming and Configuring – AS
Programming
79 If you are changing the
Mode from the previously
JTAG mode, this box ask if you
want to clear all devices
Trang 80Programming and Configuring – AS
Programming
80 If the configuration file
is not already listed in the
window, press Add File
81 Select the
file light.pof
83
Trang 81Programming and Configuring – AS
Programming
84 Check mark
on the Program/
Configure check box
85 Press Start Note to flip
the RUN/PROG switch on
the DE2 board to the PROG
position
Trang 82Some references
development environment that I am quickly
forgetting about any other PLD (programmable logic device) design tool."
Broadband Communications Sector, Motorola
programmable logic tool offerings, which allows us
to focus our time on meeting customer needs, rather than laboring over tool usage.“