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.

18 Chapter 2<br />

Table 2-1. Worst case single process analysis and measurements.<br />

Process<br />

Measured<br />

WCET in<br />

scratchpad<br />

Calculated<br />

max # of<br />

cache misses<br />

Calculated<br />

WCET<br />

w/ cache<br />

Measured<br />

WCET<br />

w/ cache<br />

Measured<br />

WCET<br />

w/o cache<br />

a<br />

b<br />

c<br />

79<br />

79<br />

104<br />

the worst case number of cache misses. The third column contains the worst<br />

case execution times from external memory with cache calculated using the<br />

SYMPTA/P approach. The measurements from external memory – with and<br />

without cache – are given in the last two columns.<br />

5.2. RTOS analysis<br />

Apart from influencing the timing of individual tasks through scheduling‚<br />

the RTOS itself consumes processor time. Typical RTOS primitive functions<br />

are <strong>de</strong>scribed e.g. in [1]. The most important are: task or context switching<br />

including start‚ preemption‚ resumption and termination of tasks; and general<br />

OS overhead‚ including periodic timer interrupts and some house-keeping<br />

functions. For <strong>for</strong>mal timing analysis to be accurate‚ the influence of RTOS<br />

primitives needs to be consi<strong>de</strong>red in a conservative way.<br />

On the one hand‚ execution time intervals <strong>for</strong> each RTOS primitive need<br />

to be consi<strong>de</strong>red‚ and their <strong>de</strong>pen<strong>de</strong>ncy on the number of tasks scheduled by<br />

the RTOS. The second interesting question concerns patterns in the execution<br />

of RTOS primitives‚ in or<strong>de</strong>r to <strong>de</strong>rive the worst and best case RTOS<br />

overhead <strong>for</strong> task response times.<br />

I<strong>de</strong>ally‚ this in<strong>for</strong>mation would be provi<strong>de</strong>d by the RTOS vendor‚ who has<br />

<strong>de</strong>tailed knowledge about the internal behavior of the RTOS‚ allowing it to<br />

per<strong>for</strong>m appropriate analyses that cover all corner cases. However‚ it is<br />

virtually impossible to provi<strong>de</strong> numbers <strong>for</strong> all combinations of targets‚ compilers‚<br />

libraries‚ etc. Alternatively‚ the RTOS vendor could provi<strong>de</strong> test patterns<br />

that the integrator can run on its own target and in its own <strong>de</strong>velopment<br />

environment to obtain the required worst and best case values. Some OS<br />

vendors have taken a step in that direction‚ e.g. [11].<br />

In our case‚ we did not have sufficient in<strong>for</strong>mation available. We there<strong>for</strong>e<br />

had to come up with our own tests to measure the influence of ERCOSEK<br />

primitives. This is not i<strong>de</strong>al‚ since it is tedious work and does not guarantee<br />

corner-case coverage. We per<strong>for</strong>med our measurements by first instrumenting<br />

accessible ERCOSEK primitives‚ and then using the LSA-based approach<br />

<strong>de</strong>scribed in Section 5.1. Fortunately‚ ESCAPE (Section 4.1) generates the<br />

ERCOSEK configuration functions in C which then call the corresponding<br />

ERCOSEK functions (object co<strong>de</strong> library). The C functions provi<strong>de</strong> hooks <strong>for</strong><br />

instrumentation.

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

Saved successfully!

Ooh no, something went wrong!