CPE 200L LABORATORY 4: INTRODUCTION TO DE2 BOARD UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND:

Similar documents
EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 7: VHDL and DE2 Board. Name: Date:

Terasic DE0 Field Programmable Gate Array (FPGA) Development Board

PRELAB! Read the entire lab, and complete the prelab questions (Q1- Q3) on the answer sheet before coming to the laboratory.

Lab 2 EECE473 Computer Organization & Architecture University of Maine

Introduction to VHDL Design on Quartus II and DE2 Board

FPGA Introductory Tutorial: Part 1

Tutorial on Quartus II Introduction Using Verilog Code

QUARTUS II Altera Corporation

NIOS CPU Based Embedded Computer System on Programmable Chip

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 10: Implementing Binary Adders. Name: Date:

Chapter 2 Getting Hands on Altera Quartus II Software

Laboratory Exercise 8

Tutorial on Quartus II Introduction Using Schematic Designs

ECE 3610 Microprocessing Systems Lab #1 Verilog Design of the TOC Using Quartus II

ECSE-323 Digital System Design. Lab #1 Using the Altera Quartus II Software Fall 2008

Laboratory 4 Design a Muti-bit Counter

Quartus II Introduction Using Verilog Design

NIOS CPU Based Embedded Computer System on Programmable Chip

Laboratory 4 Design a Muti-bit Counter and Programming a FPGA

Lab 6: Integrated the Decoder with Muti-bit Counter and Programming a FPGA

EE 231 Fall EE 231 Lab 2

Quartus II Introduction Using Schematic Design

NOTE: This tutorial contains many large illustrations. Page breaks have been added to keep images on the same page as the step that they represent.

University of California, Davis Department of Electrical and Computer Engineering. Lab 1: Implementing Combinational Logic in the MAX10 FPGA

Laboratory Exercise 7

Quick Tutorial for Quartus II & ModelSim Altera

EE 231 Fall Lab 1: Introduction to Verilog HDL and Altera IDE

SOPC LAB1. I. Introduction. II. Lab contents. 4-bit count up counter. Advanced VLSI Due Wednesday, 01/08/2003

ENEE245 Digital Circuits and Systems Lab Manual

Quartus II Introduction Using Verilog Designs. 1 Introduction. For Quartus II 12.0

Laboratory Exercise 1

Chapter 2: Hardware Design Flow Using Verilog in Quartus II

IMPLEMENTING COUNTERS

SignalTap II with Verilog Designs. 1 Introduction. For Quartus II 13.1

Physics 536 Spring Illustrating the FPGA design process using Quartus II design software and the Cyclone II FPGA Starter Board.

University of Massachusetts Amherst Computer Systems Lab 2 (ECE 354) Spring Lab 1: Using Nios 2 processor for code execution on FPGA

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 6: Quartus II Tutorial and Practice. Name: Date:

SFWR ENG 2DA4 Lab 1. Announcements: Marking Scheme: Lab Safety Manual:

DE2 Board & Quartus II Software

Lab 2: Introduction to Verilog HDL and Quartus

ENEE245 Digital Circuits and Systems Lab Manual

NIOS CPU Based Embedded Computer System on Programmable Chip

Introduction to the Altera SOPC Builder Using Verilog Design

CET4805 Component and Subsystem Design II. EXPERIMENT # 5: Adders. Name: Date:

Engineering 303 Digital Logic Design Spring 2017

University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering Revision 0 12-Jun-16

CHAPTER 1 INTRODUCTION... 1 CHAPTER 2 ASSIGN THE DEVICE... 7 CHAPTER 3 DESIGN ENTRY CHAPTER 4 COMPILE AND VERIFY YOUR DESIGN...

UNIVERSITI MALAYSIA PERLIS

Tutorial for Altera DE1 and Quartus II

EXPERIMENT 1. INTRODUCTION TO ALTERA

2 nd Year Laboratory. Experiment: FPGA Design with Verilog. Department of Electrical & Electronic Engineering. Imperial College London.

E85: Digital Design and Computer Engineering Lab 2: FPGA Tools and Combinatorial Logic Design

DKAN0011A Setting Up a Nios II System with SDRAM on the DE2

Introduction to the Altera SOPC Builder Using Verilog Designs. 1 Introduction

Laboratory Exercise 3 Comparative Analysis of Hardware and Emulation Forms of Signed 32-Bit Multiplication

SCHEMATIC DESIGN IN QUARTUS

Chip Design with FPGA Design Tools

DOWNLOADING DESIGNS TO THE ALTERA DE10-LITE FPGA

Digital Systems Laboratory

CSCB58 - Lab 0. Intro to The Lab & The DE2 Board. Prelab /4 Part I (in-lab) /1 Part II (in-lab) /1

1 Introduction 2. 2 Background 3. 3 Getting Started 4. 4 Starting a New Project 6. 5 Design Entry Using VHDL Code 13

University of Massachusetts Amherst Computer Systems Lab 1 (ECE 354) LAB 1 Reference Manual

CSEE W4840 Embedded System Design Lab 1

FPGA Development Board Hardware and I/O Features

Advanced Electronics Lab.

Contents. Appendix B HDL Entry Tutorial 2 Page 1 of 14

INTRODUCTION TO DE2 SYSTEM INTERFACES

University of Florida EEL 3701 Dr. Eric M. Schwartz Madison Emas, TA Department of Electrical & Computer Engineering Revision 1 5-Jun-17

The development board used in this class is ALTERA s DE The board provides the following hardware:

CSE P567 - Winter 2010 Lab 1 Introduction to FGPA CAD Tools

Tutorial 2 Implementing Circuits in Altera Devices

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180A DIGITAL SYSTEMS I Winter 2015

Altera DE1 Board DE1. Development and Education Board. User Manual. Copyright 2006 Altera Corporation

ECE241 - Digital Systems. University of Toronto. Lab #2 - Fall Introduction Computer-Aided Design Software, the DE2 Board and Simple Logic

EARTH PEOPLE TECHNOLOGY. ODIN-LINK BLE + MAXPROLOGIC Development System User Manual

AN 818: Static Update Partial Reconfiguration Tutorial

Experiment VERI: FPGA Design with Verilog (Part 1)

Name EGR 2131 Lab #6 Number Representation and Arithmetic Circuits

Standard Logic Chips and National Instruments ELVIS Breadboarding for Combinational Logic Circuits

CHAPTER 1 Introduction of the tnano Board CHAPTER 2 tnano Board Architecture CHAPTER 3 Using the tnano Board... 8

E85: Digital Design and Computer Architecture J. Spjut and R. Wang Spring 2014

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

Lab 3: Standard Combinational Components

Altera Quartus II Tutorial ECE 552

CPEN 230L: Introduction to Digital Logic Laboratory Lab #6: Verilog and ModelSim

The University of Toledo EECS:6660:0xxField Programmable Gate Arrays s09l1.fm - 1 Dr. A.D. Johnson

Laboratory Exercise 9

DE2 Function Library Manual

CSEE W4840 Embedded System Design Lab 1

COSC 3215 Embedded Systems Laboratory

EXPERIMENT NUMBER 7 HIERARCHICAL DESIGN OF A FOUR BIT ADDER (EDA-2)

CSEE W4840 Embedded System Design Lab 1

My First FPGA for Altera DE2-115 Board

PREFACE. Changes to the SOPC Edition

Lab 4: Register File and Memory 50 points Instructor: Yifeng Zhu Due: One week

AN 825: Partially Reconfiguring a Design on Intel Stratix 10 GX FPGA Development Board

EN2911X: Reconfigurable Computing Lecture 01: Introduction

Transcription:

CPE 200L LABORATORY 4: INTRODUCTION TO DE2 BOARD DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING UNIVERSITY OF NEVADA, LAS VEGAS GOALS: Getting familiar with DE2 board installation, properties, usage. Programming simple circuit using Altera Quartus. BACKGROUND: Altera s DE2 Development and Education Board has been developed to provide an ideal vehicle for learning about digital logic and computer organization in a laboratory setting. It uses the state-of-the-art technology in both hardware and CAD tools to expose students to a wide range of topics covered in typical courses. The power of the board is such that it is also highly suitable for a variety of design projects as well as for the development of sophisticated digital systems. In addition to the DE2 board and the associated software, Altera provides supporting materials that include tutorials, laboratory exercises, and interesting demonstrations [1]. The DE2 board features a powerful CycloneR II FPGA chip. All important components on the board are connected to the pins of this chip, allowing the user to configure the connection between the various components as desired. For simple experiments, the DE2 board includes a sufficient number of switches (of both toggle and pushbutton variety), LEDs, and 7-segment displays. For more advanced experiments, there are SRAM, SDRAM, and Flash memory chips, as well as a 16x2 character display. For experiments that require a processor and simple I/O interfaces, it is easy to instantiate Altera s Nios II processor and use interface standards such as RS-232 and PS/2. For experiments that involve sound or video signals, there are standard connectors provided on the board. For large design projects, it is possible to use USB and Ethernet connections, as well as the SD memory card. Finally, it is possible to connect other user-designed boards to the DE2 board by means of two expansion headers. Continue reading at http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_initialde2.pdf DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 1

SETTING UP DE2 BOARD: The following procedure configures DE2 on the PC computer. Please note, that for TBE-B350 and TBE-B311 labs, the effects of this procedure will disappear when you log out of lab station computer. You have to repeat the procedure at the start of each lab if you plan to work with DE2 board. 1. Plug the DC adapter 2. Connect board using USB to the PC computer. Remember to use leftmost connector 3. Click Start, right-click Computer and select Properties : DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 2

Click Device manager : You will see the list of devices, look for USB-Blaster, should be under the section Other devices : DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 3

Click Update driver : Use Browse my computer for driver software: DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 4

Browse to: C:\altera\71\quartus\drivers\usb-blaster\x64 After clicking Next, the following popup can appear: Answer Install this driver software anyway : DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 5

If the installation is successful, you should receive: DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 6

IMPLEMENTING SIMPLE PROJECT IN QUARTUS In this section, it is demonstrated how to put very simple circuit to the DE2 board. Inputs will be connected to switches, output will be connected to LED. DESIGN AN SIMULATING SCHEMATICS 1. Start Quartus II 7.1 Web Edition 2. Start new project wizard, enter the name of the project of: Click Next twice to go to the screen Family & Device Settings. Select the properties that are matching with your DE2 board. Take a look at the FPGA chip on the board to verify that below properties match with the ones you have: Family: Cyclone II Device: EP2C35F672C6 DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 7

Click Finish. 3. Go to File -> New and select Block Diagram/Schematic File: 4. Add XOR gate to schematics: DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 8

5. Use the same panel to add input and output pins, to get the following: Double click the pin to set its name (a, b for inputs, y for output). 6. Add simulation waveform file: go to File > New, choose Vector Waveform File: DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 9

7. Save your files. Go to Assignments -> Settings, choose Simulator Settings section. Set: Simulation mode: Functional Simulation input: your saved vector waveform file. 8. Run Processing -> Start Compilation and Simulation. Wait for the message about the end of the processing (Compile and Simulation was successful). 9. Run Processing -> Start -> Start Analysis & Synthesis. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 10

10. Go to wector waveform view, right click the area on the left and select Insert -> Insert Node or Bus Click Node Finder: DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 11

Set Filter: Pins: all, click List, then click >> to add three nodes 11. Right clicking on the input waveform allows setting values. Use it to set test values for simulation, selecting either Forcing High (1) or Forcing Low (0). DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 12

You should get: 12. Run Processing -> Generate Functional Simulation Netlist. 13. Start simulation: click Processing -> Start Simulation. You should get simulation results like below, confirming the operation of XOR gate: Now you are sure that your schematic works as expected, as the truth table for XOR function is verified: a b y Time 0 0 0 0 10ns 1 0 1 10ns 20ns 0 1 1 20ns 30ns 1 1 0 30ns 40ns The next step is to put your design to the board. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 13

PROGRAMMING DE2 BOARD 1. Assign pins. Go to Assignments -> Assignment Editor. 2. Set Category: Pin 3. Double click To field in row number 1. 4. Use the document Altera DE2 Board Pin Table http://faculty.unlv.edu/eelabs/docs/guides/de2_pin_table.pdf between pin and physical element on the board. We want to use: Switch SW0 as first input a Switch SW1 as second input b Red LED 0 as the output. to determine the relation In the Altera DE2 Board Pin Table document, we can see, that switch SW0 is connected to pin PIN_N25: Thus we fill the following fields: Use the Altera DE2 Board Pin Table document to determine the location of two remaining elements: b, and y. You should get: Compile your project. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 14

5. Make sure, that SW19 RUN/PROG switch is in the RUN position. 6. Select Tools -> Programmer. Click Hardware Setup and select USB-Blaster from dropdown list. Close window. 7. Ensure that Mode value is set to JTAG. 8. If SOF file is not present on the list, click Add file to add it. Make sure Program/Configure checkbox is checked. 9. Click Start and wait for the board to be programmed. Observe System Messages to see if programming process ended with success. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 15

The board is now programmed. Two switches serve as a, b inputs to the gate, while the logic state of the output y is signaled by red LED. For more information, refer to Altera s DE2 Board starting guide http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_quartus_intro_schem.pdf. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 16

CREATING A SYMBOL IN QUARTUS Quartus II software offers the possibility to create user defined elements. This simplifies the schematic design, as larger parts of the circuit can be represented as a block with inputs and outputs. Creating your own Full Adder block: 1. Create Full Adder circuit: 2. Compile your project 3. Create your element: go to File Create / Update Create Symbol Files for Current File. In the save dialog, put the name of new element, e.g. TestFA. After the process is done, the element can be selected from the list in Symbol Tool. Go to Windows Explorer and navigate to the folder that contains your project. You'll see TestFA.bsf file, that was created. This file contains the definition of your new symbol. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 17

When you type the name you gave to new element it will appear as any other element: Now it can be used in the schematic design. Double-clicking the element in the schematic, will show the inside design of your element. Using new element in another projects To use your element in another project, copy the file containing symbol definition (here: TestFA.bsf) and bdf file to the project directory. Then it will appear in the Symbol Tool. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 18

PROGRAMMING DE2 BOARD WITH VERILOG IN QUARTUS DE2 offers four 50MHz signals. The frequency of 50MHz can be brought down using the following procedure. Create a new project named onehertz. Now, instead of creating a new Block Diagram/Schematic File, choose Verilog HDL File. Copy and paste the onehertz.v code (shown below). After compilation, the steps are the same as when using a schematic entry. Map the input clk_50mhz to PIN_N2, which is a 50MHz clock internal to the DE2 board. Map the output clk_1hz to LEDG8. On the DE2 board, you should see the LED on for 0.5 seconds (period of 1 second for both on and off part of the cycle). module onehertz(clk_50mhz, clk_1hz); input clk_50mhz; output clk_1hz; reg clk_1hz; reg [24:0] count; always @ (posedge clk_50mhz) begin if(count == 24999999) begin count <= 0; $dumpfile("f.vcd"); clk_1hz <= ~clk_1hz; end else begin count <= count + 1; end end endmodule DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 19

TROUBLESHOOTING Quartus schematics: Compilation errors: o Make sure schematic does not contain any floating elements o Make sure that all input and output pins are connected to the elements No pins showing in node finder: o Make sure you have performed Compilation o Make sure you have performed Analysis & Synthesis Output signal changes with delay to input signals: o This is probably correct for Timing simulation. Probably you expect Functional simulation. Set that in Simulation Options. New symbol can t be found in other projects: o copy the file containing symbol definition (bsf file) and bdf file to the project directory. Then it will appear in the Symbol Tool. Programming the board: Quartus does not see the board: o Make sure that USB-Blaster is installed o Make sure that Windows device manager indicates that USB-Blaster device works properly o Make sure you connected USB cable to BLASTER port on the board Board is visible, but there are errors while programming the board: o Make sure that Family and Device values are set exactly to ones that you can read from FPGA chip on your board o Make sure that RUN/PROG switch is in RUN position LAB DELIVERIES: PRELAB: 1. Get familiar with Altera DE2 introduction documents Make yourself familiar with the following documents: Getting started with Altera DE2 Board: http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_initialde2.pdf Altera DE2 Introduction http://faculty.unlv.edu/eelabs/docs/guides/de2_introduction_box.pdf Altera DE2 User Manual http://faculty.unlv.edu/eelabs/docs/guides/de2_usermanuall.pdf Altera: Quartus II Introduction Using Schematic Design http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_quartus_intro_schem.pdf 2. Prelab deliveries Write few paragraphs about FPGA technology DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 20

LAB EXPERIMENTS: 1. Experiment 1: Configure DE2 board in Windows system Use the chapter Setting up DE2 board from this lab instruction to setup the DE2 board. Follow the section Implementing Simple Project In Quartus and implement the XOR gate on the DE2 board. Demonstrate working XOR to the TA. For more in depth features, and additional capabilities of Quartus see http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_quartus_intro_schem.pdf 2. 4-bit counter a) Create new project, draw the 4-bit counter given below. Connect A, B, C, and D to output pins that map to LEDR3, LEDR2, LEDR1, and LEDR0, respectively. Additionally, also connect A, B, C, and D to inputs of a 7447 decoder (which can be found in Quartus, see Figure below) There will be eight output pins for the 7447 decoder. To see how to map these pins to a seven segment display on the DE2 board see the Altera DE2 pin table https://faculty.unlv.edu/eelabs/docs/guides/de2_pin_table.pdf or the DE2 User Manual http://faculty.unlv.edu/eelabs/docs/guides/de2_usermanuall.pdf (pages 30-31). Note that the 7447 is only meant to display one digit, i.e. the range 0-9 of the counter. EXTRA CREDIT: Use two 7-segment displays to display the decimal value of the counter for the entire 0-15 range using two digits. Use additional logic gates to implement this feature. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 21

3. Creating symbols 1. Create Full Adder as your own symbol. 2. Use option: File Create symbol to create Full Adder as your own symbol (see section Creating a Symbol in Quartus in the introductory part of this document) 3. Use your symbol to create ripple carry adder: 4. Programming DE2 board with Verilog 1. Implement the frequency divider using Verilog (see the section Programming DE2 Board with Verilog in Quartus in the introductory part of this document. 2. Analyze the Verilog code answer TA: what type of sequential circuit is implemented in there? 3. Replace the value of 24,999,999 so that the LED is on for 0.25 seconds (period of 0.5 seconds for both on and off cycle). Use the formula count = (50MHz * LED_time_on) 1 4. Reprogram the FPGA with your modification to verify. What is the meaning of this replaced value? Experiment with some other values and write down the conclusions. DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 22

POSTLAB REPORT: Include the following elements in the report document: Section Element 1 Theory of operation Include a brief description of every element and phenomenon that appears during the experiments. 2 Prelab report Results of the experiments Experiment Experiment Results a. Screenshot of pin assignments 1 b. Picture of DE2 during operation a. Screenshot of pin assignments 2 b. Screenshot of schematic in Quartus 3 c. Picture of DE2 during operation a. Truth table 3 b. Screenshot of the FA schematic c. Screenshot of the Ripple Carry circuit a. screenshot of pin assignments 4 b. screenshot of your Verilog file with your modified count value Answer the questions Question no. Question 1 What is pin assignment in DE2? 4 When connecting LEDs in DE2 board, why resistors are not used in 2 schematic? What is the technical meaning of the value that controls the frequency division 3 in experiment 4? 5 Conclusions Write down your conclusions, things learned, problems met during the lab and how they were solved, etc. 6 Attachments Zip your projects. Send through WebCampus as zip, or provide link to the zip file to shared location List of attachments to deliver: 1. Your symbol files for FA 2. Project of Ripple Carry Adder 3. Project of counter 4. Project with Verilog code References: 1. DE2 pin table: http://faculty.unlv.edu/eelabs/docs/guides/de2_pin_table.pdf 2. Altera DE2 Introduction http://faculty.unlv.edu/eelabs/docs/guides/de2_introduction_box.pdf 3. Getting started with Altera DE2 Board: http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_initialde2.pdf 4. Altera: Quartus II Introduction Using Schematic Design http://faculty.unlv.edu/eelabs/docs/guides/de2_tut_quartus_intro_schem.pdf 5. Altera DE2 User Manual http://faculty.unlv.edu/eelabs/docs/guides/de2_usermanuall.pdf 6. Datasheets of 7400 series chips: http://faculty.unlv.edu/eelabs/index.html?navi=main_icdatasheets 7. Using DE2 oscillator: https://faculty.unlv.edu/eelabs/docs/guides/de2_oscillator.pdf DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING 23