Target Language Compiler | ![]() ![]() |
Log Without Inline Parameters
gain.log
, and copy it to your working directory, but call it gain_no_ilp.log
.
gain_no_ilp.log
, which appears as shown below:
0: %% Function: FcnEliminateUnnecessaryParams ================= 0: %% Abstract: 0: %% Eliminate unnecessary multiplications for following 0: %% gain cases when in-lining parameters: 0: %% Zero: memset in registration routine zeroes output 0: %% Positive One: assign output equal to input 0: %% Negative One: assign output equal to unary minus of input 0: %% 1: %function FcnEliminateUnnecessaryParams(y,u,k) Output 0: %if LibIsEqual(k, "0.0") 0: %if ShowEliminatedStatements == 1 0: /* %<y> = %<u> * %<k>; */ 0: %endif 0: %elseif LibIsEqual(k, "1.0") 0: %<y> = %<k>; 0: %elseif LibIsEqual(k, "-1.0") 0: %<y> = -%<k>; 0: %else 0: %<y> = %<u> * %<k>; 0: %endif 0: %endfunction
Compare this listing to the prior one (gain_ilp.log
). Observe that this time, no statements were executed except for the function declaration, which the TLC always caches. The differences in the log files focus your attention on what is going wrong when parameters are inlined.
In this exercise, you have seen how changing code generation options can cause a latent defect to appear in generated source code. Systematically changing options and observing resulting differences in TLC coverage enhances the speed and ease of discovering faulty code.
![]() | Open the Model and Generate Code | Wrapping User Code with TLC | ![]() |