ELCT 912:Advanced Embedded Systems
Lecture 1: Introduction
Dr. Mohamed Abd El Ghany, Department of Electronics and Electrical Engineering
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%
2Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
Administrative Rules
� Assignments � Project:
� Announcement : Thursday, 29/10/2011� Due date: 21/12/2011Due date: 21/12/2011
3Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
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 � 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
4Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
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 � 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
5Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
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
6Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
Prerequisites
�Digital Logic Design�Electric Circuits I, II�Introduction to Computer
Programming
7Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
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!
8Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
Application areas and examples
Automotive electronics
Avionics
Security
Consumer electronics
Em
bedd
ed s
yste
ms
9Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
Railways
Telecommunication
Health Sector
Fabrication equipment
Smart building
Robotics
Em
bedd
ed s
yste
ms
de
sign
ELCT 912: Advanced embedded Systems Winter 2011
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
10Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� 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
ELCT 912: Advanced embedded Systems Winter 2011
A Typical Embedded System
11Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
ELCT 912: Advanced embedded Systems Winter 2011
Embedded vs. Conventional Systems – Hardware
� Computer hardware for embedded applications consists of fairly standard components – e.g.� Processors � Memory units
12Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� Memory units� Buses & peripheralsplus
� Real-time I/O devices, e.g. sensors & actuators
ELCT 912: Advanced embedded Systems Winter 2011
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
13Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
(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
ELCT 912: Advanced embedded Systems Winter 2011
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/
14Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
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.
15Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
Embedded vs. Conventional Systems – software: Criticality
Criticality – measure of the cost of failure
� Higher the cost of failure, the more critical the systeme.g. - aircraft or nuclear power plant controller are highly
critical systems
16Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� 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
ELCT 912: Advanced embedded Systems Winter 2011
Embedded vs. Conventional Systems –software: Application Specific
Most conventional computer systems are general-purpose – i.e. run several applications at the sametime
� Embedded systems, on the other hand, are application-specific & often standalone - all s/w
17Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
Embedded vs. Conventional Systems –software: Testing
Testing & Validation - due to high costs of failures, itis often impossible to test & validate systems intheir environments, but rely on
� simulations
18Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� testing of subsystems
� careful specifications & comprehensive analysis of designs
� run-time procedures for fault detection & handling
ELCT 912: Advanced embedded Systems Winter 2011
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
19Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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 laterELCT 912: Advanced embedded Systems Winter 2011
Generic Embedded Hardware Configuration
� Comprises several nodes connected by a communications network
� Significant - presence of sensors, actuators, displays, precise clocks & timers
20Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� 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
ELCT 912: Advanced embedded Systems Winter 2011
Generic Embedded Hardware Configuration
21Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
Generic network
Generic node
ELCT 912: Advanced embedded Systems Winter 2011
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
22Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� 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
ELCT 912: Advanced embedded Systems Winter 2011
Software Life-cycle of Embedded Systems
� Life Cycle - similar to standard software engineering
� Classified into six sequential phases or tasks1. Concept - determination of project needs & goals2. Requirements - what the software must do3. Design - how S/W will meet its requirements
23Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
3. Design - how S/W will meet its requirements4. Implementation - programming the application5. Testing - set of independently developed test cases are
used to verify that system meets requirements6. Maintenance - additions, deletions & modifications due
to changing conditions
� Feedback loops connect the phasesELCT 912: Advanced embedded Systems Winter 2011
Concept Phase
� Determine project goals & needs - driven by customer input, technology changes & marketing decisions
� Includes feasibility studies
24Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� Includes feasibility studies
� By-product of stage - often a white paper, detailing what to build, and justifying the project & its feasibility
ELCT 912: Advanced embedded Systems Winter 2011
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
25Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
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,
26Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
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
27Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
Design Phase – Major Tasks
� Partition system into modules whose implementation is clear
� Allocate modules to H/W or S/W
� Prepare detailed design document
28Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� Prepare detailed design document
� Develop specific test cases
ELCT 912: Advanced embedded Systems Winter 2011
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
29Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
development
� Major Tasks –� Code S/W & build H/W modules� Debug S/W & H/W and integrate modules� Developed automated test cases
ELCT 912: Advanced embedded Systems Winter 2011
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
30Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
Maintenance Phase
� Phase consists of:� Product deployment� Customer support� Continuing system error correction� Release control
31Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� 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 importanceELCT 912: Advanced embedded Systems Winter 2011
Embedded System Architecture
FPGA/ASIC Memory
CPUADC DAC
Software
Sensors Actuators
32Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
Microcontroller
Diagnostic Tools
Human Interface
Auxiliary Systems (Power, Cooling)
Electro-mechanical backup & Safety
External Environment
ELCT 912: Advanced embedded Systems Winter 2011
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
33Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
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
ELCT 912: Advanced embedded Systems Winter 2011
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.
34Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
compositional design.
� Traditional sequential programming languages are not the best way to describe concurrent, timed systems.
ELCT 912: Advanced embedded Systems Winter 2011
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.
35Dr. Mohamed Abd el Ghany Department of Electronics and Electrical Engineering
� Have to consider interaction with hardware interfaces,
� Software design cycle same as standard SE with added complexity
� Efficient implementation important for many embedded devices.
ELCT 912: Advanced embedded Systems Winter 2011