MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Podręcznik Użytkownika Strona 92

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 130
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 91
3 Working with Real-Time Workshop
3-36
sin(example_P.SineWave_Freq * example_M->Timing.t[0] +
example_P.SineWave_Phase) + example_P.SineWave_Bias;
rtb_gain_out = rtb_sin_out * example_P.Gain_Gain;
example_Y.Out1 = rtb_gain_out;
}
This code is more efficient in terms of memory usage. The efficiency
improvement gained by enabling
Enable local block outputs and Reuse
block outputs
would be more significant in a large model with many signals.
A Further Optimization: Expression Folding
As a final optimization, you turn on expression folding, a code optimization
technique that minimizes the computation of intermediate results and the
use of temporary buffers or variables.
Enable expression folding and regenerate the code as follows:
1 On the Optimization pane of the Configuration Parameters dialog,
select the
Eliminate superfluous temporary variables (Expression
folding)
option.
2 Make sure that Signal storage reuse is still selected, as shown above.
3 Click Apply.
Przeglądanie stron 91
1 2 ... 87 88 89 90 91 92 93 94 95 96 97 ... 129 130

Komentarze do niniejszej Instrukcji

Brak uwag