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.
Open the Simulink® model to profile.
In the Model Configuration Parameters > Hardware Implementation, set the Hardware board to an SoC Blockset™ supported hardware board.
In Hardware board settings > Hardware diagnostics, enable Show in SDI.
(Optional) You can log the measured data to file that gets saved into the
In the Simulink editor, set the Simulation mode to
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.
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.