How can I get the code execution tome of the model in simulink? (for the code generation of the C2000 processors)

10 vues (au cours des 30 derniers jours)
I want to know what is the execution time of my model in simulink. I need to set a proper sampling time for the code generation for C2000 processors.
Thanks.
  2 commentaires
Sudarshan Kolar
Sudarshan Kolar le 27 Fév 2017
To determine the execution time of a model you can use the following command:
tic
sim('myModel');
toc
or you can also use Simulink profiler .
Hope that helps.
JIANWEI
JIANWEI le 28 Fév 2017
tic and toc are used together to measure the elapsed time, not the execution time.

Connectez-vous pour commenter.

Réponse acceptée

Antonin
Antonin le 9 Mar 2017
Hi JIANWEI,
Here are 2 techniques that will help you profile the execution time of the generated code on the TI C2000 processors:
  1. In R2017a, we introduced multitasking profiling, which will allow you to measure and visualize execution time and preemptions for the different synchronous rates in your model. Check the Real-Time Code Execution Profiling Example to learn more about this technique.
  2. In PIL mode, you can enable profiling and measure the execution time of your generated code. The Code Verification and Validation with PIL Example will show you how to run in PIL on the TI C2000 devices, while the "Code Verification and Validation with PIL" chapter of the documentation will explain you how to enable profiling with PIL.
I hope this helps,
Good luck!
Antonin.
  5 commentaires
JIANWEI
JIANWEI le 14 Mar 2017
Hi Antonin,
Thank you very much. These are quite helpful.
Jianwei
BD
BD le 3 Déc 2017
Hi Antonin,
1. Is the execution profile is for code running in hardware or for simulation in simulink environment?
2. If the execution profile is collected from hardware, through which interface (serial, can etc...) the data is collected from hardware.

Connectez-vous pour commenter.

Plus de réponses (1)

Manex Barrenetxea
Manex Barrenetxea le 27 Oct 2017
Dear Antonin,
We have tried to measure and visualize execution time and preemptions for the different synchronous rates in our model following your recommendation. However, the following error arose while compiling:
*The parameter ExecutionProfileBufferLen is not defined for selected hardware board.
We are trying to measure the execution times of the F28335 board. Could you clarify us which could be the root of the error we are having?
Thank you in advance and best regards,
Manex.

Catégories

En savoir plus sur Code Generation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by