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.

<strong>Software</strong> Streaming Via Block Streaming 439<br />

co<strong>de</strong> into an executable binary image by a standard compiler such as GCC,<br />

(ii) generating a new binary <strong>for</strong> the stream-enabled application and (iii)<br />

transmitting the stream-enable application to the client <strong>de</strong>vice.<br />

The process to receive a block of streamed software on the client <strong>de</strong>vice<br />

is illustrated in Figure 32-2: (i) load the block into memory and (ii) link the<br />

block into the existing co<strong>de</strong>. This “linking” process may involve some co<strong>de</strong><br />

modification which will be <strong>de</strong>scribed later.<br />

We <strong>de</strong>fine a co<strong>de</strong> block to be a contiguous address space of data or executable<br />

co<strong>de</strong> or both. A block does not necessarily have a well-<strong>de</strong>fined interface;<br />

<strong>for</strong> example, a block may not have a function call associated with the<br />

beginning and ending addresses of the block, but instead block boundaries<br />

may place assembly co<strong>de</strong> <strong>for</strong> a particular function into multiple, separate<br />

blocks. The compiled application is consi<strong>de</strong>red as a binary image occupying<br />

memory. This binary image is divi<strong>de</strong>d into blocks be<strong>for</strong>e the stream-enabled<br />

co<strong>de</strong> is generated. See Section 3 of [12] more <strong>de</strong>tails.<br />

3.1. <strong>Embed<strong>de</strong>d</strong> software streaming co<strong>de</strong> generation<br />

In our approach, the stream-enabled embed<strong>de</strong>d software is generated from the<br />

executable binary image of the software. The executable binary image of the<br />

software is created from a standard compiler such as GCC.<br />

3.1.1. Preventing the execution of non-existing co<strong>de</strong><br />

After the application is divi<strong>de</strong>d into blocks, exiting and entering a block can<br />

occur in four ways. First, a branch or jump instruction can cause the processor<br />

to execute co<strong>de</strong> in another block. Second, when the last instruction of the<br />

block is executed, the next instruction can be the first instruction of the<br />

following block. Third, when a return instruction is executed, the next instruction<br />

would be the instruction after calling the current block subroutine, which<br />

could be in another block. Fourth, when an exception instruction is executed,<br />

the exception co<strong>de</strong> may be in a different block. We call a branch instruction<br />

that may cause the CPU to execute an instruction in a different block an off-

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

Saved successfully!

Ooh no, something went wrong!