ELCT 912: Advanced Embedded Systems - GUC

advertisement
ELCT 912:
Advanced Embedded
Systems
Lecture 1: Introduction
Dr. Mohamed Abd El Ghany,
Department of Electronics and Electrical Engineering
Mohamed.abdel-ghany@guc.edu.eg
Administrative Rules
Course components:
Lecture: Wednesday (First slot), 8:30-10:00 (H10)
Office Hours: Thursday after lecture
Teaching assistant: ---Grading:
Assignments: 20%
Project : 20%
Mid term exam: 20%
Final exam: 40%
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
2
Administrative Rules
Assignments
Project:
Announcement : Thursday, 29/10/2011
Due date: 21/12/2011
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
3
Course Policies
Take notes during the lectures, Don’t expect
that everything said during the lecture will be
documented in the slides
I expect that anything “said” during a lecture
or tutorials will be known by all students. So,
if you don’t attend, then please “at least” ask!
It is your responsibility to check the course
website regularly for any announcements or
material
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
4
Course Objective
Understanding the constraints and characteristics of
embedded systems
Understanding the hardware/software trade-offs inherent
in embedded systems
Understanding the particular requirements of real-time
systems
Applying this understanding to carry out the design
process
Developing assembly and C programs to control
embedded systems
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
5
Text and Reference Books
P. Marwedel: Embedded System Design, Springer,
2006
T. Noergaard, “Embedded systems Architecture”
Elsevier Inc. 2005, ISBN: 0-7506-7792-9
W. Wolf, “Computers as Components: Principles of
Embedded Computing system Design,” 2nd Edition,
Morgan Kaufman Publishers, 2008
A. N. Sloss, D. Symes, and C. Wright, “ ARM System
Developers’ Guide,” ISBN: 1- 55860-874-5
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
6
Prerequisites
Digital Logic Design
Electric Circuits I, II
Introduction to Computer
Programming
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
7
What is a real-time system?
Frequently embedded systems are real-time in nature
A real-time system is any information processing
system which has to respond to externally generated
input stimuli within a finite and specified period
the correctness depends not only on the logical
results but also the time it was delivered
Failure to respond is as bad as the wrong response!
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
8
Application areas and examples
Automotive
electronics
Railways
Telecommunic
ation
Embedded systems
design
Avionics
Security
Health Sector
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
Consumer
electronics
Fabrication
equipment
Smart
building
Robotics
ELCT 912:
Advanced embedded Systems
Winter 2011
9
Generalized Embedded System
Computer is interfaced directly to real-world physical
equipment
Physical equipment controlled through regularly sampling
measurement devices
System software modules reflect physical nature of
environment
Module for physical control of devices
Module to record system changes
Module to retrieve & display changes
Module to interact with operator
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
10
A Typical Embedded System
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
11
Embedded vs. Conventional
Systems – Hardware
Computer hardware for embedded applications
consists of fairly standard components – e.g.
Processors
Memory units
Buses & peripherals
plus
Real-time I/O devices, e.g. sensors & actuators
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
12
Embedded vs. Conventional
Systems – software: Correctness
Embedded software differs from conventional software:
program must be both logically & temporally correct
Software must satisfy timing assertions on relation over
relative & absolute times – e.g. deadlines – a limit on
(relative or absolute) time when a computation must
complete
Distinction between hard & soft real-time systems
Hard – must meet timing constrains, else system fails;
e.g. system that controls vertical motion of a lift
Soft – considered successful despite missing some
timing constraints; performance may deteriorate; e.g.
failed phone connection
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
13
Embedded vs. Conventional
Systems – software: Concurrency
Embedded software must deal with inherent physical
concurrency – part of the external world to which
they’re connected
Signals from environment can arrive simultaneously,
disjoint but parallel activities may be monitored/
controlled by a signal computer system & output
signals may need to be emitted at the same time
(timing constraints)
Complexity of system design increases because of
combination of concurrency and timing problems
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
14
Embedded vs. Conventional
Systems – software: Reliability
Reliability & Fault Tolerance issues are particularly
significant
Reliability –measure of how often a system will fail, or
the probability that it will perform correctly over a given
period of time.
However, no system is perfectly reliable, so must be
able to cope with failures - e.g. mission failures, loss of
human life or money can be very costly
Fault Tolerance - concerned with recognizing &
handling failures; avoid failures where possible, else
fail gracefully with as little cost as possible
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
15
Embedded vs. Conventional
Systems – software: Criticality
Criticality – measure of the cost of failure
Higher the cost of failure, the more critical the system
e.g. - aircraft or nuclear power plant controller are highly
critical systems
Communication frequently non-critical e.g. mobile
phone
Differentiate hardness & criticality (often go together) not meeting a constraint may cause system failure, but
failure may not be critical
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
16
Embedded vs. Conventional Systems –
software: Application Specific
Most conventional computer systems are generalpurpose – i.e. run several applications at the same
time
Embedded systems, on the other hand, are
application-specific & often standalone - all s/w
including OS is tailor-made for the particular system
Many embedded systems have a human operator who
interactively controls & monitors it - human-machine
interface design must prevent errors & confusion
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
17
Embedded vs. Conventional Systems –
software: Testing
Testing & Validation - due to high costs of failures, it
is often impossible to test & validate systems in
their environments, but rely on
simulations
testing of subsystems
careful specifications & comprehensive analysis of
designs
run-time procedures for fault detection & handling
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
18
Interaction with Hardware Devices
Embedded systems require components to interact
with environmental devices through sensors &
actuators
Computer interface is through input & output registers operation is device & system dependent
Devices can also generate interrupts to signal the
processor
Control of devices must often be direct (not through
OS) because of time-criticality
Interfacing to devices considered later
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
19
Generic Embedded Hardware
Configuration
Comprises several nodes connected by a
communications network
Significant - presence of sensors, actuators,
displays, precise clocks & timers
For the purpose of timing prediction, behavior of
virtual memories, instruction & data caches must
predictable
System should provide both polling & priority
interrupts for sensors, actuators & I/O devices
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
20
Generic Embedded Hardware
Configuration
Generic network
Generic node
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
21
Generic Embedded Hardware
Configuration
Resource sharing between processors & I/O devices can
cause unpredictable performance
Programs can be organized so that processors & I/O don’t
access same memory locations simultaneously
More difficult to guarantee deterministic timing over a
comms. network
Message transmission times unpredictable because of
transmission path or medium multiplicity, or shared network
H/W reliability within and between nodes obtained through
redundancy
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
22
Software Life-cycle of Embedded
Systems
Life Cycle - similar to standard software engineering
Classified into six sequential phases or tasks
1. Concept - determination of project needs & goals
2. Requirements - what the software must do
3. Design - how S/W will meet its requirements
4. Implementation - programming the application
5. Testing - set of independently developed test cases are
used to verify that system meets requirements
6. Maintenance - additions, deletions & modifications due
to changing conditions
Feedback loops connect the phases
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
23
Concept Phase
Determine project goals & needs - driven by
customer input, technology changes &
marketing decisions
Includes feasibility studies
By-product of stage - often a white paper,
detailing what to build, and justifying the project
& its feasibility
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
24
Requirements Phase
Formal requirements specification about interfaces,
functions, timing & physical constraints, such as, mass,
power, voltage, etc.
Does not specify how to meet requirements, but may
specify budget & schedule
Test requirements committed to a test plan (used to
generate test cases in stage 5)
Forms the contract if customer & designer are different
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
25
Requirements Phase
Functional Requirements - features which can be tested by
exercising the system
Non-functional Requirements - specification about
processor type, implementation language, methodology,
version control, documentation, maintainability, modularity,
schedule, etc.
Chief goals of phase –
Define H/W & S/W interfaces
Write requirements document
Write test plan
Prepare project schedule & budget
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
26
Design Phase
Converts requirements document into a detailed
specification called detailed design document
Specifies how requirements are to be met by
partitioning functional features into H/W or S/W
modules
Design phase often finds problems in the requirements
document, such as, conflicts, redundancies or
technological difficulties
Requirements document may need to be modified e.g. exempt certain requirements
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
27
Design Phase – Major Tasks
Partition system into modules whose
implementation is clear
Allocate modules to H/W or S/W
Prepare detailed design document
Develop specific test cases
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
28
Implementation Phase
Implement modules detailed in design phase - programs for
S/W, circuits for H/W - implemented concurrently
Phase ends when all modules implemented & integrated
Tools (e.g. CASE) can be used to manage software
development
Major Tasks –
Code S/W & build H/W modules
Debug S/W & H/W and integrate modules
Developed automated test cases
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
29
Testing Phase
Testing, in order to debug software, occurs throughout
implementation phase
Testing phase is a formal step where a set of
independently developed test cases are used to verify
that system meets its requirements
System cannot be changed in this phase - if it fails, has
to be redesigned and then completely re-tested
Main tasks in this phase - perform system validation &
prepare test reports
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
30
Maintenance Phase
Phase consists of:
Product deployment
Customer support
Continuing system error correction
Release control
Phase ends when product is no longer required
Each of these 6 stages is very similar to standard SE.
However, partitioning between hardware and software
is an additional requirement.
Testing of increased importance
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
31
Embedded System Architecture
FPGA/ASIC
Sensors
ADC
Memory
CPU
DAC
Software
Actuators
Microcontroller
Human
Interface
Diagnostic
Tools
Auxiliary Systems
(Power, Cooling)
Electro-mechanical
backup & Safety
External Environment
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
32
Challenges in Embedded System
Design
Embedded systems really must be dependable.
Due to efficiency targets, software designs cannot be done
independently of the underlying hardware. Therefore,
software and hardware must be taken into account during
the design steps. Many objectives must be taken into
account during the design. Just capturing non-functional
requirements is already difficult.
The link to physics has additional implications. For example,
we must check if we will definitely meet real-time
constraints. Managing time is one of the largest challenges
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
33
Challenges in Embedded System
Design
Real systems are profoundly concurrent. Managing
concurrency is therefore another major challenge.
Real embedded systems are complex. Therefore, they
comprise various components and we are interested in
compositional design.
Traditional sequential programming languages are not
the best way to describe concurrent, timed systems.
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
34
Summary
Strong link between embedded and real-time systems
Hard vs soft real-time
Embedded software has additional characteristics including
complexity, reliability, concurrent and real-time control.
Have to consider interaction with hardware interfaces,
Software design cycle same as standard SE with added
complexity
Efficient implementation important for many embedded
devices.
Dr. Mohamed Abd el Ghany
Department of Electronics and Electrical Engineering
ELCT 912:
Advanced embedded Systems
Winter 2011
35
Download