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.

module. Tokens are placed in input port queues atomically, so other source components<br />

cannot interrupt this operation. Note that since each input port <strong>of</strong> a module M is linked to a<br />

component method, each token that arrives on any input port <strong>of</strong> M corresponds to a future<br />

invocation <strong>of</strong> the component(s) in M. When the system is not responding to interrupts or<br />

events on input ports, the system does nothing (i.e., sleeps).<br />

The <strong>TinyGALS</strong> semantics do not define exactly when the input port is triggered. We<br />

discuss the ramifications <strong>of</strong> token generation order on the determinacy <strong>of</strong> the system in<br />

Section 3. Our current implementation processes the tokens in the order that they are<br />

generated as defined by the hardware clock. Tokens generated at the same logical time<br />

are ordered according to the global ordering <strong>of</strong> module input ports, which we discuss next.<br />

The runtime system maintains a global event queue which keeps track <strong>of</strong> the tokens in<br />

all module input port queues in the system. Currently, the runtime system activates the<br />

modules corresponding to the tokens in the global event queue using FIFO scheduling.<br />

More sophisticated scheduling algorithms can be added, such as ones that take care <strong>of</strong><br />

timing <strong>and</strong> energy concerns.<br />

In the previous section, we discussed limitations on the configuration <strong>of</strong> links between<br />

components within a module. Connections between modules are much less restrictive.<br />

Cycles are allowed between modules. This does not lead to reentrancy problems because<br />

the queue on a module input port acts as a delay in the loop. Module output ports may be<br />

connected to one or more module input ports, <strong>and</strong> module input ports may be connected<br />

to one or more module output ports. The single-output-multiple-input connection acts as<br />

a <strong>for</strong>k. For example, in Figure 10, every token produced by A_out will be duplicated<br />

<strong>and</strong> trigger both B_in <strong>and</strong> C_in. Tokens that are produced at the same “time”, as in the<br />

previous example, are processed with respect to the global input port ordering. Input ports<br />

are first ordered by module order, as they appear in the application configuration file, then in<br />

the order in which they are declared in the module configuration file. The multiple-output-<br />

single-input connection has a merge semantics, such that tokens from multiple sources are<br />

merged into a single stream in the order that the tokens are produced. This type <strong>of</strong> merge<br />

does not introduce any additional sources <strong>of</strong> nondeterminacy. See Section 3 <strong>for</strong> a discussion<br />

20

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

Saved successfully!

Ooh no, something went wrong!