Target Language Compiler    

Log Without Inline Parameters

  1. Open the Simulation parameters dialog, click the Advanced tab and clear Inline parameters.
  2. Go to the Real-Time Workshop tab, and click Generate code. The TLC will run through its tasks and recreate the log and source files in your build directory.
  3. Enter your build directory. Find the new version of gain.log, and copy it to your working directory, but call it gain_no_ilp.log.
  4. Edit the log file gain_no_ilp.log, which appears as shown below:

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