Skip to Main Content Skip to Search
Product Documentation

Configure Code Execution Profiling

To configure code execution profiling for a SIL or PIL simulation:

  1. In your top model, select Simulation > Configuration Parameters > Code Generation > SIL and PIL Verification.

  2. Select the Measure task execution time check box.

  3. If you also want function execution times, select the Measure function execution times check box. For information about how you apply this setting to atomic subsystems and model reference hierarchies, see Specify Execution Profiling Settings.

      Note   This feature does not support state functions or MATLAB functions from the Stateflow product.

  4. In the Workspace variable field, specify a name. When you run the simulation, the software generates a variable with this name. The variable contains the execution time measurements, and is an object of type rtw.pil.ExecutionProfile.

  5. From the Save options drop-down list, select one of the following:

    • Summary data only — If you want to generate only a report and seek to reduce the use of memory, for example, during a long simulation. See View Code Execution Reports.

    • All measurement and analysis data — Allows you to generate a report and store execution profile data in the base workspace. After the simulation, you can use methods from the rtw.pil.ExecutionProfile and rtw.pil.ExecutionProfileSection classes to retrieve execution time measurements for every call to each profiled section of code that occurs during the simulation. See Analyze Code Execution Data.

  6. Click OK.

For a PIL simulation, you must configure a hardware-specific timer. When you set up the connectivity configuration for your target, create a timer object. See Create a Connectivity Configuration for a Target. This action is not required for a SIL simulation.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS