03.08.2013 Views

Design and Implementation of TinyGALS: A Programming Model for ...

Design and Implementation of TinyGALS: A Programming Model for ...

Design and Implementation of TinyGALS: A Programming Model for ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 The <strong>TinyGALS</strong> <strong>Programming</strong> <strong>Model</strong><br />

<strong>TinyGALS</strong> is based on a model <strong>of</strong> computation that contains globally asynchronous <strong>and</strong><br />

locally synchronous communication. We use this architecture to separate the rates <strong>of</strong> con-<br />

trol <strong>of</strong> the system – the reactive part <strong>and</strong> the computational part – via asynchrony. Thus,<br />

the system can finish reacting to an event without having to wait until full processing <strong>of</strong><br />

any tasks related to the event completes. Processing can be deferred until a time at which<br />

the system is not busy reacting to events.<br />

A <strong>TinyGALS</strong> program contains a single application composed <strong>of</strong> modules, which are<br />

in turn composed <strong>of</strong> components. Execution in <strong>TinyGALS</strong> is driven by events. In Tiny-<br />

GALS, there are three types <strong>of</strong> events: (1) a hardware interrupt, (2) the transfer <strong>of</strong> control<br />

flow between two components via a method call, <strong>and</strong> (3) a message passed between two<br />

modules, whose data is encapsulated as a token. In the third case, we sometimes use the<br />

terms event <strong>and</strong> token interchangeably.<br />

We first present a simple example <strong>and</strong> provide an in<strong>for</strong>mal, intuitive description <strong>of</strong> the<br />

<strong>TinyGALS</strong> architecture. We then describe each <strong>of</strong> the language constructs (components,<br />

modules, <strong>and</strong> application) <strong>and</strong> their semantics.<br />

2.1 Introduction: An Example<br />

count_start<br />

Module count Module leds<br />

init()<br />

init COUNTER<br />

init()<br />

fire()<br />

CLOCK<br />

fireOut()<br />

fireOut()<br />

count_out<br />

leds_in<br />

init<br />

fire()<br />

init()<br />

Figure 1: An example application with two modules.<br />

6<br />

INT_TO_LEDS

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!