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 definition <strong>for</strong> count.<br />

include components{<br />

COUNTER;<br />

CLOCK;<br />

};<br />

init{<br />

COUNTER:init;<br />

};<br />

ports in{<br />

count_start;<br />

};<br />

ports out{<br />

count_out;<br />

};<br />

CLOCK:fireOut COUNTER:fire<br />

COUNTER:fireOut count_out<br />

count_start CLOCK:init<br />

Figure 4: The definition <strong>of</strong> the count module shown in Figure 1.<br />

Using the tuple notation given in Equation 2, the count module can be defined as<br />

M = (COMPONENT SM = {COUNT ER,CLOCK},<br />

INITM = [COUNT ER : init],<br />

INPORT SM = {count start},<br />

OUT PORT SM = {count out},<br />

PARAMET ERSM = /0,<br />

LINKSM = {(CLOCK : f ireOut,COUNT ER : f ire),<br />

(COUNT ER : f ireOut,count out),<br />

(count start,CLOCK : init)}).<br />

The code <strong>for</strong> the module leds is shown in Figure 5 <strong>for</strong> completeness. We will discuss<br />

the semantics <strong>of</strong> the execution <strong>of</strong> components within a module in more detail in Section<br />

2.3.3.<br />

11

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

Saved successfully!

Ooh no, something went wrong!