CSCE 313: Embedded Systems Final Project Instructor: Jason D. Bakos.

Slides:



Advertisements
Similar presentations
UNC Pixel Planes designed by Prof. Henry Fuchs et al.
Advertisements

1 RTL Example: Video Compression – Sum of Absolute Differences Video is a series of frames (e.g., 30 per second) Most frames similar to previous frame.
Sumitha Ajith Saicharan Bandarupalli Mahesh Borgaonkar.
Avalon Switch Fabric. 2 Proprietary interconnect specification used with Nios II Principal design goals – Low resource utilization for bus logic – Simplicity.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
CSCE 313: Embedded Systems Scaling Multiprocessors Instructor: Jason D. Bakos.
CSCE 313: Embedded Systems Performance Counters Instructor: Jason D. Bakos.
Data Representation Computer Organization &
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
CSCE 313: Embedded Systems Video Out and Image Transformation Instructor: Jason D. Bakos.
Computer Hardware What goes on inside?. Deeper.
Programming I/O for Embedded System. Page 2 Overview Basis: A DE2 Computer Architecture Parallel I/O 7-Segment Display Basic Manipulating 7-Segment Display.
Floating Point Numbers
CSCE 313: Embedded Systems Multiprocessor Systems
ARM C Language & Assembler. Using C instead of Java (or Python, or your other favorite language)? C is the de facto standard for embedded systems because.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
Dr. Kimberly E. Newman Hybrid Embedded wk3 Fall 2009.
OS Implementation On SOPC Final Presentation
CS110: Computers and the Internet Color and Image Representation.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Maths with letters!. 12, 6, 2, 3.14, 22,317, -6, 123 Constants (Don’t Change) x, y, z, a, b, c Variables (Unknown Numbers)
USB host for web camera connection
Lab 2: Capturing and Displaying Digital Image
Color Names All standards-compliant browsers should handle these color names These color names can be used with the CSS properties of color and background-color.
Computer Systems Nat 4.5 Computing Science Data Representation Lesson 4: Storing Graphics EXTENSION.
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
OS Implementation On SOPC Midterm Presentation Performed by: Ariel Morali Nadav Malki Supervised by: Ina Rivkin.
Project Goals 1.Get to know Quartus SoPC builder environment 2.Stream 2.Stream Video 3.Build 3.Build foundation for part B - Tracking system.
Fixed-Point Arithmetics: Part II
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Fundamental of Computer Architecture By Panyayot Chaikan November 01, 2003.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
UNC Pixel Planes designed by Prof. Henry Fuchs et al.
ECEG-3202: Computer Architecture and Organization, Dept of ECE, AAU 1 Floating-Point Arithmetic Operations.
8-1 Embedded Systems Fixed-Point Math and Other Optimizations.
Multimedia Technology Image Technology Krich Sintanakul Multimedia and Hypermedia.
CSCE 212 Review for Exam 1 Instructor: Jason D. Bakos.
Lecture12. Outline Binary representation of integer numbers Operations on bits –The Bitwise AND Operator –The Bitwise Inclusive-OR Operator –The Bitwise.
NIOS II Ethernet Communication Final Presentation
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
Lab 2 Parallel processing using NIOS II processors
Part A Final Dor Obstbaum Kami Elbaz Advisor: Moshe Porian August 2012 FPGA S ETTING U SING F LASH.
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Representation of Data (Part II) Computer Studies Notes: chapter 19 Ma King Man.
Lecture 11 Text mode video
More Digital Representation Discrete information is represented in binary (PandA), and “continuous” information is made discrete.
Instructions to build HIBI_PE_DMA testing system (SOPC+NIOS II Eclipse) Lasse Lehtonen Last modification:
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
TFT-LCD Display + Camera
Lab 4 HW/SW Compression and Decompression of Captured Image
CSCE 313: Embedded Systems Final Project Notes
Instructor: David Ferry
Addendum to Chap 2 and Chap 3
Progress Report Chester Liu 2013/11/29.
COMP3221: Microprocessors and Embedded Systems
Floating Point Math, Fixed-Point Math and Other Optimizations
SOPC DE10-Lite Basic Computer Parallel port
Data Representation Bits
Low cost FPGA implimentation of tracking system from USB to VGA
Computer Systems Nat 4.5 Computing Science Data Representation
Operations and Arithmetic
CSCE 313: Embedded Systems Final Project
CSCE 313: Embedded Systems Scaling Multiprocessors
CSCE 313: Embedded Systems Performance Analysis and Tuning
Presentation transcript:

CSCE 313: Embedded Systems Final Project Instructor: Jason D. Bakos

Final Project Objective: –Begin with Lab 5 –Convert all floating-point computations to fixed-point –Increase resolution to 1024 x 768 Use fixed-point representation for: –z –c –min_x, max_x, min_y, max_y –x 2 +y 2 (for checking for divergence) CSCE 313 2

Fixed-Point Review Recall: fixed-point has fixed range –Recall: Range of non-fixed-point n-bit integer: -2 n-1 <= val <= 2 n-1 -1 –Range of signed (n,m) value: -2 n-m-1 <= val <= 2 n-m-1 – 2 -m –Need to decide where to set decimal point For c, [min|max]_[x|y]: –Need to represent values from -2 to 2 –z should cover the worst case for a diverged pixel x 2 +y 2 should cover the worst case for the r 2 of a diverged pixel CSCE 313 3

Worst Case Analysis CSCE (2,0) (0,2) (1.4,1.4) zz2z2 cP(z)x 2 +y 2 LH bits (0,2)(4,0)(2,2)(6,2)406 (0,2)(4,0)(2,2)(6,2)406 (2,0)(4,0)(2,2)(6,2)406 (2,0)(4,0)(2,2)(6,2)406 (1.4,1.4)(0,3.9)(2,2)(2,5.9)38.86

Range and Precision Problem: –Multiply (32,n) val with (32,m) val => (64,n+m) val Need a way to get 64-bit product, or we lose the upper 32 bits CSCE 313 5

Multiply CSCE A1A0 B1B0 Assume 4-bit registers, need 8 bit product: x = A0*B0 (4b) A0*B1 (4b) A1*B0 (4b) A1*B1 (4b) *2=6 3*3=9 -> 9*4=36 2*2=4 -> 4*4=16 2*3=6 -> 6*16=96 = 154

Example Fixed Point Multiply Multiply A = (32,n) val and B = (32,n) val, need C = (32,n) product: –Declare A and B as “long” –Declare C as “long long” –Cast A and B as “long long”, –C = (long long)A * (long long)B; –Convert C from (64,2*n) to (32,n): Shift C n bits to the right –Return C as int CSCE 313 7

High Resolution Goal: Increase resolution from 320x240 to 1024x768 Problems: –Native resolution of VGA Controller is 640x480, so hardware modification is needed –SRAM is only 512 KB, not large enough to store a higher resolution frame, so we need to move pixel buffer to SDRAM CSCE 313 8

Hardware Modification Remove SRAM interface, connect DMA controller master interface directly to SDRAM Remove rescaler (no longer needed) Change DMA controller settings to 1024x768 Each time you generate in SOPC Builder, must make edits to two generated Verilog files CSCE 313 9

Hardware Modification VGA Controller Verilog file, line 78 (after each generation): parameter CW= 9; parameter DW= 29; parameter R_UI= 29; parameter R_LI= 20; parameter G_UI= 19; parameter G_LI= 10; parameter B_UI= 9; parameter B_LI= 0; /* Number of pixels */ parameter H_ACTIVE = 640; parameter H_FRONT_PORCH= 16; parameter H_SYNC= 96; parameter H_BACK_PORCH = 48; parameter H_TOTAL = 800; /* Number of lines */ parameter V_ACTIVE = 480; parameter V_FRONT_PORCH= 10; parameter V_SYNC= 2; parameter V_BACK_PORCH = 33; parameter V_TOTAL= 525; parameter NUMBER_OF_BITS_FOR_LINES= 10; parameter LINE_COUNTER_INCREMENT= 10'h001; parameter NUMBER_OF_BITS_FOR_PIXELS= 10; parameter PIXEL_COUNTER_INCREMENT= 10'h001; CSCE parameter CW= 9; parameter DW= 29; parameter R_UI= 29; parameter R_LI= 20; parameter G_UI= 19; parameter G_LI= 10; parameter B_UI= 9; parameter B_LI= 0; /* Number of pixels */ parameter H_ACTIVE = 1024; parameter H_FRONT_PORCH= 24; parameter H_SYNC= 136; parameter H_BACK_PORCH = 160; parameter H_TOTAL = 1344; /* Number of lines */ parameter V_ACTIVE = 768; parameter V_FRONT_PORCH= 3; parameter V_SYNC= 6; parameter V_BACK_PORCH = 29; parameter V_TOTAL= 806; parameter NUMBER_OF_BITS_FOR_LINES= 11; parameter LINE_COUNTER_INCREMENT= 11'h001; parameter NUMBER_OF_BITS_FOR_PIXELS= 11; parameter PIXEL_COUNTER_INCREMENT= 11'h001;

Hardware Modification Clocks Verilog file, line 69 (after each generation): parameter SYS_CLK_MULT= 1; Change to: parameter SYS_CLK_MULT= 2; Line 174: DE_Clock_Generator_System.clk2_divide_by= 2, DE_Clock_Generator_System.clk2_duty_cycle= 50, DE_Clock_Generator_System.clk2_multiply_by= 1, Change to: DE_Clock_Generator_System.clk2_divide_by= 7, DE_Clock_Generator_System.clk2_duty_cycle= 50, DE_Clock_Generator_System.clk2_multiply_by= 9, CSCE

Software Modification Change the PIXEL BUFFER DMA and RESAMPLER from 24-bit color to 16-bit color –color = ((red<<11) & 0xF800) | ((green<<5) & 0x07E0) | (blue & 0x00FF) New pixel buffer requires 1024x768x2 = bytes –Allocate in CPU0 –Give 3.5 MB to CPU0, 1.5MB each for CPUs 1-3 Allocate in SDRAM (as a global variable): #ifdef MASTER // define this in Eclipse project settings for CPU0 volatile alt_u8 pixel_buffer_memory[ ]; // 768x1024x3 #endif Add –DMASTER in cpu0’s project settings under Nios II Application Properties CSCE

#define CSCE

Software Modifications Copy address of only one processor’s buffer to the DMA controller for F/B buffer (in main()): alt_up_pixel_buffer_dma_change_back_buffer_address(my_pixel_buffer,(unsigned int)pixel_buffer_memory); alt_up_pixel_buffer_dma_swap_buffers(my_pixel_buffer); while (alt_up_pixel_buffer_dma_check_swap_buffers_status(my_pixel_buffer)); alt_up_pixel_buffer_dma_change_back_buffer_address(my_pixel_buffer,(unsigned int)pixel_buffer_memory); Subsequent writes to buffer using address stored in DMA controller will write the same buffer –This is because pointer is stored in global location Avoid divide: add a fixed-point constant for (1/768) and (1/1024) and multiply these CSCE

More Tips In SOPC Builder, change the clock for the SDRAM controller from "sdram_clk" to "sys_clk“ In Quartus, create a new file called lights.sdc with the following contents and add it to your project: create_clock CLOCK_50 -period 20 derive_pll_clocks -create_base_clocks CSCE