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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Note that the code executed upon component activation may call other methods in the<br />

same component or in a linked component. Component execution also includes execution<br />

<strong>of</strong> all external code until control returns <strong>and</strong> execution <strong>of</strong> the code body has completed.<br />

Definition 4 (Module iteration). An iteration <strong>of</strong> a module M is the execution <strong>of</strong> a subset<br />

<strong>of</strong> the components inside <strong>of</strong> M in response to either an interrupt or an event.<br />

We define these two types <strong>of</strong> module iterations in more detail, including what we mean<br />

by “subset <strong>of</strong> components”.<br />

Definition 4.1 (Module iteration in response to an interrupt). Suppose module M is<br />

iterated in response to interrupt I. Let C be the component corresponding to interrupt I.<br />

Recall from Section 2.3.2 that C there<strong>for</strong>e must be a source component. Create a source<br />

DAG D by starting with C <strong>and</strong> following all <strong>for</strong>ward links between C <strong>and</strong> other components<br />

in M. Iteration <strong>of</strong> the module consists <strong>of</strong> the execution <strong>of</strong> the components in D beginning<br />

with C. Note that iteration <strong>of</strong> the module may cause it to produce one or more events on its<br />

output port(s).<br />

Definition 4.2 (Module iteration in response to an event). Suppose module M is iterated<br />

in response to an event E stored at the head <strong>of</strong> one <strong>of</strong> its inport queues, Q. Let C be<br />

the component corresponding to Q. Recall from Section 2.3.2 that C there<strong>for</strong>e must be<br />

a triggered component. Create a triggered DAG D by starting with C <strong>and</strong> following all<br />

<strong>for</strong>ward links between C <strong>and</strong> other components in M. Iteration <strong>of</strong> the module consists <strong>of</strong><br />

the execution <strong>of</strong> the components in D beginning with C. As with the interrupt case, iteration<br />

<strong>of</strong> the module may cause it to produce one or more events on its output port(s).<br />

We can now discuss how to choose the module iteration order.<br />

Definition 5 (System execution). Given a system state <strong>and</strong> zero or more interrupts, system<br />

execution is the iteration <strong>of</strong> modules until the system reaches a quiescent state. The order<br />

in which modules are executed is the same as the order <strong>of</strong> events in the global event queue.<br />

25

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

Saved successfully!

Ooh no, something went wrong!