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.

428 Chapter 31<br />

<strong>for</strong>mation matrices (from the first constraint) we can improve self-spatial reuse<br />

too. In the following, we generalize our method to handle more realistic cases.<br />

We also present a general solution method that can be employed within an<br />

optimizing compiler that targets embed<strong>de</strong>d environments where data space<br />

optimizations (minimizations) are critical.<br />

Let us now focus on a single nest with multiple arrays. Assume further that<br />

each array is accessed through a single reference only. Without loss of generality,<br />

let be the reference to array where We also<br />

assume that these references are touched (during program execution) in<br />

increasing values of i (i.e., from 1 to s). We want to <strong>de</strong>termine data trans<strong>for</strong>mations<br />

We have two different sets of constraints (one <strong>for</strong> the data<br />

trans<strong>for</strong>mation matrices and the other <strong>for</strong> the displacement vectors):<br />

where and and Satisfying these constraints <strong>for</strong><br />

all possible i, j and k values guarantees good spatial locality during nest<br />

execution.<br />

The discussion above assumes that each array has a single reference in the<br />

loop body. If we have multiple references to the same array, then the corresponding<br />

constraints should also be ad<strong>de</strong>d to the constraints given above.<br />

Let us assume that there are references to array and that these references<br />

are accessed (during nest execution) in the or<strong>de</strong>r of<br />

So, <strong>for</strong> a<br />

given array we have the following constraints:<br />

where and and are the jth reference<br />

matrix and constant vector <strong>for</strong> array respectively.<br />

It should be observed that the system of constraints given above may not<br />

always have a valid solution. This is because the second constraint above<br />

simplifies to<br />

and it may not be possible<br />

to find an to satisfy both this and We note, however,<br />

that if we can drop from consi<strong>de</strong>ration (as it is<br />

always satisfied). This case occurs very frequently in many embed<strong>de</strong>d image<br />

processing applications (e.g., in many stencil-type computations). As an<br />

example, consi<strong>de</strong>r the references A(i, j) and A(i – 1, j + 1) in a nest with two<br />

loops, i and j. Since we need to select a which<br />

satisfies the following constraint:

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

Saved successfully!

Ooh no, something went wrong!