FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Similar documents
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Design and Implementation of an AHB VGA Peripheral

Digilent Nexys-3 Cellular RAM Controller Reference Design Overview

Design and Implementation of SOC VGA Controller Using Spartan-3E FPGA

Lab 3: VGA Bouncing Ball I

TSIU03: Lab 3 - VGA. Petter Källström, Mario Garrido. September 10, 2018

VID_OVERLAY. Digital Video Overlay Module Rev Key Design Features. Block Diagram. Applications. Pin-out Description

Design and implementation (in VHDL) of a VGA Display and Light Sensor to run on the Nexys4DDR board Report and Signoff due Week 6 (October 4)

Design of VGA Controller using VHDL for LCD Display using FPGA

Spartan-II Development System

Lab Assignment 2 Simulation and Image Processing

Block Diagram. dw*3 pixin (RGB) pixin_vsync pixin_hsync pixin_val pixin_rdy. clk_a. clk_b. h_s, h_bp, h_fp, h_disp, h_line

Lab 6: Video Game PONG

EECS150 - Digital Design Lecture 12 - Video Interfacing. Recap and Outline

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

Field Programmable Gate Array (FPGA) Based Trigger System for the Klystron Department. Darius Gray

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

Laboratory 4. Figure 1: Serdes Transceiver

VGA Port. Chapter 5. Pin 5 Pin 10. Pin 1. Pin 6. Pin 11. Pin 15. DB15 VGA Connector (front view) DB15 Connector. Red (R12) Green (T12) Blue (R11)

Digital Blocks Semiconductor IP

VHDL Design and Implementation of FPGA Based Logic Analyzer: Work in Progress

EEM Digital Systems II

Programmable Logic Design I

Main Design Project. The Counter. Introduction. Macros. Procedure

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

VGA Controller. Leif Andersen, Daniel Blakemore, Jon Parker University of Utah December 19, VGA Controller Components

EE178 Spring 2018 Lecture Module 5. Eric Crabill

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

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

Authentic Time Hardware Co-simulation of Edge Discovery for Video Processing System

Lecture 14: Computer Peripherals

ECE532 Digital System Design Title: Stereoscopic Depth Detection Using Two Cameras. Final Design Report

EE178 Lecture Module 4. Eric Crabill SJSU / Xilinx Fall 2005

Main Design Project. The Counter. Introduction. Macros. Procedure

Week 5 Dr. David Ward Hybrid Embedded Systems

Snapshot. Sanjay Jhaveri Mike Huhs Final Project

T1 Deframer. LogiCORE Facts. Features. Applications. General Description. Core Specifics

EECS150 - Digital Design Lecture 13 - Project Description, Part 3 of? Project Overview

Testing Results for a Video Poker System on a Chip

FPGA TechNote: Asynchronous signals and Metastability

Lab # 9 VGA Controller

Spartan-II Development System

Video Graphics Array (VGA)

Block Diagram. pixin. pixin_field. pixin_vsync. pixin_hsync. pixin_val. pixin_rdy. pixels_per_line. lines_per_field. pixels_per_line [11:0]

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

LFSRs as Functional Blocks in Wireless Applications Author: Stephen Lim and Andy Miller

Radar Signal Processing Final Report Spring Semester 2017

Block Diagram. 16/24/32 etc. pixin pixin_sof pixin_val. Supports 300 MHz+ operation on basic FPGA devices 2 Memory Read/Write Arbiter SYSTEM SIGNALS

Design of a Binary Number Lock (using schematic entry method) 1. Synopsis: 2. Description of the Circuit:

1. Synopsis: 2. Description of the Circuit:

Contents Circuits... 1

Tutorial 11 ChipscopePro, ISE 10.1 and Xilinx Simulator on the Digilent Spartan-3E board

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

FPGA Development for Radar, Radio-Astronomy and Communications

Syed Muhammad Yasser Sherazi CURRICULUM VITAE

Design of VGA and Implementing On FPGA

DE2-115/FGPA README. 1. Running the DE2-115 for basic operation. 2. The code/project files. Project Files

CPE 329: Programmable Logic and Microprocessor-Based System Design

LogiCORE IP Video Timing Controller v3.0

Figure 1 Block diagram of a 4-bit binary counter

TV Character Generator

Experiment: FPGA Design with Verilog (Part 4)

FPGA Design with VHDL

LAB 3 Verilog for Combinational Circuits

ECE 270 Lab Verification / Evaluation Form. Experiment 9

AD9884A Evaluation Kit Documentation

EECS150 - Digital Design Lecture 10 - Interfacing. Recap and Topics

Fingerprint Verification System

L14: Quiz Information and Final Project Kickoff. L14: Spring 2004 Introductory Digital Systems Laboratory

OF AN ADVANCED LUT METHODOLOGY BASED FIR FILTER DESIGN PROCESS

OL_H264e HDTV H.264/AVC Baseline Video Encoder Rev 1.0. General Description. Applications. Features

FPGA Based Implementation of Convolutional Encoder- Viterbi Decoder Using Multiple Booting Technique

Traffic Light Controller

Checkpoint 1 AC97 Audio

COMPUTER ENGINEERING PROGRAM

Design and FPGA Implementation of 100Gbit/s Scrambler Architectures for OTN Protocol Chethan Kumar M 1, Praveen Kumar Y G 2, Dr. M. Z. Kurian 3.

IMS B007 A transputer based graphics board

Checkpoint 2 Video Encoder

FPGA-BASED EDUCATIONAL LAB PLATFORM

Laboratory Exercise 7

AC : DIGITAL DESIGN MEETS DSP

Sequential Circuit Design: Principle

StickIt! VGA Manual. How to install and use your new StickIt! VGA module

AbhijeetKhandale. H R Bhagyalakshmi

Design and analysis of microcontroller system using AMBA- Lite bus

GENERAL RULES FOR EE314 PROJECTS

EDA385 Bomberman. Fredrik Ahlberg Adam Johansson Magnus Hultin

Lab 5 FPGA Design Flow Based on Aldec Active-HDL. Fast Reflex Game.

C6845 CRT Controller Megafunction

INF4420 Project Spring Successive Approximation Register (SAR) Analog-to-Digital Converter (ADC)

L14: Final Project Kickoff. L14: Spring 2007 Introductory Digital Systems Laboratory

An FPGA Based Solution for Testing Legacy Video Displays

DIGITAL FUNDAMENTALS

OpenXLR8: How to Load Custom FPGA Blocks

Final Project [Tic-Tac-Toe]

2.6 Reset Design Strategy

Table of Contents Introduction

Asynchronous IC Interconnect Network Design and Implementation Using a Standard ASIC Flow

L14: Final Project Kickoff. L14: Spring 2006 Introductory Digital Systems Laboratory

Transcription:

FPGA Laboratory Assignment 4 Due Date: 06/11/2012 Aim The purpose of this lab is to help you understanding the fundamentals of designing and testing memory-based processing systems. In this lab, you will design memory units and their controllers, and use them to perform different types of processing such as matrix multiplications and video processing. Objectives Learn how to implement memory units using HDL Design memory controllers Memory data flow and synchronization Learn the basics of video display and timing Design a VGA controller and display an image on screen Equipment Xilinx ISE 12.XX ISE Simulator (Isim) Spartan 3E-16000 Development Board 1

Introduction The programmable logic boards used for ECE 408 are Xilinx Spartan 3E-1600 development systems. The centerpiece of the board is a Spartan 3 XC3S1600E FPGA (field-programmable gate array), which can be programmed via a USB cable or compact flash card. The board also features PS/2, serial, Ethernet, stereo audio and video ports, user buttons, switches and LEDS, and expansion ports for connecting to other boards Figure 1. The Xilinx Spartan 3E-1600 Development System Caution! The boards contain many exposed components that are sensitive to static electricity. Before touching the boards, try to remember to discharge any static electricity you may have built up by touching a grounded piece of metal (i.e. part of the desk). Especially remember to do this after you have been walking around the room on a carpeted floor (please keep your shoes on). 2

Part 1: Memory Controller Design In this lab, you are requested to design and implement a memory controller, to read and write data from an on-chip RAM that you will also create (see Appendix A for on-chip RAM implementation). The memory controller works by receiving request signals from a component, along with an associated address. The controller serves two types of requests, read and write. The memory controller also interfaces to the world with a data bus, which contains either data that is to be written on memory (when a write request is issued) or data that the memory will deliver in the event of a read request. You are to design your own memory controller. The memory controller should operate at least at 50Mhz (System Clock), and your data bus should be 64 bits wide. You may use Core Generator to generate any IP cores that you deem essential towards your design. The I/O interface to the controller consists of an address field (32 bits), the data field (64 bits), and the handshake signals you deem necessary for your assignment to work. You are free to design either a fully synchronous controller or a fully asynchronous controller, or even a hybrid version; however you need to show your work completely and in clear manner to receive full credit. Recall that a memory address can be partitioned into Row-Column bits, as explained in the undergraduate computer organization courses. An address field is separated into two sub-fields; the row selector and the column selector. For your assignment purposes, you need to be able to address at least 2 32 Bytes of memory. In order to test your controller, you need to write an ON-BOARD testbench; a design that reads and writes to a memory, checking that the data written is the data received. In contrast to previous testbenches, your testbench needs to be synthesizable so that it can be loaded to the FPGA itself. Therefore, you need to create a memory unit as well. Note that the memory unit you will create on-chip should be small enough to fit on the chip (16K is good). You still need to support up to 2 32 Bytes, but you do not need to test that many addresses. You can generate on-chip ram using Xilinx s Core Generator we will learn how in the lectures. 3

Start by designing a counter that generates memory addresses. Use a test value of interchangeable 1 s and 0 s (i.e. 01010101.01) to first write in even memory locations, and reverse the order of 1 s and 0 s for the odd locations (i.e. 101010 10). When the addressable memory is full, you need to start reading the values. You can either read from all memory locations, but that will be time consuming, hence you can choose randomly the addresses to read from. It is implied of course that the generated addresses should be directed towards the ON-CHIP memory you have designed, and not to the overall 2 32 Bytes! Consequently, you need to compare both odd and even addresses, to verify that data was written correctly in memory. You may use the LED s onboard for testing purposes. A significant portion of your assignment is your testing strategy. You have to document your testing strategy very well, and explain why you chose to test your controller in the manner you tested it, and how the test proceeded. Document these steps in your logbook, as you will report on them later on. For full credit, you need to show to your instructor your complete testing strategy and be prepared to answer questions about your choices. 4

Part 2: Memory Application In this part, you will put your memory controller to use. You will instantiate an FPGA memory block with data given to you individually from your instructor (when you complete PART A you need to email your instructor and he will email you your test data), and you are to use that data to utilize your microcontroller. You will first implement a simple matrix multiplication. You will be given a 4x100 matrix consisting of 8-bit positive integer values by your instructor/ta once you report that you completed Part 1. You are to instantiate the matrix in a READ-ONLY ROM memory block on your FPGA using VHDL to infer and initialize the memory (more on this in appendix A). Using those values, you are going to first transpose the matrix and store the Transposed matrix in the destination RAM. Recall that the transpose of a matrix A is another matrix A T (also written A tr, t A, or A ) created by any one of the following equivalent actions: write the rows of A as the columns of A T write the columns of A as the rows of A T reflect A by its main diagonal (which starts from the top left) to obtain A T Formally, the transpose of an m n matrix A is the n m matrix for If you stored the matrix in a raster scan fashion (i.e. from left to right, row-wise) in your ROM, you need to design a controller which reads data from the ROM in that fashion, and determines based on the location of the incoming value, the address which needs to be activated to store the transposed value in the destination RAM memory. At this point, your memory controller can be used to write the data in the destination RAM. When you have successfully completed the transpose operation, you have two matrices; the original stored in the ROM, and the Transpose, stored in the RAM. Multiply the two, by bringing data from the memory and by reading the data from the ROM. Recall that when you multiply a 4x100 matrix with a 100x4, the result is a 4x4 matrix. The resulting 4x4 matrix can be stored on the FPGA, in a new RAM location defined by you. When the result is calculated, you are to turn on all four LEDs on the board, and have them on for 5 seconds. You are required to use any 5

bits necessary for each matrix value, so take into consideration the possibility of having to add a sequence of several 16-bit values that result from each multiplication. You are to design a small system to shift the output sixteen 16-bit values (note that in case an individual value is more than 16-bits long, the low-order bits can be ignored in THIS step of this Part) on the board LEDs, in groups of four, based on the input combination that the user provides to the system using the 4 switches. For example, if the user wishes to see the value #14 (see below), then the LEDs start to display the value in groups of four bits at a time (from LSB to MSB), every 1 second. Hence, to display a 1001 0011 1010 0010, the first value displayed would be 0010, the second 1010, etc. When each value finishes, the LEDs go back to stay on for five seconds. Location Chart: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hence, to display location 0, the user would need to input 0000, and so on. When the five seconds pass, and the user does not change the input, the LEDs display the location that the switches are found. Note that in all cases, when the 5 seconds expire, the value displayed is for the location that the switches are set at that very moment. 6

Part 3: I/O Application A. VGA Controller Implementation In this part, you will design and implement a VGA controller to be used in the lab. A VGA controller receives as inputs from the system the video signal and system clock, and generates the Red/Green/Blue signals and the two synchronization signals, Horizontal and Vertical, which are sent to a VGA Monitor. A VGA Monitor can be thought of as a grid of pixels where each pixel is a picture element that can be set to a specific color. There are 480 rows and each row consists of 640 pixels. The VGA interface works serially, that is, color information for each respective pixel is sent one after the other, as opposed to all at once. The VGA timings are standardized, and are provided here for your reference: You are strongly advised to read chapter 6 from the Spartan-3E 1600E User Guide which can be found online on the labs website. VGA Timings The following table lists timing values for several popular resolutions. Pixel Horizontal (in Pixels) Vertical (in Lines) Format Clock (MHz) Active Video Front Porch Sync Pulse Back Porch Active Video Front Porch Sync Pulse Back Porch 640x480, 60Hz 640x480, 72Hz 640x480, 75Hz 25.175 640 16 96 48 480 11 2 31 31.500 640 24 40 128 480 9 3 28 31.500 640 16 96 48 480 11 2 32 7

640x480, 85Hz 800x600, 56Hz 800x600, 60Hz 800x600, 72Hz 800x600, 75Hz 800x600, 85Hz 1024x768, 60Hz 1024x768, 70Hz 1024x768, 75Hz 1024x768, 85Hz 36.000 640 32 48 112 480 1 3 25 38.100 800 32 128 128 600 1 4 14 40.000 800 40 128 88 600 1 4 23 50.000 800 56 120 64 600 37 6 23 49.500 800 16 80 160 600 1 2 21 56.250 800 32 64 152 600 1 3 27 65.000 1024 24 136 160 768 3 6 29 75.000 1024 24 136 144 768 3 6 29 78.750 1024 16 96 176 768 1 3 28 94.500 1024 48 96 208 768 1 3 36 Source: Rick Ballantyne, Xilinx Inc. We will be using the first row parameters for this assignment, which implies that your Pixel clock needs to be at 25.175Mhz (which you will generate from the system clock of 100Mhz) and the resolution will be at 640 Columns x 480 Rows. You can use the Digital Clock Management modules (DCM) provided with the Virtex II Pro FPGA to accurately you re your signals. Colors can be represented using a triplet consisting of the intensities of each fundamental color (Red, Green, Blue). The monitor expects 8

these values to be analog, and thus a DAC (Digital to Analog Converter) is used. Depending on the type of monitor and video card you use at home, your computer uses 16, 24, or 32 bits to encode this color information. For the assignment purposes, we will assume that we will be using 1 bit per color component of each pixel; hence the pixel will be total of 3 bits (1 for Red, 1 for Blue, and 1 for Green). An important fact to realize is that the VGA monitor does not have memory and thus will not store the pixel information being written to it. Instead, the pixels must be continuously sent to the display to achieve a stable image. The VGA controller needs to be receiving from the memory pixels and will be responsible for constantly sending out the pixel information. There are two signals that are used to maintain synchronization with the monitor: horizontal and vertical sync. These signals are active low (activated when the signal is logic 0). The timing for these signals is defined by the standards for VGA monitors. During a horizontal sync cycle, the pixel information is sent for all row (in our case 640) pixels followed by the lowering of the horizontal sync signal. The signal is used to coordinate the start of new lines. A vertical sync is achieved by lowering the vertical sync signal. The vertical sync instructs the monitor to return to the top of the screen (0,0). The horizontal sync cycle that follows becomes the first row on the screen. To familiarize yourself with VGA monitors, download and read the VGA Adapter reference article from the assignment website. There are also a couple of really handy websites that talk in detail about VGA adapters, and all provide code (both VHDL and Verilog) snippets which you may use in your assignment provided you give credit to the authors: http://www.eecg.utoronto.ca/~jayar/ece241_06f/vga/ http://www.stanford.edu/class/ee183/vga.shtml http://web.mit.edu/6.111/www/s2004/newkit/vga.shtml 9

The controller must take the pixels and the system clock as inputs from the FPGA, and generate the VGA output signals to drive a common VGA interface (i.e. the LCD monitors in the lab). Video Display In this part, you will use the RAM memory controller from Part A and the VGA controller together to output data from a memory to the VGA output. Start by generating a randomized 320x240 array of 3 bits per value (Red, Green, Blue). Each value represents a pixel, but in this part, we are not interested so much to the value, as getting our design to work. Use the table in Appendix B to see the bit values for different colors. Your array then needs to be stored in the RAM (use the controller from Part A) and then can be displayed with your VGA controller in a loop mode, by constantly incrementing the numbers in your array by a constant number (i.e. when the picture ends, you can loop back again to maintain a constant video output, and add one more intensity value to your array). The overall diagram of your system is shown below: Implement the integrated design and using a start button (place it in one of your switches) and see the output on the VGA. You can start by placing a single color in the entire picture, and then you can split the picture in two colors, three colors, and so on. 10

Extra Credit The top three designs in terms of the speed that the system operates, receive 5, 3 and 1 points extra credit. In order to speed-up your design, you can devise several tricks. You may explore pipelining, Core Generator parameters, etc. You can also map FPGA resources to the system, such as the multiplication to the on-chip multipliers, etc. Note that your system also contains several design exploration opportunities in the memory controller domain you have several bits in the data-bus (it does NOT have to be fully utilized during every word transfer!), which you are asked to utilize wisely for speedup improvements. To EARN those points you must indicate CLEARLY the speedup contributions of your design. Pure luck will not be considered extra credit. WARNING If there are two or more designs that have the same speed, and are within the top three, there will be NO extra credit. In other words, I want to see three CLEAR winners to give them points. 11

Turn-In Instructions Deliverables You are to submit a test strategy report for your Memory Controller testing strategy. The report should indicate clearly what testing methodologies you have chosen, and why they were selected, how they were applied and how you ensured that your design was functionally correct. The ISE project folder containing the code and simulation files for all parts, and a lab report will be submitted electronically through email (kyrkou.christos@ucy.ac.cy). Please use compression software to (winrar or 7zip) to keep the file size at a minimum. If the files are too large to be submitted via email please use the UCY file sending service https://filesender.ucy.ac.cy/filesender/. Please notify me in advance if you are going to delay delivering the lab Also consider You are advised to look at the tutorials posted on the lab web site for a more comprehensive overview and detailed explanation of the tools. You are encourage to visit the Xilinx user community forums (http://forums.xilinx.com/). The community forum enables Xilinx FPGA users to share, discuss, and resolve issues related to the Xilinx tools, HDL, FPGA programming and more. GOOD LUCK 12

Appendix A Memory Implementation You can see the VHDL syntax for implementing memories and initializing them by clicking on the language templates button, go to VHDL Synthesis Constructs Coding Examples RAM or ROM. There many different implementation options available such as dual port or single port. You are to select the ones that better suits your design and implementation strategies. Your rational for implementing the memories should be detailed in the report. 13

Appendix B VGA Display Pin Locations Table I: 3-bit display colour codes Table II: UCF Constraints for VGA signals VGA_Red VGA_Green VGA_Blue VGA_hsync VGA_vsync H14 H15 G15 F15 F14 14

Appendix C LEDs and Switches Pin Locations Figure 2. Switches and LEDs on the Spartan3E-1600 development board Table III: UCF Constraints for LEDs and Swiches LEDS Switches Leds_0 Leds_1 Leds_2 Leds_3 Leds_4 Leds_5 Leds_6 Leds_7 SW_0 SW_1 SW_2 SW_3 D4 C3 D6 E6 D13 A7 G9 A8 L13 L14 H18 N17 15