Towards a Reactive Model for the Power-Aware Control of an...

39
Towards a Reactive Model for the Power-Aware Control of an Embedded Platform (Work in progress. . . ) Nicolas Berthier October 23, 2009 1 / 23

Transcript of Towards a Reactive Model for the Power-Aware Control of an...

Page 1: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Towards a Reactive Model for the Power-AwareControl of an Embedded Platform

(Work in progress. . . )

Nicolas Berthier

October 23, 2009

1 / 23

Page 2: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Outline

ContextTarget platforms & applicationsProblems

Current solutionsAd-Hoc solutionsDedicated Operating SystemsConclusion

ApproachPreliminary remarksPrinciplesPros & Cons

Conclusion

2 / 23

Page 3: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Outline

ContextTarget platforms & applicationsProblems

Current solutionsAd-Hoc solutionsDedicated Operating SystemsConclusion

ApproachPreliminary remarksPrinciplesPros & Cons

Conclusion

3 / 23

Page 4: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Target platforms

I µ-ControllerI Sleep/low-power modes and fast wake-up timeI Possibly DV(F)S capable

I Radio transceiver

I Real-time clock

I Sensors (Temperature, Humidity. . . )I Battery-operated

I Possibly solar-reloadable

I . . .

4 / 23

Page 5: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Target platforms (contd.)

Energy vs. Power

I Energy-awareness: control average current consumptionI related to discharge profile

I Power-awareness: control maximum current consumptionHighly related to:

I capacityI quality (; cost)

5 / 23

Page 6: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Target applications

I Data acquisitionI PeriodicallyI On demand

I Triggering an alarm on certain events

⇒ In most cases:

I Periodic sensing of environment and/or listening radio channelI Should sleep most of the time

6 / 23

Page 7: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Target applications

I Data acquisitionI PeriodicallyI On demand

I Triggering an alarm on certain events

⇒ In most cases:

t

I Periodic sensing of environment and/or listening radio channelI Should sleep most of the time

6 / 23

Page 8: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Target applications

I Data acquisitionI PeriodicallyI On demand

I Triggering an alarm on certain events

⇒ In most cases:

t

I Periodic sensing of environment and/or listening radio channelI Should sleep most of the time

6 / 23

Page 9: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Problems: distribution

I “Chaotic” global behavior, dynamism

I Debugging

I Shelf life

I Unreliable communications

I Security

I . . .

worse and worse. . .

7 / 23

Page 10: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Problems: “embeddedness”

I Cyber-physical device: closed loop (reliable simulation...?)I Various constraints

I low speedI very small memoryI . . .

I Various peripherals

I . . .

8 / 23

Page 11: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Outline

ContextTarget platforms & applicationsProblems

Current solutionsAd-Hoc solutionsDedicated Operating SystemsConclusion

ApproachPreliminary remarksPrinciplesPros & Cons

Conclusion

9 / 23

Page 12: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Current solutions: ad-hoc solutions

Manual implementation

I Method?

I Toolchain?

I Power management?

I . . .

I Reliability?

10 / 23

Page 13: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Current solutions: dedicated Operating Systems

TinyOS

I Event-driven paradigmI All implemented in nesC

I restricted / extended CI fully component-based approach

I Compiled together with the applications

I Locks ; deadlocks

I Power management: manual & decentralized

I Available on many platforms

; tens of components needed for simple applications. . .

11 / 23

Page 14: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Current solutions: dedicated Operating Systems (contd.)

MANTIS

I Classical programming model

I Supports long-running computations

I Power management by hand

; More efficient than TinyOS when:I long idle periodsI timely processing

12 / 23

Page 15: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Current solutions: dedicated Operating Systems (contd.)

Contiki

I ExokernelI tries to reduce provided abstractionsI instead: use libraries

I Proto-threadsI event-based, stack-lessI optional preemptive multi-threading implemented as a library

I Inter-process communication: event posting

I Power-management by hand (only helped by exposing the size of theevent queue!)

13 / 23

Page 16: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Context: conclusion

⇒ No mechanism allowing global management of the platform!

14 / 23

Page 17: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Outline

ContextTarget platforms & applicationsProblems

Current solutionsAd-Hoc solutionsDedicated Operating SystemsConclusion

ApproachPreliminary remarksPrinciplesPros & Cons

Conclusion

15 / 23

Page 18: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks

I Driver ≈ Automaton — In fact, a Transducer:I Inputs = software requests & hardware interrupts / dataI Outputs = software responses & hardware requestsI Reflects the state of the associated device

I Ensuring properties of the whole platform⇒ controlling the drivers behavior

I Controller Synthesis Problem:

16 / 23

Page 19: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks

I Driver ≈ Automaton — In fact, a Transducer:I Inputs = software requests & hardware interrupts / dataI Outputs = software responses & hardware requestsI Reflects the state of the associated device

I Ensuring properties of the whole platform⇒ controlling the drivers behavior

I Controller Synthesis Problem:

16 / 23

Page 20: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks

I Driver ≈ Automaton — In fact, a Transducer:I Inputs = software requests & hardware interrupts / dataI Outputs = software responses & hardware requestsI Reflects the state of the associated device

I Ensuring properties of the whole platform⇒ controlling the drivers behavior

I Controller Synthesis Problem:

D1 D2 · · · Dn

16 / 23

Page 21: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks

I Driver ≈ Automaton — In fact, a Transducer:I Inputs = software requests & hardware interrupts / dataI Outputs = software responses & hardware requestsI Reflects the state of the associated device

I Ensuring properties of the whole platform⇒ controlling the drivers behavior

I Controller Synthesis Problem:

D1 ‖ D2 ‖ · · · ‖ Dn

16 / 23

Page 22: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks

I Driver ≈ Automaton — In fact, a Transducer:I Inputs = software requests & hardware interrupts / dataI Outputs = software responses & hardware requestsI Reflects the state of the associated device

I Ensuring properties of the whole platform⇒ controlling the drivers behavior

I Controller Synthesis Problem:

D1 ‖ D2 ‖ · · · ‖ Dn ‖ C

16 / 23

Page 23: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks

I Driver ≈ Automaton — In fact, a Transducer:I Inputs = software requests & hardware interrupts / dataI Outputs = software responses & hardware requestsI Reflects the state of the associated device

I Ensuring properties of the whole platform⇒ controlling the drivers behavior

I Controller Synthesis Problem:

D1 ‖ D2 ‖ · · · ‖ Dn ‖ C |= φ

16 / 23

Page 24: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks (contd.)

Controllable Driver

I Inputs: {reqc , requ}I Outputs: {reqc(), requ()}

reqc/ reqc ()

requ/ requ()

ok: Validation from controller

ack : Refused request handling

17 / 23

Page 25: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks (contd.)

Controllable Driver

I Inputs: {reqc , requ,ok}I Outputs: {reqc(), requ(),ack}

reqc∧ok/ reqc (),ack

/ requ()requ

ok: Validation from controller

ack : Refused request handling

17 / 23

Page 26: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: preliminary remarks (contd.)

Controllable Driver

I Inputs: {reqc , requ,ok}I Outputs: {reqc(), requ(),ack}

reqc∧ok/ reqc (),ack

/ requ()requ

ok: Validation from controller

ack : Refused request handling

17 / 23

Page 27: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: overview

HW platform

Application task(s)

SW services

HW commandsHW signals

”Reactive” kernel

18 / 23

Page 28: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: overview

HW platform

Application task(s)

SW services

HW commandsHW signals

”Reactive” kernel

Drivers Controller

18 / 23

Page 29: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: overview

HW platform

Application task(s)

SW services

HW commandsHW signals

”Reactive” kernel

Drivers Controller

18 / 23

Page 30: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: overview

HW platform

Application task(s)

SW services

HW commandsHW signals

”Reactive” kernel

Drivers Controller

Enforces globalproperties

Controllable inputs

Uncontrollable inputs

18 / 23

Page 31: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: framework

Properties

Drivers

19 / 23

Page 32: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: framework

Properties

Drivers

ControllerSynthesis

Controller

19 / 23

Page 33: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: framework

Properties

Drivers

ControllerSynthesis

Controller

Kernel

19 / 23

Page 34: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: framework

Properties

Drivers

ControllerSynthesis

Controller

Kernel Applications

Execution

19 / 23

Page 35: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: cons

Cons

I Uncontrollable combinations of platforms & properties

I Very platform-specific properties

I It is still possible to write energy-hungry applications. . . not surprisingly!

20 / 23

Page 36: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Approach: pros

Pros

I Power & Energy -aware “by construction”depending on the properties. . .

I Unchanged application layer

I Concurrency handling by the controller:; No locks ⇒ No deadlocks

I Supports long-running application tasksI Classical programming model

21 / 23

Page 37: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Outline

ContextTarget platforms & applicationsProblems

Current solutionsAd-Hoc solutionsDedicated Operating SystemsConclusion

ApproachPreliminary remarksPrinciplesPros & Cons

Conclusion

22 / 23

Page 38: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Conclusion

I Lack of global control capabilities in current tool-setsI Most often too hard to implement

I Global control of the platformI Concurency handlingI Power & Energy management

I Towards a “Real-Energy Programming” paradigm

I Proof-of-concept implementation (in progress)I Realistic application

23 / 23

Page 39: Towards a Reactive Model for the Power-Aware Control of an ...semba.conf.citi-lab.fr/semba09/Presentations/BERTHIER_Nicolas.pdf · Towards a Reactive Model for the Power-Aware Control

Thank you

Questions ?

24 /—