COSC 3215 Embedded Systems Laboratory

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

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

Altera Quartus II Tutorial ECE 552

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

SCHEMATIC DESIGN IN QUARTUS

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

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

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

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

Tutorial on Quartus II Introduction Using Schematic Designs

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

Chapter 2 Getting Hands on Altera Quartus II Software

FPGA Introductory Tutorial: Part 1

Engineering 303 Digital Logic Design Spring 2017

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

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

QUARTUS II Altera Corporation

Tutorial on Quartus II Introduction Using Verilog Code

Tutorial 2 Implementing Circuits in Altera Devices

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

ECE 491 Laboratory 1 Introducing FPGA Design with Verilog September 6, 2004

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

Tutorial 3. Appendix D. D.1 Design Using Verilog Code. The Ripple-Carry Adder Code. Functional Simulation

QuartusII.doc 25/02/2005 Page 1

Xilinx Tutorial Basic Walk-through

Quartus II Introduction Using Schematic Design

A Beginner's Guide to MAX+plus II

Simulating a Design Circuit Using Qsim

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

EXPERIMENT 1. INTRODUCTION TO ALTERA

NIOS CPU Based Embedded Computer System on Programmable Chip

EE 231 Fall EE 231 Lab 2

Lab 2 EECE473 Computer Organization & Architecture University of Maine

Lab 2: Introduction to Verilog HDL and Quartus

Experiment VERI: FPGA Design with Verilog (Part 1)

UNIVERSITI MALAYSIA PERLIS

Quartus II Introduction Using Verilog Design

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

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

Laboratory Experiment Mastering Digital Design

University Program 3 Kit

Name EGR 2131 Lab #6 Number Representation and Arithmetic Circuits

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

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

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

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

Quick Tutorial for Quartus II & ModelSim Altera

TUTORIAL #2 HIERARCHICAL DESIGNS AND TEST FIXTURES

EET 1131 Lab #7 Arithmetic Circuits

TUTORIALS FOR MAX3000A CPLD DEVICES

EE 203 Supplement Package

Laboratory 4 Design a Muti-bit Counter

ENSC 350 ModelSim Altera Tutorial

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

Xilinx Schematic Entry Tutorial

Actel Libero TM Integrated Design Environment v2.3 Structural Schematic Flow Design Tutorial

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

Quartus. Tutorial. Programmable Logic Development System

Verilog Design Entry, Synthesis, and Behavioral Simulation

Using Synplify Pro, ISE and ModelSim

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

Programmable Logic Design I

EET2141 Project 2: Binary Adder Using Xilinx 7.1i Due Friday April 25

Altera Technical Training Quartus II Software Design

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

Using ModelSim to Simulate Logic Circuits for Altera FPGA Devices

Building Combinatorial Circuit Using Behavioral Modeling Lab

LAB 2: INTRODUCTION TO LOGIC GATE AND ITS BEHAVIOUR

and 32 bit for 32 bit. If you don t pay attention to this, there will be unexpected behavior in the ISE software and thing may not work properly!

ISim In-Depth Tutorial. UG682 (v13.4) January 18, 2012

CPLD Software Tutorial FOR ALTERA MAX+PLUS II

ISE Simulator (ISim) In-Depth Tutorial. UG682 (v 13.1) March 1, 2011

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.

Lab 3: Standard Combinational Components

Chip Design with FPGA Design Tools

Department of Electrical and Computer Engineering Xilinx ISIM <Release Version: 14.1i> Simulation Tutorial Using Verilog

ELEC 4200 Lab#0 Tutorial

MaxPlus II Tutorial with Basic Graphical Gate Entry and Simulation Obtaining the MaxPlus Software: Example Problem: Y = A*/B + /C

Vivado Tutorial. Introduction. Objectives. Procedure. Lab Workbook. Vivado Tutorial

Chapter 2: Hardware Design Flow Using Verilog in Quartus II

Terasic DE0 Field Programmable Gate Array (FPGA) Development Board

Tutorial for Altera DE1 and Quartus II

Tutorial - Using Xilinx System Generator 14.6 for Co-Simulation on Digilent NEXYS3 (Spartan-6) Board

2001 by X Engineering Software Systems Corp., Apex, North Carolina 27502

Using ModelSim to Simulate Logic Circuits in VHDL Designs. 1 Introduction. For Quartus II 13.0

NIOS CPU Based Embedded Computer System on Programmable Chip

Excel window. This will open the Tools menu. Select. from this list, Figure 3. This will launch a window that

Xilinx Vivado/SDK Tutorial

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

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

Tutorial: Pattern Wizard

A B A+B

Step 1: Downloading the source files

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

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

EE 1315 DIGITAL LOGIC LAB EE Dept, UMD

IMPLEMENTING COUNTERS

ELEC 204 Digital System Design LABORATORY MANUAL

EE 101 Lab 5 Fast Adders

Transcription:

COSC 3215 Embedded Systems Laboratory Lab 5 The Altera, Verilog and QuartusII Introduction This lab is an introduction to the Altera FPGA development board and the accompanying FPGA programming environment QuartusII. All software development will be carried out using the digital hardware description language Verilog. You can download a free version QuartusII from the following website https://www.altera.com/support/software/download/altera_design/quartus_we/dnl -quartus_we.jsp. Note you will have to get a license file prior to using QuartusII on your home computer. Specification Your task is use the laboratory Altera FPGA development board to implement a 4-bit Binary Coded Decimal (BCD) adder. The BCD adder must read the value of the FLEX_SWITCH dipswitch as two hexadecimal numbers with bits 7 through 4 representing one number, and bits 3 through 0 representing the other number, add these two numbers together and display the sum on the two digit 7-segment display. Hints The following predefined symbols are available to help simplify your task: DEC_SEG: Performs the binary to 7-segment decode operation. Reference Reading Altera UP2 Development Kit Users Guide Upds.pdf Introductory Verilog information. Ciletti (2003) Chapter 4, Appendices A-D Other possibilities include introductory digital logic texts such as Brown and Vranesic or Mano and Kine PreLab Determine what a BCDAdder is and implement one in Verilog according to the lab specifications. COSC3215 Lab5 Winter 2005 1

Procedure Make appropriate notes and answer all questions clearly in your lab book. Creating The Project 1. Launch the QuartusII application and create a new project entitled MyBCDAdder using the New Project Wizard using the File menu command. A tutorial on creating new projects is available in the online QuatrusII help section. 2. Directory, Name and Top-Level Entity [page 1 of 6]: Specify the working directory for your project using the browse button. 3. Name your project as MyBCDAdder and name the top level entity in your project as MyBCDAdder. 4. Add Files [page 2 of 6]: There are no files to add but you must specify a user library. Click the User Library Pathnames button and enter the library path c:\altera\quatrus41sp2\libraries\up1coreqii as the library name. Click next to continue. 5. EDA Tool Settings [page 3 of 6]: Ensure all the tool names are specified as <none>. Click next to continue. 6. Device Family [page 4 of 6]: Select the FLEX10K from the list of available device families. Ensure that you have answered yes to Do you want to assign a specific device? Click next to continue. 7. Select a Target Device [page 5 of 6]: Change the speed grade filter to Any and scroll down to the bottom of the list of available devices and select the EPF10K70RC240-4 device. Click Finish to continue. Adding Symbols and Blocks To Your Design 1. Create a new block design file using the File/New menu command. Select the Block Diagram/Schematic File under the Device Design Files tab and click OK. Save this file as MyBCDAdder.bsf. 2. Add the BCDAdder block to your design file by first selecting the Block Tool, located on the toolbar then positioning the cursor to a location within the Block Editor, clicking and holding the left mouse button and drawing a box. Release the left mouse button when you are finished. COSC3215 Lab5 Winter 2005 2

3. Select the Selection and Smart Drawing Tool, located on the toolbar and move the cursor over the block you just created. 4. Click the right mouse button and select the Block Properties option. 5. Rename the block to BCDAdder. 6. Click on the I/Os properties tab and enter all the input output connections to your BCDAdder. Click OK when you are done. 7. Still using the Selection and Smart Drawing Tool move the cursor away from the BCDAdder block and click the right mouse button. 8. Select the Insert/Symbol option. 9. Expand the c:/altera/quartus41sp2/libraries/ list and then further expand the UP1coreQII library. Select the DEC_7SEG symbol and click OK. 10. Drag the DEC_7SEG symbol to the location of your choice within the block editor window and click the left mouse button when you are done. 11. You will need two DEC_7SEG symbols so repeat steps 9 to 10. 12. Repeat steps 8 and 9. Expand the primitives/pin subdirectory in the library list and select the output symbol. Click OK when you are done. 13. Place the output pin somewhere to the right of one of the DEC_7SEG symbols, preferably in alignment with one of the segment outputs. 14. Repeat steps 12 and 13 for each of the segment outputs for both DEC_7SEG symbols. 15. Add one more output pin and place it somewhere above or below the DEC_7SEG symbols. This output pin will be used for simulation purposes. 16. Following the steps described above add two input pins and place these to the left of the BCDAdder block. Connecting Symbols and Blocks 1. Select the Selection and Smart Drawing Tool from the toolbar. 2. Place the cursor on the segment_a output pin of one of the DEC_7SEG symbols and click and hold the left mouse button. COSC3215 Lab5 Winter 2005 3

3. Draw a line/node connection to one of the output pins that you placed to the right of the DEC_7SEG symbol and release the left mouse button. 4. Repeat steps 1 through 3 for each of the segment outputs for both DEC_7SEG symbols. 5. Again still using the Selection and Smart Drawing Tool move the cursor over to one of the input pins and click and hold the left mouse button. 6. Draw a line to an edge of the BCDAdder block and release the left mouse button. 7. Repeat steps 5 and 6 for the second input pin. 8. Place the cursor on the hex_digit[3..0] input pin of one of the DEC_7SEG symbols. 9. Click and hold the let mouse button and draw a line over to the BCDAdder block symbol and release the left mouse button. 10. Place the cursor on the hex_digit[3..0] input pin of the other DEC_7SEG symbol. 11. Click and hold the left mouse button and move the cursor directly over the bus connection running between the BCDAdder and the other DEC_7SEG symbol and release the left mouse button. 12. Move the cursor over to the output connection that is to be used for simulation purposes and draw a bus connection over to the bus connecting the BCDAdder block and the DEC_7Seg symbols. Naming Pins and Connections 1. Using the Smart Selection Design Tool double click the default pin_name for the output pin connected to the segment_a output of the DEC_7SEG symbol that will display the ones digit of the BCDAdder output. 2. Enter Digit1_SegA as the name for this pin. Press Enter when you are done. 3. Name all the output pins in your design following the Digit1_Segx format. 4. Again using the Smart Selection Design Tool double click the default pin_name for one of the input pins in your design. COSC3215 Lab5 Winter 2005 4

5. The input pins, as they are intended in this design do not represent individual connections but multiple connections or busses and as such must be named differently. Type the name for your input pin as follows A[3..0]. The [3..0] specifies the number of signals and the order of significance. 6. Repeat step 5 for the second input pin naming it B[3..0]. 7. Using the Smart Selection Design Tool move the cursor directly over the Digit1 DEC_7SEG hex_digit[3..0] bus connection and click the right mouse button. 8. Select the Properties option and name this bus connection as Y[3..0] under the General properties tab. Click OK when you are done. 9. Using the Smart Selection Design Tool move the cursor directly over the Digit2 DEC_7SEG hex_digit[3..0] bus connection and click the right mouse button. 10. Select the Properties option and name this bus connection as Y[7..4] under the General properties tab. Click OK when you are done. 11. Using the Smart Selection Design Tool move the cursor directly over the bus connection at the BCDAdder block side and click the right mouse button. 12. Select the Properties option and name this bus connection as Y[7..0] under the General properties tab. Click OK when you are done. 13. Using the Smart Selection Design Tool move the cursor over the green <> symbol attached to the Y[7..0] bus connection and double click the left mouse button. 14. Under the General properties tab change the type to output. 15. Select the mappings properties tab and type Y[7..0] for the I/O on block. 16. Move the cursor over to the green <> symbol attached to the conduit connection between the A[3..0] input and the BCDAdder block and double click the left mouse button. 17. Set the type to input then select the Mappings property tab. 18. Select A[3..0] from the I/O on block list box. COSC3215 Lab5 Winter 2005 5

19. Select A[3..0] from the Signals in conduit list box and click Add. Click OK when you are done. 20. Repeat 16 through 19 for the B[3..0] input. 21. Check your schematic file for errors using the Processing/Analyze Current File menu command and remove any errors that you may have. Creating a Verilog Module From a Block Symbol 1. Select the Selection and Smart Drawing Tool from the toolbar and move the cursor somewhere inside the BCDAdder symbol. 2. Click the right mouse button and select the Create Design File from Selected Block option. 3. Select the Verilog HDL file type and click OK. 4. Edit the newly created Verilog file by placing your code for the BCD adder below the // {{ALTERA_IO_END}} DO NOT REMOVE THIS LINE! comment. 5. Check your Verilog code for errors using the Processing/Analyze Current File menu command and remove any errors that you may have. Building Your Project Now that al the pieces are in place it is time to build your project so you can first simulate the design and then when you are satisfied with the simulation you can program the Altera Development board with your design. 1. Select the Processing/Start Compilation menu command. 2. Investigate and remove any errors you may have. You may be able to ignore some or all the warning messages. Preparing for the Simulation When simulating the functionality of your BCDAdder it is important to know how fast your BCDAdder is, or what is the propagation delay between the input and output of your BCDAdder. The propagation delay can be measured simply by using the timing Analyzer Tool. Using the Timing Analyzer Tool 1. Select the Tools/Timing Analyzer menu command. 2. Click the Start button and wait for the analysis to complete. COSC3215 Lab5 Winter 2005 6

3. Select the tpd properties tab and record the slowest propagation delay time for your design. This value should be taken into consideration when implementing timing signals in your design simulation. Simulating Your BCDAdder 1. Open the Tools/Options menu command and select the Waveform Editor option. 2. Select the Extend file end time to fit all waveforms option in the When Inserting waveforms list of choices. 3. Change the default end time value to a value suitable to simulate all the possible combinations of A and B for your BCDAdder. Click OK when you are done. 4. Add a Vector Waveform File to your project using the File/New menu command. 5. Select the Other Files properties tab in the New dialog box and select the Vector Waveform File and click OK when you are done. 6. The Vector Waveform File should now be open. Move the cursor to the left windowpane of the Vector Waveform File and click the right mouse button. 7. Select the Insert Node or Busses option. 8. Click the Node Finder button. 9. Click the List button in the newly opened Node Finder window. 10. In the Nodes Found list select the A, B and Y nodes and add these to the. Click OK when you are done. 11. Click OK to close the Insert Node or Bus dialog box. 12. Move the cursor over to the windowpane listing the node names and left click on the A node. 13. With the cursor still over the selected node click the right mouse button and select the Value/Count Value option and click OK. 14. Change the radix: to hexadecimal. 15. Repeat steps 12 to 14 for the B input only do not click OK at the end of 14. COSC3215 Lab5 Winter 2005 7

16. Select the Timing properties tab and enter a suitable value for the Count every: value. Click OK. Note you are expected to simulate every possible combination of A and B. 17. Save this file as MyBCDAdder.wvf. 18. Open the Simulator Tool using the Tools/Simulator Tool menu command and click the Start button. 19. When the simulation process is finished click the Report button. 20. A window entitled Simulation Waveforms should open, if not then open the simulator waveforms window. 21. Determine if your BCDAdder is working by examining the displayed waveforms. What is the clock period for the A input? How does this compare to the propagation delay you measured earlier? 22. If you feel that the A input clock period is incorrect for your BCDAdder you can change the period by editing the A input waveform in the MyBCDAdder.vwf file. 23. Open the MyBCDAdder.vwf file. 24. Move the cursor over the windowpane listing the node names and left click on the A node. 25. Select the Value/Count Value option and click OK. 26. Click on the Timing properties tab and enter a suitable value for the Count every: parameter. Leave the units as nanoseconds, ns. Click OK when you are done. 27. Repeat steps 24 through 26 for the B node. Enter the same Count every: value you used for A node and enter 16 for the Multiplied by: parameter. Click Ok when you are done. 28. Simulate your design and determine if your BCDAdder is functioning properly by examining the simulation waveforms. 29. Did the changes you made help? If you are satisfied with the simulation results expand on the critical points and print out the simulation waveforms. COSC3215 Lab5 Winter 2005 8

Assigning Physical Device Pins Now that you have verified your design through the simulation process it is time to load it onto the Altera development board. 1. The first step is to assign physical device pins to all the I/O pins in your design. 2. Open the pin assignment window using the Assignments/Pins menu command. 3. De-select the Show assignments for specific nodes check box in the Node Filter section. 4. Select the Pin option under Locations in the Category section. 5. Double click on the Location column for node A[0] and scroll through the list and select PIN_41. 6. Consult the Upds.pdf file and repeat step 5 for all the other nodes in your design. Refer to Table 6. FLEX_SW1 Pin Assignments for the A and B inputs and Table 7.FLEX_DIGIT Segment I/O Connections for the seven-segment display. Programming the Altera Board 1. Consult the Upds.pdf file and verify the JTAG jumper settings are set to configure the FLEX 10K device only according to Table 2. JTAG Jumper Settings. 2. Select the Tools/Programmer menu option. 3. Verify that the Hardware Type is set to ByteBlasterMV(LPT1). 4. Click the Add File button and select the MYBCDAdder.sof file. 5. Check the Program/Configure programming option for the device chain. 6. When the programming cycle completes change the FLEX dipswitch setting and verify the functionality of your BCDAdder. 7. Make any design changes and repeat the simulation/programming part until you are satisfied with its performance. COSC3215 Lab5 Winter 2005 9

Lab Evaluation You must show the.v and.wdf files that you have created and also demonstrate how your waveforms verify the BCD adder to the lab demonstrator (note this means you must show convincing evidence that it works). All code and simulation results should be submitted to the submit directory using the submit command. COSC3215 Lab5 Winter 2005 10