ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 3448
Скачиваний: 2
342 |
Appendix C |
Figure C20
Downloading the Design
Your design is now ready to be downloaded onto the chip.
Double-click on the pof (program object file) icon (shown at the end of compilation, figure C3). A box like that of figure C20 will be displayed.
Select, in the main menu, Options ! Hardware Setup ! ByteBlaster(MV), then click on OK.
Finally, in the screen of figure C20, click on Program to program the device. After a few moments, the chip will be ready to be physically tested and/or used.
TLFeBOOK
Appendix D: Altera Quartus II Tutorial
The following synthesis, placement, and simulation tools are described in the tutorials presented in the Appendices:
Tools |
Application |
Appendix |
ISE 6.1 þ ModelSim 5.7c |
Xilinx CPLDs and FPGAs |
B |
MaxPlus II 10.2 þ Advanced |
Altera CPLDs and some FPGAs |
C |
Synthesis Software |
||
Quartus II 3.0 |
Altera CPLDs and FPGAs |
D |
Quartus II 3.0 from Altera is a comprehensive integrated compiler, placement, and simulation tool. It allows the complete design, from VHDL code to physical implementation, of projects using any of Altera’s FPGA or CPLD devices. Quartus II is the successor of MaxPlus II (Appendix C).
Quartus II 3.0 Web Edition can be downloaded cost-free from www.altera.com. This is a very brief tutorial, which is divided into four parts:
D1. Entering VHDL Code
D2. Compilation
D3. Simulation
D4. Physical Implementation
D1. Entering VHDL Code
Launch Quartus II 3.0. A window like that of figure D1 will be displayed.
Create a new project (File ! New Project Wizard). The dialog box of figure D2 will appear. Select the working directory in the first field, and the project name (same as the ENTITY’s) in the second. The last field will be automatically filled with the project name (you may change it if you want). In the example below, the working directory is d:\altera\my_circuits, and the project name is flipflop. A new project, called flipflop.quartus, is then created in the working directory, which will contain the flipflop.vhd file to be created.
Open the text editor (File ! New, or click on ). The menu of figure D3 will then be displayed. Select VHDL File. A blank screen will be presented.
TLFeBOOK
344 |
Appendix D |
Figure D1
Figure D2
TLFeBOOK
Altera Quartus II Tutorial |
345 |
Figure D3
Enter your VHDL code (as in figure D4). Save it with the extension .vhd (the same name as the ENTITY’s will be automatically assigned to the file, that is, flipflop.vhd in this example).
Check for syntax errors. Select Processing ! Analyze Current File, or simply click
on the analysis icon . Any error detected by the compiler will be described in the bottom window.
D2. Compilation
Select the target device (Assignments ! Devices). A menu like that of figure D5 will be displayed. Choose the desired device Family (MAX3000A, for example). In the Target device option, you may select Auto device. In the Package, Pin count, and Speed grade options, select Any.
To compile your VHDL code, select Processing ! Start Compilation, or click on
. If successful, a window like that of figure D6 will be displayed.
Examine the compilation reports (listed on the left of figure D6). Check at least the following:
(a) Flow Summary: This report is displayed automatically at the end of compilation, as shown in figure D6. It contains the part number of the device, the number of pins used, and the usage of the device (number of logic cells used / total number of logic cells).
TLFeBOOK
346 |
Appendix D |
Figure D4
Figure D5
TLFeBOOK
Altera Quartus II Tutorial |
347 |
Figure D6
(b)Resource Usage Summary (Fitter ! Resource Section ! Resource Usage Summary): This report (figure D7) shows details regarding the number of registers inferred from the code, logic cells used, I/O pins, etc.
(c)Input and Output Pins (Fitter ! Resource Section ! Input Pins, Fitter ! Resource Section ! Output Pins): These two reports show the I/O pin assignments.
(d)Floorplan View (Fitter ! Floorplan View): Shows a layout of the logic cells, which logic cells were used and how, etc. (see figure D8).
(e)Analysis and Synthesis Equations (Analysis and Synthesis ! Analysis and Synthesis Equations): Contains the logical equations implemented by the compiler (logical operations þ registers).
D3. Simulation
Open the Waveform Editor. To do so, select File ! New ! Other File ! Vector
Waveform File, or simply click on . A screen like that of figure D9 will be displayed.
In order to define the size of the waveforms (figure D9), do:
Edit ! End Time (select 500 ns, for example).
Edit ! Grid Size (select Period ¼ 50 ns, Duty Cycle ¼ 50%). Finally, select View ! Fit in Window.
Note: To change the default values, go to Tools ! Options ! Waveform Editor ! General.
TLFeBOOK
348 |
Appendix D |
Figure D7
Figure D8
TLFeBOOK
Altera Quartus II Tutorial |
349 |
Figure D9
Figure D10
Add the input and output signals to the waveform window. To do so, click the right mouse button inside the white area under Name (figure D9) and select Insert Node or Bus. In the next box, select Node Finder. A screen like that of figure D10 will then be shown. Make sure that Filter is set to Pins: all. Click on Start, then on X, and finally on OK. The waveforms window will now contain a list of all signals described in the ENTITY of the VHDL code, as shown in figure D11. Notice that the input signals (clk, rst, d) are indicated by an inward arrow with an ‘‘I’’ inside, while the output signal (q) is represented by an outward arrow with an ‘‘O’’ inside. The position of the signals can be rearranged by simply dragging them up or down (for example, one might want rst to come right below clk).
TLFeBOOK
350 |
Appendix D |
Figure D11
Figure D12
We have to set now the values of the input signals (clk, rst, and d in figure D11). The easiest way is by using the waveform menu (shown on the left-hand side of figure D11). To set up the clock signal, select the entire clk line (by clicking on the arrow
with an I inside beside the word clk) and then click on . A setup box will be displayed. Choose Period ¼ 100 ns.
For rst, select only its first portion (from 0 to 25 ns), then click on , which will cause the selected portion to change its logic level from 0 to 1.
Finally, we have to set up the value of d. Select the entire d line, then click on . Choose Period ¼ 200 ns and Phase ¼ 75 ns. The result is shown in figure D12.
TLFeBOOK
Altera Quartus II Tutorial |
351 |
Figure D13
Notice that q is not available yet, for it will be determined by the simulator. Save the waveform as flipflop.vwf.
The system is now ready for simulation. Select Processing ! Start Simulation, or just click on . The result should look like that in figure D13.
D4. Physical Implementation
Development kit: To perform the physical implementation, we will assume that an Altera UP1 (or UP2) kit is available (this development kit was described in section C5 of appendix C). The kit must be connected to the parallel port of the PC by means of a ByteBlaster cable (provided with the kit).
Device selection: The kit (Altera UP1 or UP2) contains two devices, EPM7128SLC84-7 (a CPLD from the MAX7000S family) and EPF10K70RC240-4 (an FPGA from the FLEX10K family). Therefore, in the Assignments ! Devices step of section D2, one of these two devices must be selected.
Changing pin assignments: The I/O pins are automatically assigned during compilation. However, if desired, the assignments can be changed. Select Assignments ! Assign Pins, which will cause the window of figure D14 to be opened. Say that we
want rst to be connected to pin 4, for example. Select pin 4, then click on , which will open the window of figure D10. Click on Start, select rst on the left column, then click on > and OK. Upon returning to the window of figure D14, click on Add. Repeat this process for any other changes of pin assignments.
TLFeBOOK
352 |
Appendix D |
Figure D14
Figure D15
TLFeBOOK
Altera Quartus II Tutorial |
353 |
Setting up the Programmer: To download the program to the kit (device), first
select Tools ! Programmer, or click on . The window of figure D15 will be shown. In the Hardware option, ByteBlasterMV (LPT1) should appear. If not, click
on Hardware, then on Select Hardware, select ByteBlasterMV, and finally click on Add Hardware. Returning to the window of figure D15, in the File column verify that the design file, with the extension .pof (program object file), is present. Then check the box under Program/Configure.
Programming the device: Finally, the device can be programmed. Just select Processing ! Start Programming. After a few moments, programming will be concluded and the chip ready to be physically tested and/or used.
TLFeBOOK
TLFeBOOK
Appendix E: VHDL Reserved Words
From VHDL 87: |
ENTITY |
OPEN |
WAIT |
EXIT |
OR |
WHEN |
|
ABS |
FILE |
OTHERS |
WHILE |
ACCESS |
FOR |
OUT |
WITH |
AFTER |
FUNCTION |
PACKAGE |
XOR |
ALIAS |
GENERATE |
PORT |
|
ALL |
GENERIC |
PROCEDURE |
From VHDL 93: |
AND |
GUARDED |
PROCESS |
|
ARCHITECTURE |
IF |
RANGE |
GROUP |
ARRAY |
IN |
RECORD |
IMPURE |
ASSERT |
INOUT |
REGISTER |
INERTIAL |
ATTRIBUTE |
IS |
REM |
LITERAL |
BEGIN |
LABEL |
REPORT |
POSTPONED |
BLOCK |
LIBRARY |
RETURN |
PURE |
BODY |
LINKAGE |
SELECT |
REJECT |
BUFFER |
LOOP |
SEVERITY |
ROL |
BUS |
MAP |
SIGNAL |
ROR |
CASE |
MOD |
SUBTYPE |
SHARED |
COMPONENT |
NAND |
THEN |
SLA |
CONFIGURATION |
NEW |
TO |
SLL |
CONSTANT |
NEXT |
TRANSPORT |
SRA |
DISCONNECT |
NOR |
TYPE |
SRL |
DOWNTO |
NOT |
UNITS |
UNAFFECTED |
ELSE |
NULL |
UNTIL |
XNOR |
ELSIF |
OF |
USE |
|
END |
ON |
VARIABLE |
|
TLFeBOOK