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.

nondeterministic component firing order.<br />

Let us first assume that both module input ports <strong>and</strong> module output ports are totally<br />

ordered (we assign the order to be the same as the order specified in the ports in <strong>and</strong><br />

ports out sections <strong>of</strong> the module definition file). However, we assume that compo-<br />

nents are not ordered. As discussed earlier, the configuration <strong>of</strong> components inside <strong>of</strong> a<br />

module must not contain cycles <strong>and</strong> must follow the rules above regarding source <strong>and</strong> trig-<br />

gered DAGs. Then module input ports may either be associated with one method <strong>of</strong> a<br />

single component C (in ACCEPT SC) or with one or more module output ports. Likewise,<br />

outgoing component methods (USES) may be associated with either one method <strong>of</strong> a sin-<br />

gle component C (in ACCEPT SC) or with one or more module output ports. 10 Incoming<br />

component methods (ACCEPT S) may be associated with any number or combination <strong>of</strong><br />

component methods (USES) <strong>and</strong> module input ports, but they may not be associated with<br />

module output ports. Likewise, module output ports may be associated with any number<br />

or combination <strong>of</strong> outgoing component methods (USES) <strong>and</strong> module output ports.<br />

If neither module input ports nor module output ports are ordered, then module input<br />

ports <strong>and</strong> outgoing component methods may only be associated with either a single method<br />

or with a single output port.<br />

In Figure 4, the connection section at the bottom <strong>of</strong> the module definition declares<br />

that whenever the count_start input port is triggered (which will be explained in<br />

the next section), the init() method <strong>of</strong> CLOCK will be called; whenever CLOCK calls<br />

fireOut(), the method fire() <strong>of</strong> COUNTER will be called; <strong>and</strong> whenever COUNTER<br />

calls fireOut(), an event will be produced at the count_out output port.<br />

10 In the existing TinyOS constructs, one caller (outgoing component method) can have multiple callees.<br />

The interpretation is that when the caller calls, all the callees will be called in a possibly non-deterministic<br />

order. One <strong>of</strong> the callee’s return values will be returned to the caller. Although multiple callees are not part<br />

<strong>of</strong> the <strong>TinyGALS</strong> semantics, it is supported by our s<strong>of</strong>tware tools to be compatible with TinyOS.<br />

18

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

Saved successfully!

Ooh no, something went wrong!