Profile Task Execution on Processor

Task execution timing on an embedded processor can be measured using a code instrumentation profiler. Using external mode, a model with a Task Manager block executing on an SoC hardware board, the code instrumentation profiler streams the execution timing of the task to the host computer, displaying the data in the Simulation Data Inspector (SDI), in real time. Following the profiling of the hardware, the recorded data is saved with the generated code. The data can then be used with the Task Manager block to playback the task execution in simulation.

Task Profiling with External Mode

  1. Open the Simulink® model to profile.

  2. In the Model Configuration Parameters > Hardware Implementation, set the Hardware board to an SoC Blockset™ supported hardware board.

  3. In Hardware board settings > Hardware diagnostics, enable Show in SDI.

  4. (Optional) You can log the measured data to file that gets saved into the <model>_ert_rtw/instrumented/diagnostics folder.

  5. In the Simulink editor, set the Simulation mode to External Mode.

  6. Click Run to deploy and execute the code on the hardware board. A Simulation Data Inspector automatically appears showing the streaming data for the tasks and processors on which they are executing.

  7. Click Stop to end the model execution.

You can access and examine the logged data in the code generation folder used by the model. For more information on accessing the recorded streaming profiled data, see Recording Tasks for Use in Simulation. To use the recorded data in simulation, see Task Execution Playback using Recorded Data.

See Also

Related Topics