You are on page 1of 5

Using Quartus with the DE2 development Boards

Introduction

We will start using the DE2 development kits in this laboratory. Consequently we need to pause
and discuss how we transfer our Verilog designs to the DE2 hardware. There are three steps
involved in this process:
1. Configuring Quartus. We need to ensure that the correct target Altera device is selected in
Quartus before we begin.
2. Pin assignment. We need to map the 'virtual' input and output ports present within our
Verilog design to real hardware pins on the FPGA. This stage establishes the connectivity
between the our design on the FPGA and the peripherals and interfaces present on the DE2.
3. Programming. The last step involves actually transferring our design from a EDA
workstation to the FPGA via the DE2 board programming interface.
We will assume that by this stage your design compiles successfully, without generating any serious
warnings. We will also assume that design functionality has been verified under simulation.
Selecting the Correct Compile Target:

To do this double-click in Quartus the area shown in Figure 1.

Figure 1: Double click in the Quartus project navigator


to select the compile target

At this point a dialogue should open allowing you to select a target device as shown in
Figure 2. Select the Cyclone II EP2C35F672C6 from the list as this is the device present on
the DE2.

Figure 2: The Quartus device selection dialog.

Recompile your design once this process is complete.

Pin Assignment: Mapping design ports to FPGA Hardware

Mapping module ports in a design to actual FPGA hardware pins is accomplished in Quartus
using the Pin Planner. This can be accessed by going Assignments >> Pin Planner.

The pin planner interface is split into three main regions.

At the bottom of the screen is a list of the ports present in the design. These are listed
on a pin-by-pin basis in a table, which is shown in Figure 3.

Figure 3: List of pins in current design within the Quartus Pin Planner

You will need to consult the DE2 reference documentation to establish the connectivity
between the pins on the target FPGA and the DE2 peripherals. For example say I wish to
connect ip1[2] to toggle switch SW2 . I look in the table in the DE2 manual. This table
tells me SW2 is connected to FPGA pin PIN_P25, as shown in Figure 4.

Figure 4: Pin-out table from DE2 manual. This shows that SW[2] is connected to PIN_P25.

Now, to actually assign PIN_P25 to ip1[2] we simply click in the Location column in the
table row corresponding to ip1[2]. We then simply type in here the name of the FPGA pin
we wish to connect to ip1[2], or select the pin from the list that appears. This process is
shown in Figure 5.

Figure 5: Assigning Pin_P25 to design pin ip1[2]

Repeat this process for all ports present in the design. Then save your project and recompile.

Programming the DE2

Once you have assigned all the pins in your target device you need to actually program the
DE2 board. Before we start you also need to check the DE2 and confirm that the
RUN/PROG toggle switch on the DE2 is set to the RUN setting. Once you have done this
ensure your DE2 is plugged into the mains and into a USB port on your cluster workstation
PC using the provided cable.

Now, turn the DE2 on using the red power button on the board. By default at power-on the
DE2 enters a pre-defined demonstration mode where the LEDs and seven-segment displays
flash. When we program the board however we will overwrite this demo with our own
custom program. This program will last as long as the DE2 has power. When we switch the
board off our program will be lost until we repeat the programming process.

Launch Quartus, and load a project in which you have already set a compile target and
assigned pins. Launch the programmer by going Tools >> Programmer.

When the screen appears you need to ensure that the Mode drop-down box is set to JTAG.
You also need to ensure that the program/configure box next to the name of your
programming (*.sof) file is ticked. Both these settings are shown in Figure 6 & Figure 7.

Figure 6: Tick the program/configure check-box

Figure 7: Ensure the Mode box is set to JTAG

Next we need to configure our programming hardware. Click |Hardware Setup...|

Figure 8: Select USB-Blaster from the list of available hardware.

The box that then appears is shown in Figure BLAH. When you click the drop-down box
that appears USB-Blaster should be present in the list. Select this item. Then click |Add
Hardware...| and then |Close|.

Now you can program your board. To do this click |Start|.

You might also like