1 6-Performance Analysis of Embedded System Designs: Digital Camera Case Study (cont.)

Slides:



Advertisements
Similar presentations
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
Advertisements

Computer Abstractions and Technology
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
 Understanding the Sources of Inefficiency in General-Purpose Chips.
General information Course web page: html Office hours:- Prof. Eyal.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 7 Digital Camera Example.
1 Homework Turn in HW2 at start of next class. Starting Chapter 2 K&R. Read ahead. HW3 is on line. –Due: class 9, but a lot to do! –You may want to get.
Computational Astrophysics: Methodology 1.Identify astrophysical problem 2.Write down corresponding equations 3.Identify numerical algorithm 4.Find a computer.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 7 Digital Camera Example ECE 4330 Embedded System Design.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Introduction to Microprocessors Number Systems and Conversions No /6/00 Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
Microprocessor Systems Design I
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
1 Lecture 10: FP, Performance Metrics Today’s topics:  IEEE 754 representations  FP arithmetic  Evaluating a system Reminder: assignment 4 due in a.
Kathy Grimes. Signals Electrical Mechanical Acoustic Most real-world signals are Analog – they vary continuously over time Many Limitations with Analog.
Prepared by: Hind J. Zourob Heba M. Matter Supervisor: Dr. Hatem El-Aydi Faculty Of Engineering Communications & Control Engineering.
Development. Development Environment Editor Assembler or compiler Embedded emulator/debugger IAR Embedded Workbench Kickstart Code Composer Essentials.
1 CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2.
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
Computer Architecture ECE 4801 Berk Sunar Erkay Savas.
Computing Hardware Starter.
1 6-Performance Analysis of Embedded System Designs: Digital Camera Case Study.
1 3-Software Design Basics in Embedded Systems. 2 Development Environment Development processor  The processor on which we write and debug our programs.
Lecture#14. Last Lecture Summary Memory Address, size What memory stores OS, Application programs, Data, Instructions Types of Memory Non Volatile and.
© Krithi Ramamritham / Kavi Arya / S. Ramesh IIT Bombay 1 IT-606 Embedded Systems (Software) Embedded Applications Session -2 Kavi Arya Krithi Ramamritham.
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.
ACOE2511 ACOE251/AEEC335 -Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
Computer Systems Organization CS 1428 Foundations of Computer Science.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /14/2013 Lecture 16: Floating Point Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
Sogang University Advanced Computing System Chap 1. Computer Architecture Hyuk-Jun Lee, PhD Dept. of Computer Science and Engineering Sogang University.
8-1 Embedded Systems Fixed-Point Math and Other Optimizations.
10/19/2015Erkay Savas1 Performance Computer Architecture – CS401 Erkay Savas Sabanci University.
1 2-Hardware Design Basics of Embedded Processors (cont.)
Performance.
Introduction to FPGA Created & Presented By Ali Masoudi For Advanced Digital Communication Lab (ADC-Lab) At Isfahan University Of technology (IUT) Department.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 3 General-Purpose Processors: Software.
Chapter Six Sun SPARC Architecture. SPARC Processor The name SPARC stands for Scalable Processor Architecture SPARC architecture follows the RISC design.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
These notes were originally developed for CpSc 210 (C version) by Dr. Mike Westall in the Department of Computer Science at Clemson.
1 6-Performance Analysis of Embedded System Designs: Digital Camera Case Study (cont.)
1 QUIZ 1. Why hierarchy is needed to describe an embedded system? 2. Pros and Cons of asynchronous and synchronous communications in ES. 3. You are a PROJECT.
Introduction to Microprocessors
Chapter 7 Digital Camera Example
Stored Programs In today’s lesson, we will look at: what we mean by a stored program computer how computers store and run programs what we mean by the.
© GCSE Computing Computing Hardware Starter. Creating a spreadsheet to demonstrate the size of memory. 1 byte = 1 character or about 1 pixel of information.
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #2 – Digital Camera.
1 2-Hardware Design Basics of Embedded Processors.
1 Lecture 2: Performance, MIPS ISA Today’s topics:  Performance equations  MIPS instructions Reminder: canvas and class webpage:
The Instruction Set Architecture. Hardware – Software boundary Java Program C Program Ada Program Compiler Instruction Set Architecture Microcode Hardware.
Exploiting Instruction Streams To Prevent Intrusion Milena Milenkovic.
Embedded Systems (Software)
Copyright © 2005 – Curt Hill MicroProgramming Programming at a different level.
CS 1410 Intro to Computer Tecnology Computer Hardware1.
CHAPTER 2 Instruction Set Architecture 3/21/
1 6-Performance Analysis of Embedded System Designs: Digital Camera Case Study.
Embedded Real-Time Systems
Programmable Logic Devices
Microprocessor and Microcontroller Fundamentals
Computer Architecture & Operations I
Microprocessor Systems Design I
Microprocessor Systems Design I
Chapter 1: Introduction
Outline Introduction to a simple digital camera Designer’s perspective
COMP3221: Microprocessors and Embedded Systems
EE 445S Real-Time Digital Signal Processing Lab Spring 2014
CS/COE0447 Computer Organization & Assembly Language
Chapter 7 Digital Camera Example
Chapter 7 Digital Camera Example
Presentation transcript:

1 6-Performance Analysis of Embedded System Designs: Digital Camera Case Study (cont.)

2 Outline Introduction to a simple digital camera Designer’s perspective Requirements specification Design  Four implementations

3 Design Determine system’s architecture  Processors Any combination of single-purpose (custom or standard) or general-purpose processors  Memories, buses Map functionality to that architecture  Multiple functions on one processor  One function on one or more processors Implementation  A particular architecture and mapping  Solution space is set of all implementations Starting point  Low-end general-purpose processor connected to flash memory All functionality mapped to software running on processor Usually satisfies power, size, and time-to-market constraints If timing constraint not satisfied then later implementations could: use single-purpose processors for time-critical functions rewrite functional specification

4 Implementation 3: Microcontroller and CCDPP/Fixed-Point DCT 9.1 seconds still doesn’t meet performance constraint of 1 second DCT operation prime candidate for improvement  Execution of implementation 2 shows microprocessor spends most cycles here  Could design custom hardware like we did for CCDPP More complex so more design effort  Instead, will speed up DCT functionality by modifying behavior

5 DCT floating-point cost Floating-point cost  DCT uses ~260 floating-point operations per pixel transformation  4096 (64 x 64) pixels per image  1 million floating-point operations per image  No floating-point support with Intel 8051 Compiler must emulate Generates procedures for each floating-point operation  mult, add Each procedure uses tens of integer operations  Thus, > 10 million integer operations per image  Procedures increase code size Fixed-point arithmetic can improve on this

6 Fixed-point arithmetic Integer used to represent a real number  Constant number of integer’s bits represents fractional portion of real number More bits, more accurate the representation  Remaining bits represent portion of real number before decimal point Translating a real constant to a fixed-point representation  Multiply real value by 2 ^ (# of bits used for fractional part)  Round to nearest integer  E.g., represent 3.14 as 8-bit integer with 4 bits for fraction 2^4 = x 16 = ≈ 50 = (2^4) possible values for fraction, each represents (1/16) Last 4 bits (0010) = 2 2 x = (0011) = ≈ 3.14 (more bits for fraction would increase accuracy)

7 Fixed-point arithmetic operations Addition  Simply add integer representations  E.g., = → 50 = → 43 = = 93 = (0101) + 13(1101) x = ≈ 5.85 Multiply  Multiply integer representations  Shift result right by # of bits in fractional part  E.g., 3.14 * 2.71 = * 43 = 2150 = >> 4 = (1000) + 6(0110) x = ≈ Range of real values used limited by bit widths of possible resulting values

8 Fixed-point implementation of CODEC COS_TABLE gives 8-bit fixed-point representation of cosine values 6 bits used for fractional portion Result of multiplications shifted right by 6 void CodecDoFdct(void) { unsigned short x, y; for(x=0; x<8; x++) for(y=0; y<8; y++) outBuffer[x][y] = F(x, y, inBuffer); idx = 0; } static const char code COS_TABLE[8][8] = { { 64, 62, 59, 53, 45, 35, 24, 12 }, { 64, 53, 24, -12, -45, -62, -59, -35 }, { 64, 35, -24, -62, -45, 12, 59, 53 }, { 64, 12, -59, -35, 45, 53, -24, -62 }, { 64, -12, -59, 35, 45, -53, -24, 62 }, { 64, -35, -24, 62, -45, -12, 59, -53 }, { 64, -53, 24, 12, -45, 62, -59, 35 }, { 64, -62, 59, -53, 45, -35, 24, -12 } }; static const char ONE_OVER_SQRT_TWO = 5; static short xdata inBuffer[8][8], outBuffer[8][8], idx; void CodecInitialize(void) { idx = 0; } static unsigned char C(int h) { return h ? 64 : ONE_OVER_SQRT_TWO;} static int F(int u, int v, short img[8][8]) { long s[8], r = 0; unsigned char x, j; for(x=0; x<8; x++) { s[x] = 0; for(j=0; j<8; j++) s[x] += (img[x][j] * COS_TABLE[j][v] ) >> 6; } for(x=0; x > 6; return (short)((((r * (((16*C(u)) >> 6) *C(v)) >> 6)) >> 6) >> 6); } void CodecPushPixel(short p) { if( idx == 64 ) idx = 0; inBuffer[idx / 8][idx % 8] = p << 6; idx++; }

9 Implementation 3: Microcontroller and CCDPP/Fixed-Point DCT Analysis of implementation 3  Use same analysis techniques as implementation 2  Total execution time for processing one image: 1.5 seconds  Power consumption: watt (same as 2)  Energy consumption: joule (1.5 s x watt) Battery life 6x longer!!  Total chip area: 90,000 gates 8,000 less gates (less memory needed for code)

10 Implementation 4: Microcontroller and CCDPP/DCT Performance close but not good enough Must resort to implementing CODEC in hardware  Single-purpose processor to perform DCT on 8 x 8 block 8051 UARTCCDP P RAM EEPROM SOC CODEC

11 CODEC design 4 memory mapped registers  C_DATAI_REG/C_DATAO_REG used to push/pop 8 x 8 block into and out of CODEC  C_CMND_REG used to command CODEC Writing 1 to this register invokes CODEC  C_STAT_REG indicates CODEC done and ready for next block Polled in software Direct translation of C code to VHDL for actual hardware implementation  Fixed-point version used CODEC module in software changed similar to UART/CCDPP in implementation 2 static unsigned char xdata C_STAT_REG _at_ 65527; static unsigned char xdata C_CMND_REG _at_ 65528; static unsigned char xdata C_DATAI_REG _at_ 65529; static unsigned char xdata C_DATAO_REG _at_ 65530; void CodecInitialize(void) {} void CodecPushPixel(short p) { C_DATAO_REG = (char)p; } short CodecPopPixel(void) { return ((C_DATAI_REG << 8) | C_DATAI_REG); } void CodecDoFdct(void) { C_CMND_REG = 1; while( C_STAT_REG == 1 ) { /* busy wait */ } } Rewritten CODEC software

12 Implementation 4: Microcontroller and CCDPP/DCT Analysis of implementation 4  Total execution time for processing one image: seconds (well under 1 sec)  Power consumption: watt Increase over 2 and 3 because SOC has another processor  Energy consumption: joule (0.099 s x watt) Battery life 12x longer than previous implementation!!  Total chip area: 128,000 gates Significant increase over previous implementations

13 Summary of implementations Implementation 3  Close in performance  Cheaper  Less time to build Implementation 4  Great performance and energy consumption  More expensive and may miss time-to-market window If DCT designed ourselves then increased NRE cost and time-to-market If existing DCT purchased then increased IC cost Which is better?

14 Summary Digital camera example  Specifications in English and executable language  Design metrics: performance, power and area Several implementations  Microcontroller: too slow  Microcontroller and coprocessor: better, but still too slow  Fixed-point arithmetic: almost fast enough  Additional coprocessor for compression: fast enough, but expensive and hard to design  Tradeoffs between hw/sw – the main lesson of this course!