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.

RTOS Mo<strong>de</strong>ling <strong>for</strong> System Level Design 67<br />

mo<strong>de</strong>ling ef<strong>for</strong>t and simulation results. The Voco<strong>de</strong>r mo<strong>de</strong>ls were exercised<br />

by a testbench that feeds a stream of 163 speech frames corresponding to 3.26<br />

s of speech into enco<strong>de</strong>r and <strong>de</strong>co<strong>de</strong>r. Furthermore‚ the mo<strong>de</strong>ls were annotated<br />

to <strong>de</strong>liver feedback about the number of RTOS context switches and<br />

the transcoding <strong>de</strong>lay encountered during simulation. The transcoding <strong>de</strong>lay<br />

is the latency when running enco<strong>de</strong>r and <strong>de</strong>co<strong>de</strong>r in back-to-back mo<strong>de</strong> and<br />

is related to response time in switching between encoding and <strong>de</strong>coding tasks.<br />

The results show that refinement based on the RTOS mo<strong>de</strong>l requires only<br />

a minimal ef<strong>for</strong>t. Refinement into the three architecture mo<strong>de</strong>ls was done by<br />

converting relevant SpecC statements into RTOS interface calls following<br />

the steps <strong>de</strong>scribed in Section 4.2. For this example‚ manual refinement took<br />

less than one hour and required changing or adding 104 lines or less than 1%<br />

of co<strong>de</strong>. Moreover‚ we have <strong>de</strong>veloped a tool that per<strong>for</strong>ms the refinement of<br />

unscheduled specification mo<strong>de</strong>ls into RTOS-based architecture mo<strong>de</strong>ls automatically.<br />

With automatic refinement‚ all three mo<strong>de</strong>ls could be created within<br />

seconds‚ enabling rapid exploration of the RTOS <strong>de</strong>sign alternatives.<br />

The simulation overhead introduced by the RTOS mo<strong>de</strong>l is negligible while<br />

providing accurate results. As explained by the fact that both tasks alternate<br />

with every time slice‚ round-robin scheduling causes by far the largest number<br />

of context switches while providing the lowest response times. Note that<br />

context switch <strong>de</strong>lays in the RTOS were not mo<strong>de</strong>led in this example‚ i.e. the<br />

large number of context switches would introduce additional <strong>de</strong>lays that would<br />

offset the slight response time advantage of round-robin scheduling in a final<br />

implementation. In priority-based scheduling‚ it is of advantage to give the<br />

<strong>de</strong>co<strong>de</strong>r the higher relative priority. Since the enco<strong>de</strong>r execution time dominates<br />

the <strong>de</strong>co<strong>de</strong>r execution time this is equivalent to a shortest-job-first<br />

scheduling which minimizes wait times and hence overall response time.<br />

Furthermore‚ the number of context switches is lower since the RTOS does<br />

not have to switch back and <strong>for</strong>th between enco<strong>de</strong>r and <strong>de</strong>co<strong>de</strong>r whenever<br />

the enco<strong>de</strong>r waits <strong>for</strong> results from the hardware co-processor. There<strong>for</strong>e‚<br />

priority-based scheduling with a high-priority <strong>de</strong>co<strong>de</strong>r was chosen <strong>for</strong> the final<br />

implementation. Note that the final <strong>de</strong>lay in the implementation is higher due<br />

to inaccuracies of execution time estimates in the high-level mo<strong>de</strong>l.<br />

In summary‚ compared to the huge complexity required <strong>for</strong> the implementation<br />

mo<strong>de</strong>l‚ the RTOS mo<strong>de</strong>l enables early and efficient evaluation of<br />

dynamic scheduling implementations.<br />

6. SUMMARY AND CONCLUSIONS<br />

In this chapter‚ we proposed a RTOS mo<strong>de</strong>l <strong>for</strong> system level <strong>de</strong>sign. To our<br />

knowledge‚ this is the first attempt to mo<strong>de</strong>l RTOS features at such high<br />

abstraction levels integrated into existing languages and methodologies. The<br />

mo<strong>de</strong>l allows the <strong>de</strong>signer to quickly validate the dynamic real time behavior<br />

of multi-task systems in the early stage of system <strong>de</strong>sign by providing accurate

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

Saved successfully!

Ooh no, something went wrong!