Target Language Compiler | ![]() ![]() |
Open the Model and Generate Code
tlctutorial
/
tlcdebug/ to your working directory and cd
to it. Do this even if you already have copied it, to be sure you have the version of gain.tlc
that has the bug. Open simple_log.mdl
in Simulink.
simple_log_grt_rtw
) is created in your working directory.
gain.log
, and copy it to your working directory, renaming it gain_ilp.log
to prevent it from being overwritten.
gain_ilp.log
in your editor. It looks almost like gain.tlc
, except for a number followed by a colon at the beginning of each line. This number represents the number of times the TLC executed the line in generating code. FcnEliminateUnnecessaryParams: should look like this:
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 2: %if LibIsEqual(k, "0.0") 0: %if ShowEliminatedStatements == 1 0: /* %<y> = %<u> * %<k>; */ 0: %endif 2: %elseif LibIsEqual(k, "1.0") 2: %<y> = %<k>; 0: %elseif LibIsEqual(k, "-1.0") 0: %<y> = -%<k>; 0: %else 0: %<y> = %<u> * %<k>; 0: %endif 0: %endfunction
![]() | Getting Started | Log Without Inline Parameters | ![]() |