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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Mo<strong>de</strong>ling and Integration of Peripheral Devices 77<br />

The core control function selectively fires eligible transitions‚ i.e. finds a<br />

transition path from the current state to the final state set. For example‚ the<br />

start function of SA1100 UDC is <strong>de</strong>fined as the union of start event and a<br />

set of states‚ as shown in Figure 6-5. When the application calls the start<br />

function‚ it generates the input event (service request) start. It then finds a<br />

transition path to states (usb_protocol‚ ZombieSuspend)‚ (ep1‚ idle)‚ (ep2‚ idle)<br />

and completes. If the current state does not accept the start event‚ the function<br />

returns abnormally. Timeout is optionally <strong>de</strong>fined to avoid infinite waiting.<br />

Although a data flow does not have an explicit control state machine<br />

specified‚ a state machine is implicitly generated <strong>for</strong> it to manage the control<br />

states such as reset and blocking.<br />

4.4. Device programming interface specification<br />

To mo<strong>de</strong>l <strong>de</strong>vice register accesses‚ we use the concepts of register and variable<br />

(see Figure 6-6) – similar <strong>de</strong>finitions can be found in Devil [3]. Event handlers<br />

and core functions access the <strong>de</strong>vice registers through a set of APIs such as<br />

IUDC_REG_name_READ and IUDC_REG_name_WRITE that use these<br />

registers and variables. These API’s are synthesized from the register and<br />

variable specifications‚ and extend the virtual environment. In addition to a<br />

basic programming interface‚ we provi<strong>de</strong> additional features that enable<br />

common access mechanisms to be <strong>de</strong>scribed succinctly. For example‚ FIFO<br />

is a common <strong>de</strong>vice-programming interface. It is always accessed through a<br />

register. Different <strong>de</strong>vices use different mechanisms to indicate the number<br />

of data in the FIFO. To enable the synthesis of FIFO access routines‚ we<br />

have <strong>de</strong>fined the concept of a hardware FIFO mapped register that is not<br />

illustrated in <strong>de</strong>tail here because of limited space.

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

Saved successfully!

Ooh no, something went wrong!