尝试刷新 PowerPC 750 数据缓存

发布于 2024-08-02 22:41:50 字数 380 浏览 5 评论 0原文

我正在编写一个例程,在使用写回模式时将其关闭之前刷新 PowerPC750 数据缓存。

我找到了 IBM 应用程序说明 关于对包含刷新例程的缓存进行编程,但我对示例代码感到困惑。我认为示例中可能有错误,但我想检查一下。在清单 2 中,有两个循环,其中包括“移至下一个块”的指令。通过将 0x10 添加到当前地址来实现移动到下一个块。 我预计这会增加 0x20 (32),因为我认为缓存行是 32 字节宽。任何人都可以证实或否定我的想法吗?!

I'm writing a routine to flush the PowerPC750 data cache before turning it off when using write back mode.

I've found the IBM application note on programming the caches which includes a flush routine, but I am confused by the example code. I think it might be a mistake in the example but thought I'd check. In Listing 2 there are two loops which include and instruction to "move to next block". Moving to the next block is achieved by adding 0x10 to the current address. I would have expected this to be an add of 0x20 (32) since I think the cache lines are 32 bytes wide. Can anyone confirm or repudiate my thinking?!

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

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

发布评论

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

评论(2

新人笑 2024-08-09 22:41:50

看来你是对的。他们的数学在列表顶部说明:

! CTR - the number of data blocks needed to fill the cache - save it in r3
!       32K (size of cache) / 32 (bytes per block) = 0x400

他们总是将计数寄存器设置为 0x400,并且它指出该文档中的几个位置每个块有 32 字节。因此,按照这个数学计算,您需要增加 0x20 而不是 0x10。与任何组件一样,您绝对应该以两种方式对其进行测试,以防出现一些奇怪的硅勘误表。

You appear to be right. With their math stated at the top of the listing:

! CTR - the number of data blocks needed to fill the cache - save it in r3
!       32K (size of cache) / 32 (bytes per block) = 0x400

They always set the count register to 0x400 and it states that there are 32bytes per block a few places in that document. So following that math you would need to increment 0x20 not 0x10. As with any assembly you should definitely test it both ways in case there is some weird silicon errata of sorts.

梦归所梦 2024-08-09 22:41:50

在其他 SO 用户确认后,我给应用笔记的作者发送了电子邮件。他同意0x10应该是0x20,并且将来可能会更新注释。

Following confirmation from other SO users I e-mailed the application note's author. He agreed that 0x10 should be 0x20 and may update the note in future.

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