01 Tutorial
01 Tutorial
Task:
This tutorial exercise introduces FPGA design flow for Altera's Quartus II software. In
schematic editor instantiate a TFF storage element. Simulate the design to learn how this
component is working. Assign pushbutton to the clock input, switches to all other inputs
and LED to the trigger output. Using DE2-115 board implement the storage element. Write
a VHDL description of the same trigger, simulate it to verify correctness and implement it
in the same way as before. Refer to DE2-115 board manual for pin numbers.
Quartus II overview
Quartus II development software provides a complete design environment for System on a
Programmable Chip (SOPC) design. Quartus II offers easy design entry (using schematics,
block diagrams, AHDL, VHDL, Verilog and SystemVerilog), powerful logic synthesis,
functional and timing simulation, device programming and verification.
The default Quartus II software graphical user interface (Figure 1) can be divided into six
main components:
Drop-down Menus – provide access to all features of Quartus II software.
Adjustable Toolbar – provides shortcuts to the most frequently used tools.
Project Navigator window – provides control over project options and source files.
Status window – provides status information on any process in progress.
Editor window – provides source file review and editing capabilities.
Console window – provides design flow related messages.
The default toolbar (Figure 2) provides a quick launch capability for the most frequently
used tools. The leftmost icon opens and closes Project Navigator window. Right next to it is
the project Settings icon. The following three icons provide access to Assignment Editor,
Pin Planner and Chip Planner. These tools are used to place area and timing constraints on
the design. Any running process can be stopped by clicking on the Stop Processing icon.
The icon with a purple triangle-shaped symbol starts full design compilation, which
generates a configuration file in the end. Next to it is a Start Analysis & Synthesis icon,
which is the first step of the full compilation process. Icons with watches launch Timing
Analyzer tool. The icon with a blue triangle-shaped symbol starts the simulation. The
following icon opens compilation report. Next to it, is the Programmer icon. This tool is
used to configure Altera FPGA devices. The icon with three rectangles starts Qsys System
Integration Tool (this tool will be discussed later). And finally, the question mark icon
opens Quartus II help file.
Open the Symbol Tool. Expand the libraries folder first, then primitives. Most of the
standard components can be found here. Expand storage folder and select tff component.
Click OK. The trigger is now attached to the mouse cursor, left-click to place it anywhere
on the workspace. Enable Selection Tool to detach the element. Open the Symbol Tool
again and expand pin folder. Trigger has four inputs and one output, thus four input and
one output pins are needed. Make connections using wires, not buses. Double-click each
pin to open Pin Properties dialog box and rename them. Save the result schematic
(Figure 5), giving it the project entity name to make it top-level source file. Note that
Quartus II does not have an in-built simulator, thus en external simulator (e.g. ModelSim
Altera Starter Edition) should be used to verify the functionality of the design. However, it
is not possible to simulate schematic source files unless they are converted to HDL first.
Pin assignment
Run Analysis & Synthesis by pressing the corresponding icon on the default toolbar, then
open Pin Planner tool. In Location column provide the appropriate pin numbers. Figure 6
provides an example pin assignment. Clock input is assigned to pushbutton KEY3, input
CLRN is assigned to switch SW2, input PRN is assigned to switch SW1, input T is
assigned to switch SW0, output Q is assigned to LEDR0. When pin assignment is made,
simply close the Pin Planner.
Figure 6: Pin assignment
To eliminate the possibility of any damage to the board all unused pins must be set as
inputs. Click on the Settings icon and select Device category. Click Device & Pin
Options... and switch to Unused Pins tab. Set Reserve all unused pins to As input
tri-stated. Click OK, then click OK again. Repeat this step for any new project.