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.

74 Chapter 6<br />

edge of the various elements of the configuration‚ in<strong>for</strong>mation such as driver<br />

type and driver type specific parameters are enco<strong>de</strong>d once and then reused<br />

across plat<strong>for</strong>m specifications.<br />

4. DEVICE SPECIFICATION<br />

In this section we <strong>de</strong>scribe the different parts of the <strong>de</strong>vice specification‚ which<br />

is the input to the generation of the core functions (see Figure 6-2). Based on<br />

our study of <strong>de</strong>vices and <strong>de</strong>vice drivers‚ we partition this specification into<br />

the following parts: data path‚ <strong>de</strong>vice control (including event handlers and<br />

control functions) and <strong>de</strong>vice programming interface. Figure 6-1 provi<strong>de</strong>s<br />

some motivation <strong>for</strong> this division. The data path <strong>de</strong>scribes the transfer of data<br />

between the processor and the <strong>de</strong>vice. The <strong>de</strong>vice control <strong>de</strong>scribes the<br />

transitions between the states of the <strong>de</strong>vice using event driven finite state<br />

machines (EFSM) [5]. The processing of events in the event driven state<br />

machines is specified in event handlers. The core functions provi<strong>de</strong> the <strong>de</strong>vice<br />

services to the upper layers of the software – the OS and the application. The<br />

<strong>de</strong>vice-programming interface provi<strong>de</strong>s the low-level access functions to the<br />

<strong>de</strong>vice registers. Eventually it is the core functions that need to be synthesized<br />

in C as the driver – however‚ this synthesis will need all the other parts of<br />

this specification to un<strong>de</strong>rstand the complete <strong>de</strong>vice behavior. This partitioning<br />

of the specification allows <strong>for</strong> a separation of the various domains‚ which the<br />

<strong>de</strong>vice driver has to interact with‚ and is similar to the approach used by expert<br />

<strong>de</strong>vice driver writers.<br />

4.1. Data path<br />

A data unit is a data block moving between the <strong>de</strong>vice and the software by<br />

a primitive hardware operation. For example‚ we can <strong>de</strong>fine a DMA access<br />

as a primitive hardware operation. A data unit is mo<strong>de</strong>led as a tuple of data<br />

unit size‚ the event enabling a new data unit operation‚ starter function‚ the<br />

event indicating the end of a data unit operation‚ stopper function‚ the events<br />

indicating errors and access operations. Starter functions are the operations<br />

per<strong>for</strong>med be<strong>for</strong>e data accesses. Stopper functions are the cleanup operations<br />

per<strong>for</strong>med when the hardware data access operations end. Figure 6-4 <strong>de</strong>fines<br />

the DMA data unit of the transmit channel of the SA1100 USB <strong>de</strong>vice<br />

controller (UDC). While the <strong>de</strong>tails of the specification are beyond the scope<br />

of the paper‚ this illustrates the nature of the in<strong>for</strong>mation required here.<br />

A data path is <strong>de</strong>fined as a stream of data units. The last part of Figure<br />

6-4 provi<strong>de</strong>s an example of a data path specification. It specifies data transfer<br />

direction and the data unit of the data path.

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

Saved successfully!

Ooh no, something went wrong!