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

조회 수: 9 (최근 30일)
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.
  댓글 수: 2
Sudarshan Kolar
Sudarshan Kolar 2017년 2월 27일
To determine the execution time of a model you can use the following command:
or you can also use Simulink profiler .
Hope that helps.
JIANWEI 2017년 2월 28일
tic and toc are used together to measure the elapsed time, not the execution time.

댓글을 달려면 로그인하십시오.

채택된 답변

Antonin 2017년 3월 9일
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!
  댓글 수: 5
BD 2017년 12월 3일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Manex Barrenetxea
Manex Barrenetxea 2017년 10월 27일
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,


Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by