Transcript PPT
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 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 Motivation Application characteristics Ad-hoc networked embedded systems Low-power Unstructured, unsynchronized events Collaborative nodes Local communication (peer-to-peer) Global communication (ad-hoc routing) Example: Sensor Networks Sensing motes Base TinyGALS global_nodedata; global_parent_id; sensing clock Get sensor data init 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 TinyGALS Architecture Guarded Yet Synchronous Guarded Variable Asynchronous Synchronous Write Read TinyGUYS global name Scheduler Event Queue Globally Asynchronous Locally Synchronous Module A Module B TinyGUYS local name init start Component ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ Synchronous Communication Component outportA1 inportB1 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_out1() B_in1_put() BCOMP1_INPUT() Target Tracking Example: Before and After… OS View (TinyOS) TinyGALS View global_nodedata; global_parent_id; sensing MAIN clock Init Init Start init TARGET_TRACKING BLESS LEDS Send done Receive channel 7 Send PHOTO Off GENERIC_COMM init POT Receive channel 8 Send Send done Send Clock Init Init Data ready Get data 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 Code Size Scheduler Target counting application TinyOS 86 bytes 19929 bytes TinyGALS 112 bytes 24750 bytes 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. 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/