29.01.2015 Views

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

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.

<strong>Software</strong> Architectural Trans<strong>for</strong>mations 473<br />

Device drivers are represented by a parallelogram (e.g., the timer <strong>de</strong>vice<br />

driver in Figure 34-3).<br />

Application processes are represented by an ellipse with an arrow on the<br />

perimeter (e.g., process read_heart_rate in Figure 34-3). Signal<br />

handlers are represented by a dotted circle attached to the corresponding<br />

application process (e.g., signal_handler1, which is attached to process<br />

update_operation_mo<strong>de</strong> in Figure 34-3).<br />

The association between hardware <strong>de</strong>vices and <strong>de</strong>vice drivers is <strong>de</strong>picted<br />

by a solid line connecting them. A box with a crossbar represents an active<br />

hardware <strong>de</strong>vice, whereas a box without a crossbar represents a passive<br />

hardware <strong>de</strong>vice. Explanation of the difference between an active <strong>de</strong>vice and<br />

a passive <strong>de</strong>vice is given later. Arrowed edges between any two vertices<br />

represent the communication of data or control messages, and are annotated<br />

with the selected IPC mechanisms. Since the system is OS-driven, they are<br />

to be implemented as calls to the system functions. For example, the edge<br />

from process main_upsem to process read_heart_rate in Figure 34-3 is a<br />

control message that is implemented using the semaphore service provi<strong>de</strong>d by<br />

the OS. Naturally, an edge from or to a hardware <strong>de</strong>vice represents the transfer<br />

of data using OS system functions. A small solid square at the termination of<br />

an edge indicates a blocking communication. Otherwise, the communication<br />

is assumed to be non-blocking.<br />

Behind the software architectural representation is a mo<strong>de</strong>l of computation<br />

featuring the following <strong>de</strong>tails:<br />

1.<br />

2.<br />

A hardware <strong>de</strong>vice can be either active or passive. An active <strong>de</strong>vice initiates<br />

data transfer spontaneously. A timer is a special active <strong>de</strong>vice that<br />

spontaneously initiates data (signal) transfer at regular intervals. A passive<br />

<strong>de</strong>vice, on the other hand, waits <strong>for</strong> the processor to initiate data transfer.<br />

There are two types of passive <strong>de</strong>vices. Fast <strong>de</strong>vices respond to the request<br />

from the processor immediately, slow <strong>de</strong>vices require some time (typically<br />

more than 1 ms) to respond to the processor. To efficiently use the<br />

processor, data transfer with a slow passive <strong>de</strong>vice is always blocking, so<br />

that the process requesting the data transfer can be suspen<strong>de</strong>d and the OS<br />

can bring in other processes <strong>for</strong> execution. On the other hand, data transfer<br />

with a fast passive <strong>de</strong>vice is naturally non-blocking since the <strong>de</strong>vice will<br />

respond to the processor request immediately.<br />

Instead of responding to the processor’s request, an active <strong>de</strong>vice can<br />

initiate a data transfer. There<strong>for</strong>e, data transfer with an active <strong>de</strong>vice has<br />

to be blocking, waiting <strong>for</strong> the active <strong>de</strong>vice to take the initiative.<br />

Moreover, to avoid data loss, no process in the SAG should be blocked<br />

by more than one active <strong>de</strong>vice, either directly, or indirectly through other<br />

processes. On the other hand, to efficiently use the processor (no busy<br />

waiting), every process in the SAG should be blocked (directly or indirectly)<br />

by at least one active <strong>de</strong>vice. There<strong>for</strong>e, the natural consequence<br />

of these requirements restricts the number of “active” blocking points <strong>for</strong>

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

Saved successfully!

Ooh no, something went wrong!