This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你(们)好
我仅使用28377D 的 CPU1。
我想计算 CPU1的用法。 进行编程。
我想知道是否可以通过以下方式计算它
a.通过在源代码重复语句中设置"break"来测量执行时间
b.通过在整个源代码上设置"中断"来测量执行时间
CPU 使用率=(a/b)* 100
如果还有其他方法、请告诉我
谢谢
您好!
使用这种方法、您可以找到执行代码片段所需的 CPU 周期数。 请查看此链接:
https://software-dl.ti.com/ccs/esd/documents/c2000_profiling-on-c28x-targets.html
https://software-dl.ti.com/ccs/esd/documents/ccs_counting_cycles.html
此外、您可能还需要查看此白皮书、其中介绍了基准测试和测量策略。
https://www.ti.com/lit/spracw5
此致、Santosh
CPU 使用率取决于您使用 CPU 的方式。 如果您的应用程序具有触发 ISR 的周期性中断、以及在空闲时间运行的后台函数、您有什么兴趣? 您是否有兴趣了解 CPU 运行 ISR 所花费的时间的百分比-您对 CPU 负载的定义是多少?
有时应用程序被写入、以便在空闲时间内、某些后台函数始终在执行、因此 CPU 永远不会空闲。 CPU 可能花费70%的时间运行 ISR、剩余30%的时间运行后台函数。 这可以被视为70% CPU 负载。
谢谢、
Sira