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.

78 Chapter 6<br />

5. SYNTHESIS<br />

Given all the parts of the specification‚ the synthesis process synthesizes the<br />

C co<strong>de</strong> <strong>for</strong> the entire driver. The functions that need to be provi<strong>de</strong>d are the<br />

core functions that provi<strong>de</strong> the <strong>de</strong>vice services to the upper layers of software.<br />

In synthesizing these functions‚ all parts of the specification are used. This<br />

section outlines the synthesis process.<br />

5.1. Plat<strong>for</strong>m function and registry function mapping<br />

The plat<strong>for</strong>m interface inclu<strong>de</strong>s fundamental virtual data types and a basic<br />

virtual API <strong>for</strong> the following categories:<br />

a)<br />

b)<br />

c)<br />

d)<br />

e)<br />

f)<br />

g)<br />

Synchronization functions;<br />

Timer management functions;<br />

Memory management functions;<br />

DMA and bus access functions;<br />

Interrupt handling (setup‚ enable‚ disable‚ etc.);<br />

Tracing functions;<br />

Register/memory access functions.<br />

All virtual data types and API are mapped into plat<strong>for</strong>m specific types and<br />

API by implementing them on the plat<strong>for</strong>m. This part is done manually based<br />

on an un<strong>de</strong>rstanding of the plat<strong>for</strong>m. Note that while this is not synthesized‚<br />

this approach provi<strong>de</strong>s <strong>for</strong> significant reuse as this needs to be done only once<br />

<strong>for</strong> each plat<strong>for</strong>m (or part of a plat<strong>for</strong>m).<br />

We adopt a template-based approach to map the registry function interface<br />

to a specific plat<strong>for</strong>m by c creating a library of plat<strong>for</strong>m specific templates.<br />

The synthesizer generates appropriate co<strong>de</strong> to tailor the template <strong>for</strong><br />

a particular <strong>de</strong>vice. Although the registry function generation is plat<strong>for</strong>m<br />

specific‚ it is reused <strong>for</strong> drivers <strong>for</strong> different <strong>de</strong>vices.<br />

5.2. Device core function synthesis<br />

As illustrated in Figure 6-1‚ <strong>de</strong>vice driver core functions are either data access<br />

functions or control functions. We synthesize data access functions from the<br />

data path specification‚ and control functions from the <strong>de</strong>vice control specification.<br />

Section 3 mentioned that driver core functions synchronize with the <strong>de</strong>vice<br />

through one of the 3 synchronization mechanisms: interrupt‚ poll and timer<br />

<strong>de</strong>lay. As a result‚ our driver core function synthesizer synthesizes both the<br />

driver functions and the synchronization routines that are sufficient to completely<br />

<strong>de</strong>fine the plat<strong>for</strong>m in<strong>de</strong>pen<strong>de</strong>nt part of the driver.

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

Saved successfully!

Ooh no, something went wrong!