









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A lab tutorial designed to familiarize students with using Quartus II software through a complete design phase. It covers creating a new project, creating a new SystemVerilog file, compiling the design, managing I/O assignments, and programming a design onto the Altera DE0 Development Board. The lab also includes simulating the designed circuit and programming and configuring the FPGA device. step-by-step instructions and screenshots to guide students through the process.
Typology: Lecture notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










This lab is designed to familiarize you with using many of the common aspects of the Quartus II software through a complete design phase. You will create a new project, create a new SystemVerilog file, compile the design, plan and manage I/O assignments, and program a design onto the Altera DE 0 Development Board. Each logic circuit, or sub-circuit, being designed with Quartus II software is called a project. The software works on one project at a time and keeps all information for that project in a single directory (folder) in the file system. To begin a new logic circuit design, the first step is to create a directory to hold its files. To hold the design files for this tutorial, we will use a directory “Lab 0 ”. The running example for this tutorial is a simple circuit for two- way light control. Figure 1 Main Quartus Prime Display
To start working on a new design we first have to define a new design project. Quartus II software makes the designer’s task easy by providing support in the form of a wizard. Create a new project as follows:
window which asks for the name and directory of the project. Set the working directory to be Lab1; of course, you can use some other directory name of your choice if you prefer. The project must have a name, which is usually the same as the top-level design entity that will be included in the project. Choose lab1 as the name for both the project and light as the name for the top-level entity, as shown in Figure 2 (b). Press Next.
Figure 2 New Project Creation Wizard in Quartus II
2. The wizard makes it easy to specify which existing files (if any) should be included in the project. Since we do not have any existing files, click Next, which leads to the window in Figure 3 The wizard can include user- specified design files. Choose the device family and a specific device. (a) (b) Figure 3 The wizard can include user-specified design files. Choose the device family and a specific device.
Figure 6 The light controller circuit The required circuit is described by the SystemVerilog code in Figure 7 Error! Reference source not found.. Note that the SystemVerilog entity is called light to match the name given in Error! Reference source not found. Figure 5 , which was specified when the project was created. This code can be typed into a file by using any text editor that stores ASCII files, or by using the Quartus II text editing facilities. While the file can be given any name, it is a common designers’ practice to use the same name as the name of the top-level SystemVerilog entity. The file name must include the extension .sv, which indicates a SystemVerilog file. So, we will use the name light.sv.
File, and click OK. This opens the Text Editor tab. Enter your SystemVerilog description into the tab and save the file. Remember that your file name should be as same as the SystemVerilog entity name, which is light in this case. Save your file with an extension .sv. Put a checkmark in the box Add file to current project. Figure 8 Choose to prepare a SystemVerilog file to get a Text Editor tab
The SystemVerilog code in the file light.vhd is processed by several Quartus II tools that analyze the code, synthesize the circuit, and generate an implementation of it for the target chip. These tools are controlled by the application program called the Compiler.
f x 1 x 2 f 0 0 0 0 1 1 1 0 1 1 1 0 module light(input x1,x2, output f); assign f = (x1 & ~x2) | (~x1 & x2) ; endmodule: light Figure 7 SystemVerilog Code for the circuit in Figure 6 The light controller circuit
or by clicking on the toolbar icon that looks like a purple triangle. As the compilation moves through various stages, its progress is reported in a window on the left side of the Quartus II display. Successful (or unsuccessful) compilation is indicated in a pop-up box. Figure 9 Design compilation window. Acknowledge it by clicking OK, which leads to the Quartus II display in Figure 10 Error! Reference source not found.. In the message window, at the bottom of the figure, various messages are displayed. In case of errors, there will be appropriate messages given. Figure 10 Display after a successful compilation.
your pin assignment window will be similar to Figure 13. Figure 13 The complete pin assignment.
Before implementing the designed circuit in the FPGA chip on the DE0 board, it is prudent to simulate it to ascertain its correctness. Quartus II software too includes a simulation tool that can be used to simulate the behaviour of a designed circuit. Before the circuit can be simulated, it is necessary to create the desired waveforms, called test vectors, to represent the input signals. It is also necessary to specify which outputs, as well as possible internal points in the circuit, the designer wishes to observe. The simulator applies the test vectors to a model of the implemented circuit and determines the expected response. We will use the Quartus II Waveform Editor to draw the test vectors, as follows:
Reference source not found. (a). Choose University Program VWF under the section Verification/Debugging and click OK. Figure 14 The Waveform Editor window
Insert Node or Bus to open the window in Figure 15 Error! Reference source not found.. It is possible to type the name of a signal (pin) into the Name box, but it is easier to click on the button labeled Node Finder to open the window in Figure 15 Error! Reference source not found.. Error! Reference source not found. The Node Finder utility has a filter used to indicate what type of nodes are to be found. Since we are interested in input and output pins, set the filter to Pins: all. Click the List button to find the input and output nodes as indicated on the left side of the figure. Figure 15 The Insert Node or Bus dialogue and selecting nodes to insert into the waveform Editor (a) (b)
the Selection Tool, which is activated by selecting the icon in the toolbar, or the Waveform Editing Tool, which is activated by the icon.
by a hashed pattern; its value will be determined during simulation. Save the file. Figure 18 Setting of test values
Configuring the FPGA in JTAG Mode: Figure 21 JTAG configuration setup Figure 21 illustrates the JTAG configuration setup. To download a configuration bit stream into the Cyclone III FPGA, perform the following steps:
Figure 22 The Programmer window