Help with the library elapsed_time for the time analysis of function

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Help with the library elapsed_time for the time analysis of function

ソリューションへジャンプ
563件の閲覧回数
p_decesare
Contributor III

Hi community,

I have a question about the calculation of time of one function. 
I want to have some explanations because I don't understand very well how to perform the time analysis of the functions of my code. I need to know very well the time of execution of my code in order to comprehend the relationship between the frequency of CAN message.

I downloaded the example of S32K142_02_time_measure_01.7z from the website

"https://community.nxp.com/t5/S32K-Knowledge-Base/Measure-the-running-time-of-one-function-on-S32K/ta..."

I want to know what is the unit of measurements of the variabile ARM_CM_DWT_CYCCNT. I need to calculate the time of the functions of my code. If the difference between two executions is equal to 415 and in my code I choose the SlowRunMode (Bus Clock, Core Clock and Sys Clock equal to 48MHz) I should calculate the ratio between 415/(48MHz) for the fact that the Core Clock is equal to 48MHz?

Thank you for your help

Best regards,

Paola

0 件の賞賛
1 解決策
557件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi p_decesare,

Yes. Your calculation is correct.
The unit of measurements of the variabile ARM_CM_DWT_CYCCNT is CORE_CLK cycles.
For example: set a breakpoint at the end of elapsed_time_stop, you will see the CORE_CLK cycles the Code being measured.

elapsed_time current.png

Best Regards,
Robin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

1 返信
558件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi p_decesare,

Yes. Your calculation is correct.
The unit of measurements of the variabile ARM_CM_DWT_CYCCNT is CORE_CLK cycles.
For example: set a breakpoint at the end of elapsed_time_stop, you will see the CORE_CLK cycles the Code being measured.

elapsed_time current.png

Best Regards,
Robin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------