SENG 440 Slides Lesson 01

download SENG 440 Slides Lesson 01

of 21

Transcript of SENG 440 Slides Lesson 01

  • 7/25/2019 SENG 440 Slides Lesson 01

    1/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Lesson 1: Introduction

    Characteristics and design of embedded systems an introduction

    Quality & performance metrics measurable features of an ES implementation

    Processors for embedded systems

    Custom embedded processor design Comparison between ARM, Nios (Altera), MicroBlaze (Xilinx), 8051, 68HC11

    Emphasize on ARM Software optimization techniques

    What is wrong with plain software

    Prole driven compilation Efficient C programming

    38

  • 7/25/2019 SENG 440 Slides Lesson 01

    2/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Outline

    Embedded system denition

    Embedded systems common characteristics

    Examples of embedded systems

    The desktop computer (PC)

    Embedded system design process

    Formalisms for embedded system design

    Design metrics

    39

  • 7/25/2019 SENG 440 Slides Lesson 01

    3/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Embedded system denition

    Hard to dene . Nearly any computing system other than a desktop computer

    A device that includes a programmable computer but is not itself a general-

    purpose computer

    U.S. Supreme Court Justice Potter Stewarts famous quote about obscenity:

    I know it when I see it

    is a useful, if incomplete, guideline about embedded system.

    Despite the difficulty in strictly dening embedded system, an observer can

    usually tell when a subject is an embedded system based on a number of common characteristics

    40

  • 7/25/2019 SENG 440 Slides Lesson 01

    4/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Michael Barrs Embedded Systems Glossary

    An embedded system is a special-purpose computer system designed to performa dedicated function

    Unlike a general-purpose computer, an embedded system performs one or a fewpre-dened tasks, usually with very specic requirements, and often includestask-specic hardware and mechanical parts not usually found in a general-purpose computer

    Since the system is dedicated to specic tasks, design engineers can optimize it,reducing the size and cost of the product

    Embedded systems are often mass-produced, beneting from economies of scale.

    41

  • 7/25/2019 SENG 440 Slides Lesson 01

    5/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Embedded systems common characteristics

    Single-functioned : repetitive execution of a specic task

    Reactive and real time : continuously interaction with an environment, at a

    speed imposed by the environment Tightly constrained : very tight constraints on various design metrics

    Programmable, but usually not user programmable

    Usually low power , low size, and low weight

    Low cost

    An embedded system is not always a separate block - very often it is physicallybuilt-in to the device it is controlling

    42

  • 7/25/2019 SENG 440 Slides Lesson 01

    6/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Examples of embedded systems

    Simple appliances, such as washers and dryers

    An appliance for a computationally intensive task, such as laser printing

    A hand-held device, such as a cellular phone

    An industrial controller in a factory

    Telecommunications devices, such as modems

    A safety-critical controller, such as an anti-lock brake controller in a car

    43

  • 7/25/2019 SENG 440 Slides Lesson 01

    7/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    The desktop computer (PC)

    Provides medium performance for a large number of applications

    PC is user programmable, thus the end user can adapt it to do virtually anything

    Price is on the order of hundreds of dollars

    Size and weight (much) larger than the ES counterpart

    Power consumption is still signicant

    Operating systems running on PC are typically not real-time

    44

  • 7/25/2019 SENG 440 Slides Lesson 01

    8/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    The embedded world

    The programmer is exposed to hardware itself

    Floating-point operations are typically not supported in hardware

    Floating-point constructs translate into whole routines Fixed-point operations are highly recommended

    Data-level parallelism is typically supported in hardware

    Single Instruction Multiple Data (SIMD) Instruction-level parallelism may also be supported

    Pipelined processors

    Specialized computing blocks (peripherals) are widely used

    C language is the necessary evil

    45

  • 7/25/2019 SENG 440 Slides Lesson 01

    9/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Embedded system design process

    Encompasses different levels of abstraction : requirements, specication,structure, components, and system integration formalism is needed

    We seek for an implementation that fullls desired functionality design metrics We have to nd good and cheap solutions (not necessarily the best and the

    cheapest) in short time (not necessarily the shortest time)

    We have to look at the embedded systems from an engineering point of view :adapt existing projects, use previous experience, and do not reinvent the wheel

    We have to be able to speak a multitude of languages in order to describeefficiently the complex ordering and causality relations between the inputs andthe corresponding outputs

    46

  • 7/25/2019 SENG 440 Slides Lesson 01

    10/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Formalisms for embedded system design Why do we need a formalism for (embedded) system design?

    Different design tasks at different level of abstraction Usually is a complex task carried out by a heterogenous team

    The members of the team should speak the same (formal) language Unied Modeling Language (UML) (object-oriented)

    The design is described as a number of interacting objects, rather than a fewlarge monolithic blocks of code

    At least some of those objects will correspond to real pieces of hardware orsoftware in the system

    Since UML is a language, it can be used for other design tasks as well, e.g.,writing large software package

    Using UML rather than presenting UML is of interest for the course Youhave to read by yourselves: G. Booch, J. Rumbaugh, and I. Jacobson, The Unied Modeling Language User Guide , Addison-Wesley, 1999

    47

  • 7/25/2019 SENG 440 Slides Lesson 01

    11/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Design metrics

    Design metric = a measurable feature of a systems implementation

    Common design metrics:

    NRE cost Unit cost Size Performance Power consumption Flexibility

    Time-to-prototype Time-to-market Maintainability Correctness Safety ...

    More details in F. Vahid and T. Givargis, Embedded System Design: A Unied Hardware/Software Introduction , John Wiley & Sons 2001

    48

  • 7/25/2019 SENG 440 Slides Lesson 01

    12/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Design metrics (contd) Non-Recurring Engineering (NRE) cost

    One-time monetary cost of designing the system Once the system is designed, any number of units can be manufactured

    without incurring any additional design cost

    Example: NRE cost for printing a book includes the typesetting cost Time-to-market

    The time required to develop a system to the point that it can be released and sold to customers

    D

    W W

    Revenue

    Delay = DMarket window = 2W

    M a r k e

    t r i s e

    End of productlineopportunity

    marketBeginning of

    Percent Revenue Loss = D (3 W D )

    2W 2 100

    Example:W = 6 months and D = 2 monthPercent Revenue Loss = 45%

    49

  • 7/25/2019 SENG 440 Slides Lesson 01

    13/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Design metrics (contd)

    Performance and Flexibility

    Assume a computing engine that cannot meet the performance requirements Augment it with specialized computing units (e.g., MAC unit) Specialized computing unit(s) means lower exibility Balance between performance and exibility = fundamental trade-off in the

    design of a computing engine

    Power consumption

    Specialized computing unit(s) means lower number of instructions Lower number of instructions means use power for computation instead of

    instruction issuing

    Unit cost Specialized computing units need additional silicon area

    50

  • 7/25/2019 SENG 440 Slides Lesson 01

    14/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Design metrics (contd)

    There are so many design metrics

    The design task is actually an optimization problem in a multi-dimensional space

    Finding the optimum is a hot research/development area today

    Given a problem (requirements and design tools), nd the optimum solution Given a problem build the design tools

    Can the optimum solution be reached? For our course we will assume a linear cost function of design metrics:

    Cost function = K 1

    Performance +K 2

    Flexibility +K 3

    Power +...

    Modeling the system can be a complex task

    51

  • 7/25/2019 SENG 440 Slides Lesson 01

    15/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Performance metric Performance = how long the system takes to execute a task

    The most widely used design metric

    Two main measures of performance: Latency : the time between the start of the tasks execution and the end Throughput : the number of tasks that can be processed per unit time

    Speed-up : common method of comparing the performance of two systems:

    speed-up of A over B = speed of Aspeed of B

    To avoid confusion, say improve performance or improve execution time(latency) instead of increase performance and decrease execution time

    52

  • 7/25/2019 SENG 440 Slides Lesson 01

    16/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Firmware Terminology

    Firmware = executable software that is stored within a ROM

    The software written for embedded systems is often called rmware

    Not entirely correct

    The term rmware was originally used for micro-programs written for microsequencers.

    Later on, rmware was coined to indicate a functional replacement for hardwareon low cost microprocessors.

    Firmware can be thought of as semi-permanent since it remains the sameunless it is updated by a rmware updater.

    53

  • 7/25/2019 SENG 440 Slides Lesson 01

    17/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    What we learned

    Embedded systems are hard to dene

    Designing an embedded system is an engineering task

    Embedded systems design process includes different levels of abstraction

    A formalism for embedded systems design is most welcome

    Many design metrics put a high pressure on the design

    U.S. Supreme Court Justice Potter Stewarts quote about obscenity

    54

  • 7/25/2019 SENG 440 Slides Lesson 01

    18/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    About project Why ARM processor?

    It is widely used in embedded systems There is a large amount of software

    The ARM Company

    It does not manufacture processor chips It licenses an instruction set, that is, an architecture

    There are many vendors that provide ARM chips

    For ARM I can provide:

    Cross-compiler (runs on an Intel-Linux box, generates ARM-Linux executable) Simulator (runs on an Intel-Linux box)

    Installing and using Linux is recommended for all students

    55

  • 7/25/2019 SENG 440 Slides Lesson 01

    19/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    List of available projects My oppinion : the embedded systems market requires the following projects

    Color Space Conversion (RGB-to-YCC and YCC-to-RGB)

    Audio compression and decompression (A law, law) Discrete Cosine Transform and Inverse Discrete Cosine Transform Discrete Fourier Transform and Inverse Discrete Fourier Transform RSA Cryptography based on Montgomery Multiplication Matrix diagonalization and matrix inversion FIR and IIR ltering Hufmann encoding and decoding Motion estimation COordinate Rotation DIgital Computer (CORDIC)

    56

  • 7/25/2019 SENG 440 Slides Lesson 01

    20/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Project main goals Write C code that implements a specic task using strictly xed-point arithmetic

    Fixed-point arithmetic requires a little bit of attention

    Reduced dynamic range (example: with 8 bits we can represent at most 256different values, so that the entire world is shrinked to 256 values)

    Innity cannot be mapped to a nite value, therefore it is the programmerresponsibility to determine the largest value to be represented within aparticular precision

    Truncation and round-off errors should be of particular concern

    Augment the ARM standard instruction set with a new instruction

    Unfortunately, the compiler wont be able to detect the new instruction, andtherefore it is the programmer responsibility to explicitly instantiate the newoperation (for example, by means of assembly inlining constructs)

    57

  • 7/25/2019 SENG 440 Slides Lesson 01

    21/21

    SENG 440 Embedded Systems. Copyright c 2015 Mihai SIMA Lesson 1: Introduction

    Questions, feedbacks

    ?58