11
TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC) Fifth Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003

TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

  • View
    223

  • Download
    7

Embed Size (px)

Citation preview

Page 1: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

TinyGALS: A Programming Model for Event-Driven Embedded Systems

Elaine CheongUC Berkeley Ptolemy Group / PARC

Judy Liebman (LLNL)Jie Liu, Feng Zhao (PARC)

Fifth Biennial Ptolemy MiniconferenceBerkeley, CA, May 9, 2003

Page 2: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Introduction Embedded software architecture today

Inherited from writing device drivers and optimizing assembly code.

Poor scalability. Poor common infrastructure. Poor resource management.

Embedded software architecture tomorrow

Reusable, reconfigurable components. Easy to use. Fast prototyping. Software synthesis

Page 3: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Motivation

Application characteristicsAd-hoc networked embedded systemsLow-powerUnstructured, unsynchronized eventsCollaborative nodes

Local communication (peer-to-peer)Global communication (ad-hoc routing)

Page 4: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Example: Sensor Networks

Base

Sensing motes

Page 5: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

TinyGALS

POT

Clock logic

CLOCK

Get sensor data

PHOTO

sensing

clock Send local data

GENERIC_COMM

Send BLESS mesg

BLESS send

Receive packets

GENERIC_COMM

receiving

Update local data

init

init

initinit

start

global_nodedata;global_parent_id;

BLESS receive

GENERIC_COMM

BLESS forward

GENERIC_COMM

Update Routing Table

Routing Table

Page 6: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

TinyGALS Architecture

initComponent

Module A

__________________________________________________________________________________________________________________ outportA1

SynchronousCommunication

Component

Module B

ComponentinportB1

AsynchronousCommunication

Scheduler

EventQueue

start

TinyGUYSglobal name

SynchronousRead

AsynchronousWrite

Guarded Variable

TinyGUYSlocal name

Globally Asynchronous Locally Synchronous

Guarded Yet Synchronous

Page 7: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Software Synthesis

app_start()

app_init()

init

Module B

start

Module A

EventQueue

PARAM_PUT()

PARAM_GET()data

structures

A_out1()

B_in1_put()BCOMP1_INPUT()

data structures

Scheduler

Page 8: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Target Tracking Example:Before and After…

MAIN

TARGET_TRACKING

CLOCK

GENERIC_COMM

BLESS

Init

Clock

Send

Send done

LEDS

Send

Send done

Receive channel 8S

end

Send done

Receive channel 7

Init

Init Start

Init

Fire event

On Off

PHOTO

Init

Get data

Data ready

POT

Clock logic

CLOCK

Get sensor data

PHOTO

sensing

clock Send local data

GENERIC_COMM

Send BLESS mesg

BLESS send

Receive packets

GENERIC_COMM

receiving

Update local data

init

init

initinit

start

global_nodedata;global_parent_id;

BLESS receive

GENERIC_COMM

BLESS forward

GENERIC_COMM

Update Routing Table

Routing Table

OS View (TinyOS) TinyGALS View

Page 9: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Memory Usage

Code Size Scheduler Target counting application

TinyOS 86 bytes 19929 bytes

TinyGALS 112 bytes 24750 bytes

Page 10: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Future Work

Port to NesC language (TinyOS).Implement as Ptolemy domain?

Compare to CI domain.Blocking write: retry when queue is full.Priority scheduling algorithm with queue

insertions.Run-time reconfigurability of modules.Heterarchy: distributed multi-tasking.

Page 11: TinyGALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong UC Berkeley Ptolemy Group / PARC Judy Liebman (LLNL) Jie Liu, Feng Zhao (PARC)

Conclusions

TinyGALS provides a globally asynchronous, locally synchronous model of computation for event-driven embedded software.

Allows reuse of software components. TinyGUYS provides protected, quick access to

global data. Software synthesis tools created to generate

communication and scheduling code.

http://ptolemy.eecs.berkeley.edu/papers/03/TinyGALS/