Target Language Compiler    

Open the Model and Generate Code

  1. Copy the folder 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.
  2. As before, open the Simulation parameters dialog box, click the Advanced tab and select Inline parameters.
  3. Under the Target Configuration section of the Real-Time Workshop tab, click Generate code only.
  4. Under the TLC debugging section of the Real-Time Workshop tab, select Start TLC coverage when generating code. Do not check Start TLC debugger when generating code -- it won't hurt to invoke the debugger, but you won't need it.
  5. Click Generate code. The usual messages appear on the command window, and a build directory (simple_log_grt_rtw) is created in your working directory.
  6. Enter the build directory. Find the file gain.log, and copy it to your working directory, renaming it gain_ilp.log to prevent it from being overwritten.
  7. Open the log file 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:
  1. Notice that comments were not executed, nor were most of the TLC statements. Several statements were reached, however, which means they output to the generated C code as many times as the number prepended to those lines.


  Getting Started Log Without Inline Parameters