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.

Energy-Aware Parameter Passing 511<br />

the same way. However, each access to a <strong>for</strong>mal parameter invokes a fresh<br />

computation of the value of the actual parameter.<br />

Conservative: In this strategy, the multiple uses problem is resolved as in<br />

the case of the Block Insertion strategy. However, if the global variable<br />

problem occurs, this strategy drops on-<strong>de</strong>mand parameter-passing and uses<br />

the original parameter-passing strategy.<br />

Closure: This is similar to the previous strategy except that in handling<br />

the global variable problem, it uses the closure-based mechanism discussed<br />

earlier in Section 3. It should be mentioned that this strategy passes a parameter<br />

as the first (<strong>de</strong>fault) strategy if the global variable problem does not<br />

occur.<br />

We observe from Figure 36-4 that the <strong>de</strong>fault on-<strong>de</strong>mand strategy improves<br />

energy consumption by 8.78%, on the average. It is most successful in applications<br />

Wood and Encr where there is a relatively large difference between<br />

the average number of parameters and the average number of active parameters.<br />

The Path Control and Multiple Evaluation strategies, on the other hand,<br />

achieve less saving in energy. In fact, in two applications, Atr and SP,<br />

evaluating the same actual parameter more than once results in energy loss<br />

(as compared to the case without on-<strong>de</strong>mand parameter-passing).<br />

The reason that it is relatively successful in remaining applications is the<br />

fact that in many subroutine executions the paths where multiple actual<br />

parameter evaluations occur are not taken at runtime. The reason that the Path<br />

Control strategy is not as successful as the Block Insertion strategy is the extra<br />

energy spent in maintaining the values of the path variables and in executing<br />

comparison operations. The percentage (average) improvements due to Path<br />

Control and Multiple Evaluation strategies are 6.68% and 2.98%, respectively.<br />

Conservative and Closure generate the same energy behavior as the <strong>de</strong>fault<br />

strategy in our three applications. This is because in these applications, the<br />

global variable problem does not occur. In Usonic and Wood, on the other<br />

hand, the <strong>de</strong>fault strategy outper<strong>for</strong>ms Conservative and Closure.<br />

The trends in Figure 36-5 are similar to those illustrated in Figure 36-4.<br />

This is not surprising as eliminating redundant computation saves both energy<br />

and execution cycles. It should be stressed, however, that the savings in<br />

execution cycles are lower than those in energy consumption. This is due to<br />

the fact that the processor we consi<strong>de</strong>r can execute multiple instructions in<br />

the same cycle; consequently, some of the redundant computation can be<br />

hid<strong>de</strong>n (which makes the base case – without on-<strong>de</strong>mand parameter-passing<br />

– appear stronger). However, unlike execution cycles, it is not possible to hi<strong>de</strong><br />

energy consumption.<br />

5. CONCLUSIONS<br />

In this work, we studied the possibility of modifying the parameter-passing<br />

mechanism of the language with some help from compiler. Using a set of

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

Saved successfully!

Ooh no, something went wrong!