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.

Hardware and <strong>Software</strong> Partitioning of Operating Systems 195<br />

Example 5-2: The following picture shows a database example [28]. Each<br />

database access requires a lock so that no other process can acci-<strong>de</strong>ntly<br />

alter the database object at the same time. Note that a “short” re-quest<br />

indicates that no context switch is allowed to occur since all access-es to<br />

the object are very short (e.g., less than the time it takes to switch context).<br />

A “long” request, on the other hand, requires a significant amount of time<br />

holding the database object (and hence the lock); thus, <strong>for</strong> a “long” request,<br />

if the lock is not available then the requesting process is context switched<br />

out by the RTOS running on the processor.<br />

We ran this example with 40 tasks – 10 server tasks and 30 client tasks –<br />

on the four-MPC750 <strong>SoC</strong> architecture shown in Figure 15-8 with 10 task<br />

on each MPC750. The results are shown in the following table. Please<br />

note that lock latency is the time required to access a lock in the absence<br />

of contention (i.e., the lock is free); also, please note that the 908 cycles<br />

shown in the following table <strong>for</strong> lock latency in the “With <strong>SoC</strong>LC” is<br />

measured from be<strong>for</strong>e to after the software application level API call. Thus,<br />

in the “With <strong>SoC</strong>LC” case, part of the 908 cycles reported are spent<br />

executing API software including specialized assembly instructions which<br />

* Without<br />

<strong>SoC</strong>LC<br />

With<br />

<strong>SoC</strong>LC<br />

Speedup<br />

Lock Latency<br />

(clock cycles)<br />

Lock Delay<br />

(clock cycles)<br />

Execution Time<br />

(clock cycles)<br />

1200<br />

47264<br />

36.9M<br />

908<br />

23590<br />

29M<br />

1.32x<br />

2.00x<br />

1.27x<br />

* Semaphores <strong>for</strong> long CSes and spin-locks <strong>for</strong> short<br />

CSes are used instead of <strong>SoC</strong>LC.

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

Saved successfully!

Ooh no, something went wrong!