embedded systems · 1 - 21. reactivity & timing. embedded systems are often reactive: reactive...

54
© Jan Beutel / Lothar Thiele Computer Engineering and Networks Laboratory Embedded Systems 1 - Introduction

Upload: others

Post on 19-Jan-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

© Jan Beutel / Lothar ThieleComputer Engineering and Networks Laboratory

Embedded Systems1 - Introduction

Page 2: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 2

Lecture Organization

Page 3: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 3

OrganizationWWW: https://www.tec.ee.ethz.ch/education/lectures/embedded-systems.htmlLecture: Jan Beutel <[email protected]>Coordination: Zimu Zhou <[email protected]>References:

P. Marwedel: Embedded System Design, Springer, ISBN 978-3-319-56045-8, 2018. G.C. Buttazzo: Hard Real-Time Computing Systems. Springer Verlag, ISBN 978-1-4614-

0676-1, 2011. Edward A. Lee and Sanjit A. Seshia: Introduction to Embedded Systems, A Cyber-

Physical Systems Approach, Second Edition, MIT Press, ISBN 978-0-262-53381-2, 2017. M. Wolf: Computers as Components – Principles of Embedded System Design. Morgan

Kaufman Publishers, ISBN 978-0-128-05387-4, 2016.

Sources: The slides contain ideas and material of J. Rabaey, K. Keuzer, M. Wolf, P. Marwedel, P. Koopman, E. Lee, P. Dutta, S. Seshia, and from the above cited books.

Page 4: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 4

Further Material

Page 5: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 5

What will you learn? Theoretical foundations and principles of the analysis and design of embedded

systems. Practical aspects of embedded system design, mainly software design.

The course has three components: Lecture: Communicate principles and practical aspects of embedded systems. Exercise: Use paper and pencil to deepen your understanding of analysis and

design principles . Laboratory (ES-Lab): Introduction into practical aspects of embedded systems

design. Use of state-of-the-art hardware and design tools.

Page 6: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 6

When and where?

Page 7: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 7

Laboratory exercises will be conducted in teams of 2 people. Due to the large number of students there will be two consecutive ES Lab sessions: Mon. 15-17h ETZ D61.1/2, ETZ D96 Mon. 17-19h ETZ D61.1.2

Please signup for the labgroup on the signup sheet in the lecture.

Pick up a TI MSP432 Launchpad development kit On loan for the semester

Please register for the Lab!

Page 8: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 8

What you get after the break …

Page 9: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 9

Be careful and please do not …

Page 10: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 10

You have to return the board at the end!

Page 11: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 11

Embedded Systems - Impact

Page 12: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 12

• Often, the main reason for buying is not information processing

Embedded systems (ES) = information processing systems embedded into a larger product

•Examples:

Embedded Systems

Page 13: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 13

© www.braingrid.org© www.openpr.com

Page 14: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 14

Many Names – Similar Meanings

© Edward Lee

Page 15: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 15

The Hype Cycle

© Gartner Inc.https://www.gartner.com

Peak of Inflated Expectations

Page 16: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 16

The Hype Cycle

© Gartner Inc.https://www.gartner.com

Internet of Things

Connected Home

Edge Computing

Sensors and Interfaces

Page 17: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 17

Manyika, James, et al. Disruptive technologies: Advances that will transform life, business, and the global economy. Vol. 180. San Francisco, CA: McKinsey Global Institute, 2013.

Embedded Systems are an essential component

Page 18: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 18

Embedded System

physical/biological/socialprocesses

observing influencing

reasoningdecidingbig data

CYBERWORLD

PHYSICALWORLD

Nature

Hardware &Software

Computation

Communication

Embedded System

Use feedback to influence the dynamics of the physical world by taking smart decisions in the cyber world

Page 19: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 19

Predictability & Dependability

“It is essential to predict how a CPS is going to behave under any circumstances […] before it is deployed.”Maj14

“CPS must operate dependably, safely, securely, efficiently and in real-time.”Raj10

Maj14 R. Majumdar & B. Brandenburg (2014). Foundations of Cyber-Physical Systems. Raj10 R. Rajkumar et al. (2010). Cyber-Physical Systems: The Next Computing Revolution.

CPS = cyber-physical system

Page 20: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 20

Efficiency & Specialization Embedded systems must be efficient:

Energy efficient Code-size and data memory efficient Run-time efficient Weight efficient Cost efficient

Embedded Systems are often specialized towards a certain application or application domain: Knowledge about the expected behavior and the system environment at design

time is exploited to minimize resource usage and to maximize predictability and reliability.

Page 21: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 21

Reactivity & TimingEmbedded systems are often reactive:

Reactive systems must react to stimuli from the system environment :

„A reactive system is one which is in continual interaction with is environment and executes at a pace determined by that environment“ [Bergé, 1995]

Embedded systems often must meet real-time constraints: For hard real-time systems, right answers arriving too late are wrong. All other

time-constraints are called soft. A guaranteed system response has to be explained without statistical arguments.

„A real-time constraint is called hard, if not meeting that constraint could result in a catastrophe“ [Kopetz, 1997].

Page 22: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 22

ComparisonEmbedded Systems:

Few applications that are known at design-time.

Not programmable by end user.

Fixed run-time requirements (additional computing power often not useful).

Typical criteria: cost power consumption size and weight dependability worst-case speed

General Purpose Computing Broad class of applications.

Programmable by end user.

Faster is better.

Typical criteria: cost power consumption average speed

Page 23: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 23

Lecture Overview

1. Introduction to Embedded Systems2. Software Development3. Hardware-Software Interface4. Programming Paradigms5. Embedded Operating Systems6. Real-time Scheduling7. Shared Resources8. Hardware Components9. Power and Energy

10. Architecture Synthesis

Software

Hardware

Hardware-Software

Page 24: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 24

Components and Requirements by Example

Page 25: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 25

Page 26: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 26

Page 27: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 27

Page 28: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 28

Components and Requirements by Example- Hardware System Architecture -

Page 29: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 29

High-Level Block Diagram Viewlow power CPU• enabling power to the rest of the system• battery charging and voltage

measurement• wireless radio (boot and operate)• detect and check expansion boards

higher performance CPU• sensor reading and motor control• flight control• telemetry (including the battery voltage)• additional user development• USB connection

UART: • communication protocol (Universal

Asynchronous Receiver/Transmitter)• exchange of data packets to and from

interfaces (wireless, USB)

Page 30: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 30

High-Level Block Diagram Viewsensor boardAcronyms:

• Wkup: Wakeup signal• GPIO: General-purpose input/output

signal• SPI: Serial Peripheral Interface Bus• I2C: Inter-Integrated Circuit (Bus)• PWM: Pulse-width modulated Signal• VCC: power-supply

EEPROM: • electrically erasable programmable

read-only memory• used for firmware (part of data and

software that usually is not changed, configuration data)

• can not be easily overwritten in comparison to Flash

Flash memory: • non-volatile random-access memory

for program and data

Page 31: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 31

Page 32: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 32

High-Level Physical View

Page 33: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 33

High-Level Physical View

Page 34: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 34

Low-Level Schematic Diagram View

(1 page out of 3)

LEDs

Page 35: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 35

Low-Level Schematic Diagram View

(1 page out of 3) Motors

Page 36: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 36

High-Level Software View The software is built on top of a real-time operating system “FreeRTOS”. We will use the same operating system in the ES-Lab … .

Page 37: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 37

High-Level Software View

The software architecture supports

real-time tasks for motor control (gathering sensor values and pilot commands, sensor fusion, automatic control, driving motors using PWM (pulse width modulation, … ) but also

non-real-time tasks (maintenance and test, handling external events, pilot commands, … ).

Page 38: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 38

High-Level Software ViewThe software architecture supports

real-time tasks for motor control (gathering sensor values and pilot commands, sensor fusion, automatic control, driving motors using PWM (pulse width modulation, … ) but also

non-real-time tasks (maintenance and test, handling external events, pilot commands, … ).

Control System: PID controller (proportional–integral–derivative)

sensors

motors

pilot commands(from wireless interface)

update frequencies (periodic task execution)

Page 39: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 39

Block diagram of the stabilization system:

High-Level Software View

sensor reading & analog-digital

conversionon sensor

component

transfer to processor

cleaning and preprocessing automatic control

information extraction from

sensorsactuation

Page 40: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 40

Components and Requirements by Example- Processing Elements -

Page 41: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 41

What can you do to increase performance?

Page 42: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 42

From Computer Engineering

2015

Intel 62-Core Xeon Phi

Page 43: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 43

From Computer Engineering

AMD multicore RYZEN

Page 44: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 44

From Computer Engineering

Intel Xeon Phi 7290(8 Billion transistors,

14nm technology, ~ 650mm2 area,

1.5 GHZ clock frequency)

Page 45: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 45

What can you do to decrease power consumption?

Page 46: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 46

Embedded Multicore ExampleRecent developments:

Specialize multicore processors towards real-time processing and low power consumption

Target domains:

Page 47: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 47

Why does higher parallelism help in reducing power?

Page 48: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 48

System-on-ChipSamsung Galaxy S6

– Exynos 7420 System on a Chip (SoC)– 8 ARM Cortex processing cores

(4 x A57, 4 x A53)– 30 nanometer: transistor gate width

•Exynos 5422

Page 49: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 49

How to manage extreme workload variability?

Page 50: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 50

ARM big.LITTLE Architecture

Toradex Colibri Compute-on-Module

Page 51: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 51

Components and Requirements by Example- System Trends -

Page 52: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 52

Bell’s Law: New class of Computers Emerges Every 10 Years

•Ever cheaper, ever smaller, ever more networked, tighter integrated edge devices…

•Streaming information to/from the physical

world:

• Smart Dust• Sensor Networks• Cyber-Physical

Systems• Internet-of-Things

Page 53: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 53

Zero Power Systems and Sensors

IEEE Journal of Solid-State Circuits, April 2017, 961-971.

IEEE Journal of Solid-State Circuits, Jan 2013, 229-243.

Page 54: Embedded Systems · 1 - 21. Reactivity & Timing. Embedded systems are often reactive: Reactive systems must react to stimuli from the system environment : „A reactive system is

1 - 54

Trends … Embedded systems are communicating with each other, with servers or with the cloud.

Communication is increasingly wireless.

Higher degree of integration on a single chip or integrated components: Memory + processor + I/O-units + (wireless) communication. Use of networks-on-chip for communication between units. Use of homogeneous or heterogeneous multiprocessor systems on a chip (MPSoC). Use of integrated microsystems that contain energy harvesting, energy storage, sensing,

processing and communication (“zero power systems”). The complexity and amount of software is increasing.

Low power and energy constraints (portable or unattended devices) are increasingly important, as well as temperature constraints (overheating).

There is increasing interest in energy harvesting to achieve long term autonomous operation.