CPE555A: Real-Time Embedded Systems - PowerPoint PPT Presentation

Loading...

PPT – CPE555A: Real-Time Embedded Systems PowerPoint presentation | free to download - id: 7dde11-Y2YxO



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

CPE555A: Real-Time Embedded Systems

Description:

Title: CS514 - Computer Architecture Author: Ali Zaringhalam Last modified by: Ali Zaringhalam Created Date: 1/1/2002 7:40:06 PM Document presentation format – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 70
Provided by: AliZ9
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: CPE555A: Real-Time Embedded Systems


1
CPE555AReal-Time Embedded Systems
  • Lecture 1
  • Ali Zaringhalam
  • Stevens Institute of Technology

2
Grader
  • Qiming Zhao
  • qzhao7_at_stevens.edu

2
3
Grade Distribution
Grade Fall 2014 Spring 2015 Spring 2016
A 6 (14) 3 (11) 4 (14)
A- 6 (14) 6 (22) 6 (20)
B 15 (38) 11 (39) 13 (42)
B 10 (24) 4 (14) 4 (14)
C 2 (5) 2 (7) 3 (10)
F 2 (5) 2 (7) 0
I 0 0 1
4
Outline
  • Embedded systems
  • Real-time-systems
  • Taxonomy of real-time embedded systems
  • Example applications

5
General-Purpose Computer System
  • A general-purpose computer such as a desktop or
    laptop can be used for a variety of applications
    (e.g. word processing, streaming audio, DB)

6
Embedded Computer System
  • An embedded computer system is a component of a
    larger system
  • It is programmed to serve a single set of
    functions
  • It generally interacts with the environment and
    performs a set of repeated control and monitoring
    tasks
  • Examples include computers embedded in TV,
    microwave oven, medical devices, cars, network
    routers, etc.
  • There are a lot more embedded computing devices
    than desktops, laptops, workstations

7
General-Purpose Computer
Intel Pentium 3-4 GHz 3-8MB Cache
8 GB RAM
100 W Power
Up to 1000 GB Storage CD/DVD
10/100/1000 Ethernet WiFi
Video card
8
Microcontroller-Based Embedded Computer
ROM or Flash to hold program Flash 256 KB
ARM Core 100 MHz
100 KB
9
Beaglebone Black
10
Large Embedded Systems
  • Embedded doesnt mean small
  • Large embedded systems such as network switches
    and routers dont use microcontrollers
  • CPU is typically in 100s of MHz
  • 500MB-1 GB RAM
  • 250-500 MB Flash
  • Power consumption could be an issue
  • They are embedded systems like their smaller
    counterparts in the sense that they perform a
    single well-defined set of tasks

11
What Is a Real-Time System?
  • A computer program/algorithm has inputs and
    outputs. The response/output to a given input
    defines the program behavior.
  • Sorting algorithm sort the input and provide as
    output
  • There are many sort algorithms with different
    average and worst-case complexity (O(n),
    O(nlogn), etc.)
  • In a real-time system, the behavior must be both
    logically correct and produced at the correct
    instant of time.
  • If the deadline is missed, the behavior is
    considered incorrect.

12
System/Environment Interfaces
  • A real-time system reacts to input from the
    environment (user and the controlled object)
  • Real time means that the reaction of the system
    to external events must occur during its
    evolution
  • Using the same time scale and clock

Environment
  • Pedestrian
  • Car driver
  • Network operator
  • Etc.

User
  • Keyboard/Button
  • Display

User Interface
Real-Time System
  • Sensors actuators
  • Control registers

Control Interface
  • Traffic light
  • Brake system
  • Switching device
  • Etc.

Controlled Object
Environment
13
Real-Time System Example
Feedback Loop
14
Classification of Real-Time Systems
  • Hard real-time vs. soft real-time
  • Fail-safe vs. fail-operational
  • Guaranteed timeliness vs. best-effort
  • Resource-adequate vs. resource-inadequate
  • Event-triggered vs. time-triggered

15
Hard vs. Soft Real-Time Deadline
  • A hard real-time system must produce the result
    at the correct physical time. Failure to do so
    can have catastrophic consequence and is
    considered unacceptable.
  • Nuclear power plant
  • A soft real-time system can miss a deadline.
  • The result may still be useful
  • If the deadline is missed, there will not be a
    catastrophe. (e.g., multimedia)

16
Hard vs. Soft Real-Time Response-Time
  • A hard real-time system must respond to events on
    the order of milliseconds (e.g., a braking
    system).
  • A soft real-time systems response can be on the
    order of seconds (an ATM machine).
  • Hard real-time systems use specialized scheduling
    techniques

17
Hard vs. Soft Real-Time Peak-Time Performance
  • A hard real-time system must meet the specified
    deadline under peak/worst conditions. It must be
    able to meet deadlines in rare-event scenarios.
  • Soft real-time systems are defined in terms of
    average behavior. Performance degradation in
    worst case scenarios is accepted for economic
    reasons

18
Real-Time Impact of Common Techniques
  • Pipelined processors with speculative execution
    for conditional statemets
  • Caching
  • Virtual memory
  • Compilers with optimization turned on
  • Garbage collection
  • Multi-tasking
  • Networking
  • Software component
  • Etc.

All commonly used in general-purpose computers.
Some (such as virtual memory) are never used in
embedded systems.
19
Fail-Safe Vs. Fail-Operational
  • If a system can enter a safe state when failure
    occurs, the system is fail-safe
  • Railway signaling system failure a safe state is
    to turn all lights red.
  • Example a watchdog timer must be stroked at
    regular intervals by software. If there is a
    software failure, the watchdog fires, forces the
    system into a safe state resets the CPU.
  • In a fail-operational system, a safe state after
    failure is not acceptable. The system must
    remain operational and provide a minimal amount
    of guaranteed service.
  • An airplane with a single failed engine

20
Guaranteed Response Time
  • Assumption coverage start by defining a set of
    specifications for the expected system failures
    a set of worst-case load assumptions.
  • Recovery specifications next specify recovery
    strategy to meet fail-safety, fail-operational,
    etc.
  • For guaranteed response, the system must be
    designed to address all specified failures under
    peak load with the specified recovery.
  • The probability of unknown failure is reduced to
    the accuracy of the specification coverage
    recovery spec.

21
Best-Effort System
Troutman Postulate The worst software bug will
be discovered six months after field test.
  • A system that does not have the guaranteed
    response-time properties is considered a best
    effort system
  • In a best-effort system, failures are discovered
    through extensive integration testing. When a
    failure is discovered during testing, a fix is
    proposed and implemented
  • This is an ad-hoc procedure there are always
    failures that are detected after system
    deployment.
  • For economic reasons, most real-time systems are
    best-effort unless they have safety-critical
    requirements.

22
Resource-Adequacy
  • In order to have a guaranteed response time, the
    system must be engineered to operate under
    worst-case conditions
  • You cant use probabilistic arguments to estimate
    a resource (such as RAM size)
  • Most soft real-time systems are best-effort and
    therefore not resource-adequate under worst-case
    conditions

23
Event- vs. Time-Triggered
  • In event-triggered systems, all processing
    activities are driven by some event in the
    environment
  • The computer system receives the event via a CPU
    interrupt
  • In time-triggered systems, all processing
    activities are initiated at periodic intervals
  • There is a single interrupt associated with a
    clock to pace the system
  • The occurrence of events in the environment are
    detected via periodic polling or via interrupts

24
Dependability
  • Real-time systems must be dependable it should
    provide the intended service for an extended
    interval of time
  • Reliability
  • Maintainability
  • Availability
  • Safety
  • Security
  • Even perfectly designed systems can fail if the
    assumptions about the workload and possible
    errors turn out to be wrong.
  • Making the system dependable must not be an
    after-thought, it must be considered from the
    very beginning

25
Reliability Measure
  • Reliability R(t) probability of system working
    correctly provided that is was working at t0
  • Mean Time To Failure (MTTF) average period of
    time until a failure occurs
  • Failure rate (FIT) a measure of the frequency
    with which the system fails expressed in
    failures per hour
  • Failures In Time FIT measures number of failures
    per unit time
  • Unit of time is 109 hours
  • So 1 FIT means that the MTTF is 109 hours
    (115,000 years)
  • In general the failure rate is time-dependent. A
    car is more likely to fail after 10 years.
  • But typically a fixed FIT rate is used as a
    measure of reliability
  • R(t) exp-lt where l1/MTTF
  • Ultra-high reliable systems typically have a l
    10-9

26
Examples
  • FIT Rate 109/(MTTF)
  • MTTF is in hours
  • MTTF 100,000 hours (11 years)
  • FIT 10,000
  • FIT Rate 100
  • MTTF 10,000,000 hours (1141 years)

27
Safety Measure
  • How safe is a computer-controlled braking system
    in a car?
  • The failure is critical in the sense that the
    cost is immeasurable (loss of life)
  • The safety of a system with respect to a critical
    failure is also measured in terms of MTTF of the
    specific failure
  • A car typically operates a few hours a day. A
    failure rate of l 10-9 (hour-1) translates into
    about 10 failures per million cars per year

28
Maintainability Measure
  • Maintainability is a measure of the time interval
    to repair a system after a failure has occurred
  • Repair could take human intervention or it could
    be autonomous
  • Example of autonomous repair a computer software
    failure triggers a reset
  • Example of human intervention craft dispatch
  • Mean time to repair (MTTR) is the average time to
    repair a failed system
  • Repair rate m1/MTTR (repairs per hour)

29
Availability Measure
  • Availability is a measure of the delivery of
    correct service when the service fails
  • In a system with MTTF and MTTR
  • MTBF MTTFMTTR
  • A MTTF/MTBF
  • Design tradeoff you can increase availability by
    either increasing MTTF or decreasing MTTR

30
Example - 1
  • A telecom system deployed in the field has a MTTF
    of 100,000 hours (11 years) assuming a hardware
    failure
  • FIT rate(1/100000) x 109 10,000.
  • If a blade fails, it requires dispatch of
    maintenance crew to replace the blade. This
    takes about 4 hours.
  • What is the availability rate?
  • MTBF1000004100004 hours
  • AMTTF/MTBF100000/1000040.99996
  • This system is referred to as meeting four nines
  • Down-time per year 3652460(1-0.99996)21
    minutes

31
Example - 2
  • Typically the availability requirement for
    telecom systems is five nines
  • What can be done to increase availability?
  • MTBF MTTFMTTR A MTTF/MTBF
  • Common strategy is to reduce MTTR by providing a
    redundant blade which can be placed in service as
    a standby
  • Suppose it takes a minute to do a failover switch
    (for a hot standby it is instantaneous)
  • Availability100000/(1000001/60)0.999999 (six
    nines)
  • Assumes the redundant blade does not fail before
    the primary has been replaced. Double failures
    are not covered.
  • Down-time per year 3652460(1-0.999999)0.5
    minute
  • For five nine systems it is about 5 minute
    downtime/year
  • For more information on high availability, see
  • http//en.wikipedia.org/wiki/High_availability

32
Multi-Component System Reliability
  • Consider a system with n components
  • Ri(t) probability of sub-system i working
    correctly
  • Ri(t) exp-lit, i1.n
  • Each systems failure is independent of others
  • What is the MTTF of the whole system?
  • R(t) R1(t) x R2(t) x .. X Rn(t) exp-lsyst
  • lsys S li
  • 1/MTTFsys S(1/MTTFi)

33
Example
  • Assume a disk subsystem with the following
    components and MTTF
  • N disks each rated at 1,000,000 - hour MTTF
  • 1 SCSI Controller rated at 500,000 - hour MTTF
  • 1 Power Supply rated at 200,000 - hour MTTF
  • 1 Fan rated at 200,000 - hour MTTF
  • 1 Processor rated at 100,000 - hour MTTF
  • How many disks can we support such that the MTTF
    of the entire system is at least 4 years?

34
Example - Continued
  • 1/MTTFsys S(1/MTTFi)
  • 1/(436524) N/(1000,000) 1/(500,000)1/(200,00
    0)1/(200,000)1/(100,000)
  • N6.5
  • N6 taking the lower bound

35
Example - Continued
  • Suppose MTTR of the entire system is 200 hours,
    what is the availability of the system?
  • Availability MTTF/(MTTFMTTR)(436524)/(
    436524200)0.994
  • FIT Rate 109/MTTF28,500

36
Security
  • Embedded systems must protect against
    unauthorized access and denial-of-service (DOS)
    attacks
  • File tampering
  • Code tampering
  • Etc.
  • Cryptographic theft-avoidance systems for cars
    (ignition locking)
  • Authentication network protocols (e.g., 802.1X)
  • DOS attacks on servers and routers
  • Policing traffic destined for the CPU from the
    network

37
Efficiency
  • Real-time embedded systems must be efficient
  • Code-size efficient
  • Run-time efficient
  • Weight efficient
  • Cost efficient
  • Energy efficient

38
Application Areas
  • Hybrid embedded systems
  • Aerospace, automobiles, robotics, process
    control, and sensor nets
  • Multimedia
  • Consumer electronics
  • Appliances, office electronics, and home/office
    automation
  • Network components
  • Bridges, routers, switches, and hubs
  • Medical instruments
  • Patient monitoring, MRI, and artificial hearts
  • E-Business
  • ATM, vending machines
  • Distributed grid computing

39
Hybrid Embedded Systems
  • Computation systems whose behavior is tightly
    integrated with the physical world
  • Example the behavior of an unmanned aerial
    vehicle (UAV) can be modeled by a combination of
    differential equations (the aerodynamics and low
    level feedback controllers) and a finite state
    automata (high level flight path decisions, such
    as to ascend or descend).
  • Behavior is governed by both continuous-state
    dynamics from the physical world and
    discrete-state dynamics from the computation
  • Passage of time during computation affects the
    state of the physical world

40
Aerospace
  • Flight control
  • Stability
  • Anti-collision systems
  • Positioning navigation
  • Global Positioning System (GPS)
  • Inertial navigation system (INS)
  • Instrumentation
  • Data acquisition, display, processing, and
    archive
  • Radar
  • Communication

41
Automobiles
  • Engine management
  • Fuel, ignition, timing
  • Emission control
  • Instrumentation
  • Data acquisition, display, processing
  • Safety stability
  • Airbags
  • Anti-Lock Braking Systems (ABS)
  • Electronic Stability Control (ESC)
  • Theft prevention with smart keys
  • Blind-angle alert systems
  • Entertainment comfort
  • Radio
  • Heat A/C

42
Automobiles
  • Premium-class automobile
  • Millions of LOC in a premium class automobile
  • Execute on 70-100 µP
  • Electronics SW cost is 40 of the cars cost,
    and rising
  • Low-end cars
  • 30-50 µP
  • Processors are networked throughout the car
  • Source http//spectrum.ieee.org/green-tech/advanc
    ed-cars/this-car-runs-on-code

43
Robotics
  • Implies autonomous operation
  • N physical degree of freedom
  • Artificial intelligence
  • Control heavy
  • Mission oriented
  • Repair, search, rescue, investigate, and perform
    physically difficult tasks

44
Process Control
  • Industrial automation
  • Plant monitoring and production control
  • Similar to control systems but with emphasis on
    management

45
Sensor Nets
  • Many sensor nodes each capable (but limited) of
    sensing, computation/storage, and communication
  • Structure safety
  • Search and rescue
  • Military use
  • Energy Efficient
  • Distributed

46
Multimedia
  • Functions include
  • Signals, analog to digital conversion,
    quantization, sampling, processing, and digital
    to analogue conversion
  • Compression
  • Images, audio, video
  • Virtual Reality
  • Presentation
  • Quality of service
  • Jitter-intolerance

47
Consumer Electronics
  • Home appliances
  • Microcontroller-based
  • Future add networking (HeMS)
  • Office electronics
  • Scanner/Printer/Fax
  • Home/office automation
  • Automated home or office with lights and
    appliances that operate by themselves or with
    minimal effort
  • Internet of Things
  • http//en.wikipedia.org/wiki/Internet_of_Things
  • Typically has embedded systems hanging off the end

48
Network Components
  • Switching LANs
  • Bridge connects two parts of the same multicast
    domain/subnet
  • Router links nodes of different subnets
  • Switch large volumes of data at high-speed line
    rate (1/10/100 Gbps)
  • Packet classification and filtering based on
    packet header
  • Deep packet inspection
  • Quality of Service (policing and shaping in
    packet networks)
  • An embedded computer controls the datapath

49
Medical Instruments
  • Perform diagnosis (screening/evaluation)
  • Data collection
  • Appraisal of that data
  • Observation or monitoring
  • Sensing and instrumentation
  • Accuracy and precision
  • Other applications
  • Radiation therapy
  • Artificial hearts, arms, legs,

50
E-Business
  • Information processing systems
  • ATM
  • Cash registers
  • Scanners
  • Credit-card readers
  • Often the interface behind a database
  • Automation and convenience

51
Elements of Computer Architecture
  • Instruction Set Architecture (ISA)
  • how to tell the processor what to do?
  • Microarchitecture
  • includes CPU internal organization, memory
    hierarchy, etc.
  • Hardware Implementation
  • circuit design
  • packaging
  • etc.

51
52
Instruction Set Architecture
  • Interface between machine programmers
  • machines Application Programming Interface (API)
  • Theprogrammers who care about this API
  • for the most part compiler developers carebut
    also ...
  • assembly programmers (low-level code)
  • Real-time system developers
  • most programmers write portable code in
    high-level language and do not care about ISA

52
53
Microarchitecture
  • Specification of Functional Blocks
  • internal registers (how many, special- vs.
    general-purpose, etc.)
  • Arithmetic Logic Unit (ALU) , FP units
  • memory organization cache design,
  • etc.
  • Specification of Interfaces Between Building
    Blocks
  • interconnection structure (bus, point-to-point,
    etc.)
  • data flow between instructions (register,
    broadcast bus, etc.)
  • control (hardwired, microprogrammed, centralized,
    distributed)
  • Implementation of ISA
  • whether CPU is single-cycle, multi-cycle,
    pipelined, etc.
  • organization of pipeline (number of stages,
    functions in each stage)
  • single-issue, multiple-issue (superscalar), etc.

53
54
Hardwired Processing
Custom Hardware
F
X
YF(X)
Input
Output
  • Special-purpose processor
  • A different computation requires rewiring

54
55
General-Purpose Processor
CPU is a general-purpose instruction set processor
55
56
Von Neumann Machine
CPU
Input/Output
ALU/Datapath
Main Memory
Control Unit
56
57
Von Neumann Machine Key Concepts
  • Stored Program Control
  • Storage of Both Data Executable Instructions in
    Main Memory
  • Memory is Addressable by Location for Both Data
    Executable code
  • Control Unit
  • Fetch Execution of Sequential Instructions
    From Memory
  • Branch Instructions
  • Arithmetic Logic Unit (more generally datapath
    which includes functional units for fetch
    store, decode, etc.)
  • Arithmetic Logical Operations on Binary Data
  • Input/Output
  • Controlled by Control Unit (directly or
    indirectly)
  • First Prototype IAS in 1952

57
58
Fetch/Execute Cycle
Interrupts Disabled
Fetch Next Instruction
Execute Instruction
Handle Interrupts (If Any)
Start
Interrupts Enabled
  • The address of the current instruction is the
    Program Counter (PC) register.
  • After the instruction is fetched, PC is
    automatically incremented to point to the next
    instruction

58
59
Need for Instructions
  • We need a way to tell the processor what steps to
    take to execute our program. In the Von Neumann
    model this includes
  • fetching data from memory
  • performing arithmetic logical operations on the
    data
  • storing the results of computation in memory
  • performing input/output
  • In addition the processor must support certain
    high-level programming constructs. These include
  • modifying the sequential flow of control for if
    then else and case
  • subroutine calls to support structured programming

59
60
Examples of Instructions
60
61
RISC Instruction Set Architecture
  • MIPS is a flavor of the more generic class of
    Reduced Instruction Set Computer (RISC)
    Instruction Set Architecture (ISA)
  • Here are some examples of RISC processors
  • ALPHA (Digital/Compaq)
  • PowerPC (Motorola IBM)
  • SPARC (Sun Microsystems)
  • MIPS
  • ARM (heavily used in embedded systems today)
  • The ISAs implemented in these machines are not
    quite the same but share a large set of common
    characteristics (to be discussed shortly)

61
62
Summary MIPS Instruction Formats
62
63
Whats in an ISA?
  • Above all an ISA is a set of specifications
  • An ISA gives you a set of requirements on what to
    build (i.e., support) in a processor. These
    include
  • the set of instructions that the processor must
    support
  • the number of programmable registers
  • instruction format including size and encoding
  • the interface between the processor and the
    operating system for exception handling
  • what features are required and what features are
    optional (for example in MIPS integer arithmetic
    is required but floating-point arithmetic is
    optional)
  • in short whatever is required to ensure binary
    compatibility between two machines implementing
    the same ISA

63
64
What Isnt in an ISA?
  • An ISA doesnt tell you how to build a processor.
    Should it be pipelined? How many instructions
    should be issued per cycle? etc.
  • This permits
  • processor vendors to implement the ISA in
    different ways based on technology/performance/cos
    t requirements
  • compiler developers to develop compilers to
    translate to an ISA independent of the
    processors specific implementation
  • this is not entirely true when it comes to
    performance optimization
  • an ISA to live longer than a specific
    implementation (a particular processor becomes
    obsolete long before an ISA is abandoned in favor
    of a new one)

64
65
Characteristics of RISC Processors
  • Large number of General Purpose Registers
  • Strictly load/store
  • Fixed-size instructions
  • Variable-format instructions
  • Limited number of addressing modes
  • Small instruction set (MIPS32 has 168
    instructions vs. 700 in VAX)

65
66
RISC Alternative CISC
  • CISC Complex Instruction Set Computer
  • variable-length, variable format instructions
  • complex instructions
  • memory-register instructions
  • complex addressing modes
  • Example Intels IA32

66
67
Whats a General-Purpose Register?
67
68
Storage-Device Hierarchy
0.25-0.5 ns
0.5-20 ns
80-250 ns
4 GHZ CPU Cycle T0.25 ns
Increasing Access Time
68
69
Why a Large Number of GPRs?
  • Registers are cheaper to make now
  • Registers offer compiler writers flexibility
  • compiler developers prefer unreserved registers
  • Registers are faster to access than main memory
    or cache
  • Registers can store variables for as long as
    necessary. This reduces the need to access
    memory for data
  • We can address registers with fewer bits compared
    to addressing main memory. This reduces code
    density
  • in MIPS we need 5 bits to address 32 registers
  • in a 32-bit machine we need 32 bits to address a
    memory location

69
About PowerShow.com