ARM Cortex-m3(特别是 LPC1343)上的指令时序

发布于 2024-09-11 14:34:25 字数 326 浏览 4 评论 0原文

我希望在 LPC1343 上编写一些对时序非常敏感的代码,我需要计算精确的时钟周期。有两个问题:-

  1. 我读到,从内部闪存执行的代码并不总是能够以完整的 72Mhz 运行,并且可能会引入等待状态。但我找不到任何关于此的“官方”文件。我看到一个地方建议将时间敏感的函数复制到内存中...我正在寻找明确地告诉我这种情况不会发生,或者寻找有关它如何影响计时的信息。

  2. 分支指令需要多长时间?我读到这个核心有分支预测,所以时序可能会有所不同。这是正确的吗?如果是的话,有什么方法可以预测它的行为方式,或者禁用它(因为准确的时序比为我节省几个时钟周期更重要) .

I'm looking to write some very timing sensitive code on an LPC1343 where I need to count exact clock cycles. There are two issues :-

  1. I've read that code executing from the internal flash memory isn't always able to run at the full 72Mhz and wait states might be introduced. But I can't find any "official" document about this. I saw one place recommending to copy time sensitive functions into ram... I'm looking for either to be be told definitively that this doesn't happen, or for information on how it affects the timing.

  2. How long do branch instructions take? I read this core has branch prediction so timings might vary.. Is this correct, and if so is there any way to predict how it will behave, or disable that (as exact timing is more important than saving a few clock cycles for me).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柏林苍穹下 2024-09-18 14:34:25

Cortex-M3 的指令时序可从 arm.com 获取:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337g/BABBCJII.html

还有管道操作,所以指令计数有点繁琐。

The instruction timing for Cortex-M3 is available from arm.com:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337g/BABBCJII.html

There are also pipeline operations, so instruction counting is a bit fiddly.

烟酉 2024-09-18 14:34:25

以下是 LPC11xx 和 LPC13xx 的一些现实调查:
http://knowledgebase.nxp.com/showthread.php?t=460

简而言之,没有“正确”的答案,结果可能取决于闪存加速器设置、内存对齐、总线架构(诺伊曼与哈佛)、32 位与 16 位指令等。

Here's some real world investigation for LPC11xx and LPC13xx:
http://knowledgebase.nxp.com/showthread.php?t=460

In short, there is no "right" answer, the results might depends on flash accelerator settings, memory alignment, bus architecture (neumann vs. harvard), 32-bit vs. 16-bit instructions and so on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文