Using custom code to measure execution time of Simulink subsystems
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to measure the execution time of a subsystem (group of Simulink blocks) which runs as an atomic unit with a specific sampleTime. The measurement will be done on a Real-time embedded target hardware by flashing code generated by Simulink coder.
I am planning to use the custom code block in Simulink coder to add counters to the generated code. By using specific code at entry and exit of the generated code for subsystem, I plan to count number of clock cycles taken to execute the subsystem.
dSpace RTI library has clock counters like
/* Start time measurement.*/
RTLIB_TIC_START();
/*code*/
/* Read the elapsed time period. */
subsystem_exec_time_1 = RTLIB_TIC_READ();
However, I am not sure if I have dSpace libraries at my disposal. My question is how do I write a counter or a function to log elapsed real-time or count number of clock cycles taken for execution? Is there a way that simulink enables such measurements?
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Deployment, Integration, and Supported Hardware dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!