Tiny GALS A Programming Model for EventDriven Embedded
Tiny. GALS: A Programming Model for Event-Driven Embedded Systems Elaine Cheong, Judy Liebman University of California, Berkeley Jie Liu, Feng Zhao Palo Alto Research Center ACM Symposium on Applied Computing Melbourne, FL, March 9 -12, 2003
Introduction l Embedded software architecture today l l l Inherited from writing device drivers and optimizing assembly code. Poor scalability. Poor common infrastructure. Poor resource management. Embedded software architecture tomorrow l l Reusable, reconfigurable components. Easy to use. Fast prototyping. Software synthesis
Motivation l Application characteristics Ad-hoc networked embedded systems l Low-power l Unstructured, unsynchronized events l Collaborative nodes l Local communication (peer-to-peer) l Global communication (ad-hoc routing) l
Example: Sensor Networks Sensing motes Base
Tiny. GALS global_nodedata; global_parent_id; sensing clock Get sensor data init POT Send local data init PHOTO Clock logic GENERIC_COMM receiving start CLOCK Receive packets Update local data init GENERIC_COMM Update Routing Table BLESS send Send BLESS mesg BLESS receive GENERIC_COMM BLESS forward Routing Table GENERIC_COMM
Tiny. GALS Architecture Guarded Yet Synchronous Guarded Variable Asynchronous Synchronous Write Read Tiny. GUYS global name Scheduler Event Queue Globally Asynchronous Locally Synchronous Module A Module B Tiny. GUYS local name init start Component ___________________ ___________________ Synchronous Communication Component outport. A 1 inport. B 1 Asynchronous Communication Component
Software Synthesis data structures PARAM_GET() Scheduler data structures Event Queue PARAM_PUT() Module A Module B app_init() init start app_start() A_out 1() B_in 1_put() BCOMP 1_INPUT()
Target Tracking Example: Before and After… OS View (Tiny. OS) Tiny. GALS View global_nodedata; global_parent_id; sensing MAIN clock Init Start init TARGET_TRACKING Off LEDS GENERIC_COMM init POT Receive channel 8 Send done BLESS Send done Receive channel 7 Send PHOTO Send Clock Init Data ready Get data Init Fire event Init Send done On CLOCK Get sensor data Send local data init PHOTO Clock logic GENERIC_COMM receiving start CLOCK Receive packets Update local data init GENERIC_COMM Update Routing Table BLESS send Send BLESS mesg BLESS receive GENERIC_COMM BLESS forward Routing Table GENERIC_COMM
Memory Usage Scheduler code size Tiny. OS Tiny. GALS 86 bytes 112 bytes Sizes of generated functions (bytes) app_init() app_start() A_out() B_in_put() Sizes of generated variables (bytes) 58 6 12 160 eventqueue_head 2 params 2 entrypoints 2 eventqueue_count 2 eventqueue 100 104 BCOMP 1_FIRE() 98 ports A_param_PARAM_GET() 10 params_buffer_flag 1 A_param_PARAM_PUT() 16 params_buffer 2
Conclusions Tiny. GALS provides a globally asynchronous, locally synchronous model of computation for event-driven embedded software. l Allows reuse of software components. l Tiny. GUYS provides protected, quick access to global data. l Software synthesis tools created to generate communication and scheduling code. l
Future Work l Blocking write: retry when queue is full. l Priority scheduling algorithm with queue insertions. l Run-time reconfigurability of modules. l Heterarchy: distributed multi-tasking.
- Slides: 11