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 71<br />

programming‚ its approach is limited to register accesses and it does not<br />

address the other issues in <strong>de</strong>vice driver <strong>de</strong>velopment outlined above.<br />

In the context of co-<strong>de</strong>sign automation‚ O’Nils and Jantsch [4] propose a<br />

regular language called ProGram to specify hardware/software communication<br />

protocols‚ which can be compiled to software co<strong>de</strong>. While there are some<br />

interesting features‚ this does not completely address the <strong>de</strong>vice driver<br />

problems as <strong>de</strong>scribed here‚ particularly due to its inability to inclu<strong>de</strong> an<br />

external OS. Other ef<strong>for</strong>ts in the co-<strong>de</strong>sign area [1‚ 2] are limited to the<br />

mapping of the communications between hardware and software to interrupt<br />

routines that are a small fraction of a real <strong>de</strong>vice driver.<br />

I2O (Intelligent Input Output) [8] <strong>de</strong>fines a standard architecture <strong>for</strong><br />

intelligent I/O that is in<strong>de</strong>pen<strong>de</strong>nt of both the specific <strong>de</strong>vice being controlled<br />

and the host operating system. The <strong>de</strong>vice driver portability problem is handled<br />

by specifying a communication protocol between the host system and the<br />

<strong>de</strong>vice. Because of the large overhead of the implementation of the communication<br />

protocol‚ this approach is limited to high-per<strong>for</strong>mance markets. Like<br />

I2O‚ UDI [9] (Uni<strong>for</strong>m Driver Interface) is an attempt to address portability.<br />

It <strong>de</strong>fines a set of Application Programming Interfaces (APIs) between the<br />

driver and the plat<strong>for</strong>m. Divers and operating systems are <strong>de</strong>veloped in<strong>de</strong>pen<strong>de</strong>ntly.<br />

UDI API’s are OS and plat<strong>for</strong>m neutral and thus source-co<strong>de</strong> level<br />

reuse of driver co<strong>de</strong> is achieved. Although UDI and our methodology share<br />

the common feature of plat<strong>for</strong>m and OS neutral service abstraction‚ our<br />

methodology is based on a <strong>for</strong>mal mo<strong>de</strong>l that enables verification and synthesis.<br />

3. METHODOLOGY FRAMEWORK<br />

Devices are function extensions of processors. They exchange data with<br />

processors‚ respond to processor requests and actively interact with processors‚<br />

typically through interrupts. Processors control and observe <strong>de</strong>vices<br />

through the <strong>de</strong>vice-programming interface‚ which <strong>de</strong>fines I/O registers and<br />

mapped memories. Figure 6-1 sketches the relationship between <strong>de</strong>vices‚<br />

processors‚ the operating system and <strong>de</strong>vice drivers.<br />

Processors access <strong>de</strong>vices through memory mapped I/O‚ programmed I/O<br />

or DMA. A data path (or communication channel) is a specific path <strong>for</strong><br />

exchanging data between the processor and the <strong>de</strong>vice as illustrated in Figure<br />

6-1.<br />

To hi<strong>de</strong> the <strong>de</strong>tails of <strong>de</strong>vice accesses‚ <strong>de</strong>vice drivers are <strong>de</strong>signed to be a<br />

layer between the high-level software and low-level <strong>de</strong>vice. In most cases‚ a<br />

<strong>de</strong>vice driver is part of the kernel. Application software‚ which resi<strong>de</strong>s in<br />

user space‚ uses system calls to access the kernel driver. System calls use traps<br />

to enter kernel mo<strong>de</strong> and dispatch requests to a specific driver. Hence we can<br />

partition a <strong>de</strong>vice driver into three parts as illustrated in Figure 6-1 and<br />

explained below:

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

Saved successfully!

Ooh no, something went wrong!