Introduction to Real Time Embedded Systems

Embed Size (px)

Citation preview

  • 7/28/2019 Introduction to Real Time Embedded Systems

    1/49

  • 7/28/2019 Introduction to Real Time Embedded Systems

    2/49

    2

    Lecture Plan

    Program Information:

    Program organization

    Recommended literature

    Introduction to RT embedded systems

    What is an RT Embedded System

    RT Embedded Systems Design Industry and

    Applications

  • 7/28/2019 Introduction to Real Time Embedded Systems

    3/49

    3

    Course Organization

  • 7/28/2019 Introduction to Real Time Embedded Systems

    4/49

    4

    Time, Location etc

    1. Lectures days and time:

    Every Thursday

    From 18.00 to 22.00 (be at time)

    2. Course duration - ~6 months [bruto], about 250 ac. Hours(frontal and for the project design).

    3. Address: Ramat Gan, 7 Aba Hilel str., floor 15

    1. Parking for free options: Yazira and Ahaliav str. (100-200m fromCDC)

  • 7/28/2019 Introduction to Real Time Embedded Systems

    5/49

    5

    Programs Grades Structure

    Final grade structure:

    Project 40% from the semester grade

    Each project includes the Design Specs and the DesignEnvironment

    Exam 60% from the semester grade

    Each exam is in American Style (multiple choice) and closed books

    The minimum required exams and projects grade is: 65.

    The required course average is: 70.

  • 7/28/2019 Introduction to Real Time Embedded Systems

    6/49

    6

    Study and Help with Job Search Plan

    The Course milestones are the Project milestones: MRD, Kickoff, PDR, CDR, FDR and final exam

    CV Design - Very effective and professional help

    Coaching for successful career building Time and project management

    Career planning and Job search plan design.

    Project FDR with Senior Designers from High Tech companies Diploma, Recommendations and Individual meetings for successful jobsearch etc: CV/Linkedin Profile Design

    Job search plan design

    Technical Interview Simulation

  • 7/28/2019 Introduction to Real Time Embedded Systems

    7/49

    7

    Course rules

    Work with slides questions, comments

    Study environment at home

    Weekly Back up

    Course Forum

    Documents and code style Design reviews and final submission.

    Homework assignments, which will be done individually or in groups.

    ** The main target of the course is making the students mature enough in VLSI

    Design for the industry. Help yourself using internet forums and onlinedocumentation.

    ** Students get certificate if stand successfully in course requirements.

    - Every one will get the tools for working from home, plus 1 evaluation boardfor design group.

  • 7/28/2019 Introduction to Real Time Embedded Systems

    8/49

    8

    Evaluation Board for Real Project design

  • 7/28/2019 Introduction to Real Time Embedded Systems

    9/49

    9

    Ev. Board for Real Project design cont.

  • 7/28/2019 Introduction to Real Time Embedded Systems

    10/49

    10

    Copyright 2005 AVMBrothers Ltd.

    10

    Semester A Firmware Design

    (RT Emb. Systems Design)

    Introduction to the Program:- Program fundamentals: rules, material and work environment

    - Embedded systems market overview and Job search planning

    Introduction to RT Embedded Systems:

    - RT Embedded Systems Overview real time constrains- Design Process- Requirements and Specifications- Architecture Design

    Embedded System Architecture

    - Modern Embedded Systems Architecture Overview- CISC/RISC/DSP Processors Overview (Focused on ARM)

    Memory System and I/O sub-system Architectures- Bus Protocols Organization (AMBA, APB, AHB, etc.)

    Programming Embedded Systems

    - C for RT Emb. Design Brief on Programming language at real time environment- Introduction to Compile and Debug tools

    - Source control and Bug tracking tools overview

  • 7/28/2019 Introduction to Real Time Embedded Systems

    11/49

    11

    Copyright 2005 AVMBrothers Ltd.

    11

    Semester A (part2) Firmware Design

    Designing Embedded Computing Platform- Boot programming- Memory Devices and their Characteristics- RAM, ROM, UVROM, EEPROM, DRAM, FLASH- I/O Devices/ Timers and Counters- Clock management (PLL/CPLD, oscillators)- IC/DMA/IR Devices-A/D,D/A, Serial/Parallel interfaces

    Reference RT Embedded System Design Project Overview.First RT Embedded System Design Project Start: Kick off and PDR (Preliminary Design Review)

    RT Emb. Working Environment

    - Development Environment and Basic IDE concepts- Projects management and Workspaces

    - Manufacturing and Testing

    Coaching Part 1: Life targets and career planning

    Ref RT Emb. Project Code Review- Program Design- Design Patterns for Embedded Systems emphasis on specific issues for RT- Models of Program- Control and Data flow Graph- Programming and Run-time Environment- Analysis and Optimization of Execution Time/Energy, Power/Program Size

    - Program Validation and TestingFirst RT Embedded Design Project Design Reviews: CDR and FDR (Critical and Final Design Reviews).

    Semester A exam RT Embedded Designer Evaluation Exam (Basic Stage).

  • 7/28/2019 Introduction to Real Time Embedded Systems

    12/49

    12

    Copyright 2005 AVMBrothers Ltd.

    12

    Semester B Emb. Systems Design with Emb. Linux

    CPU and HW overview

    - Support for various processors (ARM, MIPS etc) by Linux.

    Registers, busses, interrupts, memory subsystem

    Linux introduction, system calls

    - Overview of Linux; GPL; userspace code uses kernel services

    Processes, threads

    - Process concept; lifetime; implementation, stacks; usage; priorities

    RT vs. others Synchronization and IPC (inter-process communication)

    Context switch, scheduler

    Interrupts subsystem

    Memory subsystem/Non-volatile memory

  • 7/28/2019 Introduction to Real Time Embedded Systems

    13/49

    13

    Copyright 2005 AVMBrothers Ltd.

    13

    Semester B(Part2) Emb. Systems Design with Emb. Linux

    Filesystems

    - i-node. Embedded filesystems: JFFSx, YAFFS, UBIFS, ROMFS, CRAMFS, NFS,PROCFS

    Networking

    - Layers and protocols; internet-enabled systems; network-enabled applications

    Introduction to Linux system administration - Creating development environment; setting NFS, TFTP, samba, NFS servers

    Drivers

    - Character device drivers; kernel modules; kernel busses

    Reference Advanced RT Emb. Design Project Overview.

    Advanced RT Emb. Design Project Implementation: MRD, Kick off , PDR, CDR, FDR Coaching Part 2:

    - Project Schedule and CV Design + interview preparation

    Practical part for the Network Based Embedded Applications

    Program Final exam: Embedded Real-Time Designer Evaluation Exam (Final Program

    Exam).

  • 7/28/2019 Introduction to Real Time Embedded Systems

    14/49

    14

    Course Material

    Course Material includes:

    Slide Sets 4 books: (2 for SemA - Firmware, 2 for SemB Emb. Linux)

    1. Introduction to RT Embedded Systems Design:

    1. RT Embedded Design Technologies and Design Flow

    2. Structure of Modern Processors, Peripherals.2. Projects review and design:

    1. Main rules for the design, RT programming with ASM and C.

    2. RT Emb. System Design: Ref Project Review and help to the FirstProject Design

    3. Introduction to RTOS VxWorks and Embedded Linux.

    4. Design in OS environment and Advanced Ref Project review + designthe First Project with RTOS.

    Reference RT Embedded Design and Advanced RT Embedded DesignProjects Design Environment - Soft Copy.

  • 7/28/2019 Introduction to Real Time Embedded Systems

    15/49

    15

    Recommended Literature

    1. Computer Systems

    Computer System Architecture, Moris Mano (ISBN-13:

    9780131755635)

    The Indispensable PC Hardware Book Hans Peter Messmer(ISBN: 0-201-59616-4)

    2. RT Embedded Design

    - "Real time UML: Developing Efficient Objects for Embedded

    Systems" by Bruce Powel Douglass

    3. Programming with C and ASM

    - C Traps & Pitfalls - Andrew Koenig

  • 7/28/2019 Introduction to Real Time Embedded Systems

    16/49

    16

    Recommended Literature

    4. Real Time Operating System Programming

    Real-Time Embedded Multithreading Using ThreadX and ARM

    Edward L. Lamie

    Building Embedded Linux Systems

    Karin Yaghnmour

    Real-Time Concepts for Embedded SystemsQing Li,Caroline Yao

  • 7/28/2019 Introduction to Real Time Embedded Systems

    17/49

    17

    What is a Real Time

    Embedded System?

  • 7/28/2019 Introduction to Real Time Embedded Systems

    18/49

    18

    Embedded System Design introduction

    Real Time System Example:

    A telephone switching system must feed dial tone to thousands ofsubscribers within a recommended limit of one second

    The off hook detection mechanism and the software messagecommunication involved have to work within the limited timebudget

    The system has to meet these requirements for all the calls being setup at any given time

  • 7/28/2019 Introduction to Real Time Embedded Systems

    19/49

    19

    Introduction to RT Emb. Sys. - Industry and Applications

    Microprocessor Market Share all embedded almost

  • 7/28/2019 Introduction to Real Time Embedded Systems

    20/49

    20

    What Is a Real Time ?

    Definition: AnEmbedded system is a computer system designed to perform

    one or a few dedicated functions. It is embeddedas part of a complete device

    often including hardware and mechanical parts .For example, your IPOD is an embedded system.

    Definition: AReal Time Application is an application which has time

    constrains. This is a pre-defined operational deadlines from event to system

    response, the time must be met even if the system runs at full load (worse casescenario).For example, a car engine control system is a real-time system because a delayed signal may causeengine failure or damage.

  • 7/28/2019 Introduction to Real Time Embedded Systems

    21/49

    21

    Real Time System

    System is described as beingdeterministic if its response time is

    predictable

    Lag time between the occurrence of an event and response to that

    event is called latency

    Deterministic response is key to real-time performance

  • 7/28/2019 Introduction to Real Time Embedded Systems

    22/49

    22

    Hard vs. Soft Real Time

    Hard real-time means all hard deadlines are always met

    Each event, like a button push, will be processed and completed at

    a predefined time, regardless of system load

    Time

    Event Event processed and completed (Max.)Guaranteed worst-case response times

  • 7/28/2019 Introduction to Real Time Embedded Systems

    23/49

    23

    Hard vs. Soft Real Time

    Soft real-time means that event tolerate lateness, and may respond with

    decreased service quality

    For example, Video player may lose some frames while playing a video

    Time

    Event The CPU will allocate the bandwidth toprocess the event, there is no guaranteeof completion time

  • 7/28/2019 Introduction to Real Time Embedded Systems

    24/49

    24

    Hard vs. Soft Real Time

    Hard Real Time is necessary for critical missions such as heart

    pacemaker and industrial process controllers, where failure to

    meet a guaranteed response time could lead to catastrophic results.

    In Soft Real Time users are happier when the system responds

    optimally, but which is not considered to have "failed" when the

    system doesn't meet each and every desired response time.On average, a soft real-time system meets a particular response

    time goal.

  • 7/28/2019 Introduction to Real Time Embedded Systems

    25/49

    25

    Embedded System Design introduction

    RT system is dealing with solving real time constrains:

    Real time Response The system needs an immediate response can even be in

    magnitude order nano-seconds

    Asynchronous events can occur at any time

  • 7/28/2019 Introduction to Real Time Embedded Systems

    26/49

    26

    Embedded System Design introduction

    Race Conditions and Timing

    Buffers zone limited size needs timed treatment

    Mutual demand for resources

  • 7/28/2019 Introduction to Real Time Embedded Systems

    27/49

    27

    Embedded System Design introduction

    Size limitation

    System on Chip or Board tends to be very limited in space -

    This forces many limitation on the processor in terms of

    address lines number etc

    Power consumption

    The power budget is very limited and extremely importantespecially in mobile applications

  • 7/28/2019 Introduction to Real Time Embedded Systems

    28/49

    28

    Embedded System Design introduction

    Performance

    The system performance is a key issue and must be kept in allcircumstance

    Performance is a major factor in choosing the processor, the clock

    frequency , ram size , code size etc..

    Re-use

    In many projects the system relies on already developed components,which the designer must reuse. These components already have

    embedded constrains in addition to the new system constraints.

    Recovering from Failures

    Working in a distributed environment connection failure

  • 7/28/2019 Introduction to Real Time Embedded Systems

    29/49

  • 7/28/2019 Introduction to Real Time Embedded Systems

    30/49

    30

    Embedded System Design introduction

    SoC System On Chip

    The System On Chip consists of a few different block typesinside the same chip like:

    CPU The main processor unit

    Memory devices Volatile and non-volatile

    Internal bus interfaces and decoders

    Peripheral devices

    Digital/Analog functions

  • 7/28/2019 Introduction to Real Time Embedded Systems

    31/49

    31

    Embedded System Design introduction

    SoB System On Board Full set of the necessary devices as standalone on the same

    board:

    CPU The main processor unit

    Memory devices Volatile and non-volatile Internal bus interfaces and decoders

    Peripheral devices

  • 7/28/2019 Introduction to Real Time Embedded Systems

    32/49

    32

    RT Embedded Technologies

    RT Embedded Technologies

    Platforms types: Firmware (SoC/SoB)

    RTOS

    Drivers technology

  • 7/28/2019 Introduction to Real Time Embedded Systems

    33/49

    33

    RT Embedded Technologies

    The firmware systems

    About 25% of the system are without OS

    The OS mechanism is not a must for this kind of usuallysimple application

    Rom part

    Ram part

    Interrupts part

    Exceptions part

    Firmware Software

    CPU

    Peripherals

    RAM

    Firmware

    System Blocks - Overview

  • 7/28/2019 Introduction to Real Time Embedded Systems

    34/49

    34

    Embedded System Design introduction

    Firmware systems main features

    - Small code size 5-100k Using only procedure level

    programming

    - Main Loop system

    - Drivers for communication and/or peripheral devices can

    hold a major part of the system

    - The firmware can manage and control a single SOC, or cancontrol also devices on a full Board level

  • 7/28/2019 Introduction to Real Time Embedded Systems

    35/49

    35

    Embedded System Design introduction

    System with RTOS (Real Time Operating Systems) features:

    - Medium & Large code size 100k - 4m per processor

    - A system can hold several processors- Using all programming levels

    - RTOS includes :

    time base task scheduling mutual exclusion treatment

    task priority

    etc

  • 7/28/2019 Introduction to Real Time Embedded Systems

    36/49

    36

    What Is An Operating System (1 of 2)

    An Operating System (OS) is a computer program that

    manages the hardware and software resources of a computer

    Operating system performs basic tasks such as:

    Controlling and allocating memory

    Prioritizing system requests

    Controlling input and output devices

    Facilitating networking

    Managing files

    In other words, it forms a platform for other software.

    What Is Operating System (2 of 2)

  • 7/28/2019 Introduction to Real Time Embedded Systems

    37/49

    37

    What Is Operating System (2 of 2)

    Real Life Examples

    Controlling and allocating memory

    When you launch you favorite computer game memory is

    allocated for the games variables.

    Prioritizing system requests

    The eject button in a fighter has higher priority than the

    lights management system

    Controlling input and output devices

    Network Interface Card (NIC) connect your computer to theinternet

  • 7/28/2019 Introduction to Real Time Embedded Systems

    38/49

    38

    Embedded System Design introduction

    System with RTOS (Continue)

    Drivers for communication and/or peripheral devices usuallyhold a minor part of the system

    The system with RTOS can reside on a system on chip (SOC)

    or on a System On Board (SOB) at a full Board level

  • 7/28/2019 Introduction to Real Time Embedded Systems

    39/49

    39

    RT Embedded Technologies

    Introduction to Device Drivers

    What are device drivers?

    Make the attached device work

    Insulate the complexities involved in I/O handling

    Application

    Device driver

    Hardware

    RTOS

    D i E l

  • 7/28/2019 Introduction to Real Time Embedded Systems

    40/49

    40

    Drivers Examples

  • 7/28/2019 Introduction to Real Time Embedded Systems

    41/49

    41

    RT Embedded Device Drivers

    Device Driver Characterization

    Device Drivers Functionalities

    initialization

    data access

    data assignment

    interrupt handling

    E b dd d S t D i i t d ti

  • 7/28/2019 Introduction to Real Time Embedded Systems

    42/49

    42

    Embedded System Design introduction

    RT system Programming languages

    Old systems - include many parts in assembly language -

    processor dependent language

    Current systems - most real time systems are based on RTOSnow, written in the C language. Still, for crucial time tasks,

    Assembly code may be required (e.g when cycle count is

    important).

    Some applications which have a lot of software - less real

    time oriented , but application business dependent , or which

    inherited software base - are written using C++

    Many application have several programming languagesmixed due to real time constrains or inherited code

    E b dd d S t D i i t d ti

  • 7/28/2019 Introduction to Real Time Embedded Systems

    43/49

    43

    Embedded System Design introduction

    ASM language

    The assembly language is processor dependent

    No reuse to other processors

    Mastered by a limited number of programmers

    Has all the known limitation of assembler :

    One C line on average 5 assembly commands

    Very hard to check and debug Very efficient in terms of execution time and code size

    E b dd d S t D i i t d ti

  • 7/28/2019 Introduction to Real Time Embedded Systems

    44/49

    44

    Embedded System Design introduction

    C language Is NOT processor dependent

    Reuse to other processor is very common

    Known to a very large number of programmers

    Relatively easy to check and debug Quite efficient in terms of execution time and code size

    The compiler can include optimizers for using the processor pipeline structureefficiently

    C++ language C++ language is NOT processor dependent

    Reuse to other processor is extremely common

    Known to a very large number of programmers

    Medium effort require for testing and debug

    NOT efficient in terms of execution time and code size

    E b S t I d t d A li ti

  • 7/28/2019 Introduction to Real Time Embedded Systems

    45/49

    45

    Emb. Systems Industry and Applications

    CPUs for RT Emb. Systems

    Cellular market:

    ARM

    Marvell

    Toshiba

  • 7/28/2019 Introduction to Real Time Embedded Systems

    46/49

    46

    RT Emb. Systems Industry and Applications

    Communication market:

    Power PC- Motorola

    8051 Intel

    MIPS

    ARM

    ARC

    XSCALE

  • 7/28/2019 Introduction to Real Time Embedded Systems

    47/49

    Industry and Applications

  • 7/28/2019 Introduction to Real Time Embedded Systems

    48/49

    48

    Industry and Applications

    Job Market Sectors in Israel Semiconductors Intel, IBM, Freescale, Applied,

    Orbotech

    Communication Cisco, Rad, ECI, NDS.- Each of the above has 100s of RT- embedded engineers

    Security Elbit, IAI, Rafael, Nice, Verint

    Most of the above has 1000s of RT Embedded engineers

    There are many medium size companies and plenty of small

    ones

    Introduction to RT Emd Systems - Industry and Applications

  • 7/28/2019 Introduction to Real Time Embedded Systems

    49/49

    49

    Introduction to RT Emd. Systems - Industry and Applications

    Israel - Salary Survey Oct-2009 - software

    30-4026-3023-2818-2415-19Embedded

    Systems

    Designer

    Senior MngJunior

    Mng/Team

    Leader

    6+ years3-5 years0-2 yearsFunction