outline - brandon luciaa bug in an intermittent program main {while (true) {m, n =...
TRANSCRIPT
Outline
Energy-harvesting devices
Debugging intermittent programs
Energy-interference-free Debugger (EDB)
Evaluation: debugging with EDB
Related work and conclusion●
2
Anatomy of an Energy-Harvesting Computer
4
Energy Harvester Processor
Energy Harvesting DeviceEnergy Source
Capacitor
A Bug in an Intermittent Program
main { while (TRUE) {
m, n = get_last_two_elements(fib_list) append_element(fib_list, m + n) }}
Source Code: fibonacci.c
7
1 1
Expected program state Time Observed program state
Non-volatilememory
fib_list
1 1 2
1 1 2 3
1 1 2 3 5
tail
A Bug in an Intermittent Program
main { while (TRUE) {
m, n = get_last_two_elements(fib_list) append_element(fib_list, m + n) }}
Source Code: fibonacci.c
8
1 1 1 1
Expected program state Time Observed program state
Non-volatilememory
fib_list
1 1 2 1 1 2
1 1 21 1 2 3
1 1 2 3 5 1 1 2 3 8
3
tail
A Bug in an Intermittent Program
main { while (TRUE) {
m, n = get_last_two_elements(fib_list) append_element(fib_list, m + n) }}
Source Code: fibonacci.c
9
1 1 1 1
Expected program state Time Observed program state
Non-volatilememory
fib_list
1 1 2 1 1 2
1 1 21 1 2 3
1 1 2 3 5 1 1 2 3 8
3
implementation is not correct if interruptedtail
reboot
Debugging an Intermittent Program
Option Clog events on device
Option AJTAG debugger
Option BOscilloscope
10
Debugging an Intermittent Program
JTAG
gdb>WISP
Option Clog events on device
Option AJTAG debugger
Option BOscilloscope
Hides bugs
11
Debugging an Intermittent Program
JTAG
gdb>WISP WISP
Option Clog events on device
Option AJTAG debugger
Option BOscilloscope
Hides bugs No program state
12
Debugging an Intermittent Program
JTAG
gdb> WISPWISP WISP
Option Clog events on device
Option AJTAG debugger
Option BOscilloscope
13
Costs energy and spaceHides bugs No program state
Debugging an Intermittent Program
JTAG
gdb> WISPWISP WISP
Option Clog events on device
Option AJTAG debugger
Option BOscilloscope
14
EDB
Passiv
e
Inte
r-fe
renc
e -fr
e e
Interactive
Costs energy and spaceHides bugs No program state
Our main contribution is the design and implementation of EDB, an energy-interference-free debugger for intermittent energy-harvesting platforms.
EDB: Energy-interference-free Debugger
Energy-harvestingdevice
EDB
En
erg
y
Implementation possibilities:
● off board● on board● in silicon
15
Energy-harvesting Device
EDBMCU
Digital Level Shifters
USB host
Charge / Discharge Analog
Buffers
Vre
g
Vca
p
RFI
D I/O
Inte
rru
pt
Code M
ark
ers
UA
RT
EDB Capabilities
Passive
Trace energy level
Trace program events
Decode I/O messages
16
Active
Save energy level
Set energy level
Supply power
Mechanisms
EDB is energy-interference-free
Properties
2.0 2.5 3.0 3.5 4.0 4.5 5.01.7
1.8
1.9
2.0
2.1
2.2
2.3
2.4
Time (s)
Capa
Cap
aci
tor
Volt
ag
e (
V)
EDB Joins Energy and Program Events
EDB enables new debugging primitives
> break at line 42> break at voltage 1.85V> runBREAKPOINT at line 42, V=2.05V
> continueBREAKPOINT at line 64, V=1.85V
EDB console
Energy-awareWatchpoints
EnergyGuards
I/OMonitors
Keep-aliveAssertions
Energy State Program State
17
Outline
Energy-harvesting devices
Debugging intermittent programs
Energy-interference-free Debugger (EDB)
Evaluation: debugging with EDB
Related work and conclusion●
18
Evaluation Roadmap
Case studies: applying EDB to debugging tasks
● (I) Zero-cost instrumentation● (II) Keep-alive assertions● (III) I/O monitoring
Quantifying energy-interference
● Leakage current● Save-restore resolution
19
Evaluation Case-Study (I):Zero-cost Instrumentation
Program: generate a list of Fibonacci values
main:
while True: append(list, value)
broken_fibonacci.c
20
Evaluation Case-Study (I):Zero-cost Instrumentation
Program: generate a list of Fibonacci values
Problem: invalid values observed on harvested energy●
main:
while True: append(list, value)
broken_fibonacci.c
1 1 2 3 8
21
Evaluation Case-Study (I):Zero-cost Instrumentation
Program: generate a list of Fibonacci values
Problem: invalid values observed on harvested energy●
Approach: add an invariant check
main:
while True: append(list, value)
broken_fibonacci.c
ni = n
i-2 + n
i-1
1 1 2 3 8
22
Evaluation Case-Study (I):Zero-cost Instrumentation
Program: generate a list of Fibonacci values
Problem: invalid values observed on harvested energy●
Approach: add an invariant check
main:
while True: append(list, value)
broken_fibonacci.c
for value in list: assert(value is valid)
ni = n
i-2 + n
i-1
1 1 2 3 8
} invariant check on reboot
23
2.0
2.5
Loop
40 50 60 70 80 90 100
Volt
age (
V) 3.0
+ 40 + 50 + 60 + 70 + 80 + 90 + 100
Time (ms)
...
Evaluation Case-Study (II):Keep-Alive Assertions
main:
while True: append(...)
broken_fibonacci.c
26
unexpectedbehavior
main loopruns
Without EDB
later
Without EDB
2.0
2.5
Loop
40 50 60 70 80 90 100
Volt
age (
V) 3.0
+ 40 + 50 + 60 + 70 + 80 + 90 + 100
Time (ms)
...
Evaluation Case-Study (II):Keep-Alive Assertions
main:
while True: append(...)
broken_fibonacci.c
27
unexpectedbehavior
main loopruns
Without EDB
later
Without EDB
2.0
2.5
Loop
40 50 60 70 80 90 100
Volt
age (
V) 3.0
+ 40 + 50 + 60 + 70 + 80 + 90 + 100
Time (ms)
...
Evaluation Case-Study (II):Keep-Alive Assertions
main:
while True: append(...) assert(...)
broken_fibonacci.c
28
unexpectedbehavior
main loopruns
Without EDB
later
Without EDB
Diagnosis strategy
2.0
2.5
Loop
LoopLoop
40 50 60 70 80 90 100
2.0
2.5
3.0
Volt
ag
e (
V)
Volt
ag
e (
V)
Time (ms)
3.0
+ 40 + 50 + 60 + 70 + 80 + 90 + 100
1
Tethered power
...
...
Evaluation Case-Study (II):Keep-Alive Assertions
main:
while True: append(...) assert(...)
broken_fibonacci.c
29
EDB keep-alive assert brings the familiar primitive to energy-harvesting platforms.
Assertfailed
Interactivesession
Diagnosis strategy
With EDB
later
Without EDB
later
Without EDB
With EDB
unexpectedbehavior
main loopruns
1.6
1.8
2.0
2.2
2.4
3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0
RSP_GENERIC
CMD_QUERY
CMD_QUERYREP
5.10 5.15 5.20 5.25
Time (s)
RSP_GENERIC
CMD_QUERY
Volt
ag
e (
V)
Mess
ag
e ID
Evaluation Case-Study (III):Monitoring of RFID I/O
REQUESTS
REPLIES
EDB I/O monitorenables protocoldebugging.
corr
elat
ed
energy level
I/O
30
Messages that reached the device
Energy state
Evaluation Roadmap
Case studies: applying EDB to debugging tasks
● (I) Zero-cost instrumentation● (II) Keep-alive assertions● (III) I/O monitoring
Quantifying energy-interference
● Leakage current● Save-restore resolution
31
Evaluation: Energy-interference:Worst-case Leakage Current
Energy Level Sense & Set
Program Event Monitoring
EDB-TargetInterop
I/OMonitoring
Ileak
≤ 850 nA⋍ 0.4% of min. MCU current
32
MCU MCU\Code Markers
Power System
Charge Monitor
Drain
n
InterruptCmd Interface
I/O Device #1
I/O Device #d
Monitor Rx/Tx
Monitor Rx/Tx
RF In
DC+
-
I/O Monitoring Program Event Monitoring
EDBEnergy-harvesting
device
Debugger-Target Interop
Energy Monitoring & Manipulation
Sources of leakage current
Time (s)
Cap
aci
tor
Volt
ag
e (
V)
Save to 1.8V, tether at 2.3V, restore to 1.8V
Evaluation: Energy-interference:Save-Restore Accuracy
∆V error
EDB saves andrestores energylevel with a finiteprecision, limitedby hardware.
∆V = 54 mV ≋ 4% of energy capacity on WISP device (47µF)
33
Save energy level
Restore energy level
Tetherpower
Related Work
Intermittent computing
Emulation and simulation of energy sources
Debugging battery-powered wireless sensor nodes
Ekho [J. Hester, T. Scott, J. Sorber. SenSys ’14]
CRFID Crash Test Sim [J. Gummeson, S. Clark, K. Fu, D. Ganesan. MobiSys ’10]
Clairvoyant [J. Yang, M. L. Soffa, L. Selavo, K. Whitehouse. SenSys ’07]
Mementos [B. Ransford, J. Sorber, K. Fu. ASPLOS '11]
DINO [B. Lucia, B. Ransford. PLDI '15]
34
Conclusion
35
Energy-interference-free Debugger (EDB) is the first system to bring advanced debugging capabilities
to intermittent energy-harvesting platforms.
http://intermittent.systems/