[ARM CortexA]强序和设备内存类型的区别 [英] [ARM CortexA]Difference between Strongly-ordered and Device Memory Type

查看:44
本文介绍了[ARM CortexA]强序和设备内存类型的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的是 Cortex A 的新手,我知道 ARM 应用弱序内存模型,并且存在三种互斥的内存类型:

I am really a new starter to Cortex A and I am aware the ARM applies weakly-ordered memory model, and there are three mutually exclusive memory types:

  • 严格有序
  • 设备
  • 正常

我大致理解了Normal是什么,Strongly-ordered和Device是什么意思.然而,强序和设备之间的差异让我感到困惑.

I roughly understand what Normal is for and what Strongly-ordered and Device mean. However the diffrence between strongly-ordered and device is confusing to me.

根据 Cortex-A 系列程序员指南,唯一的区别是:

According to the Cortex-A Series Programmer's Guide, the only difference is that:

对强有序存储器的写入只有在到达写入操作访问的外设或存储器组件时才能完成.

A write to Strongly-ordered memory can complete only when it reaches the peripheral or memory component accessed by the write.

在写入访问的外围设备或内存组件之前,允许完成对设备内存的写入.

A write to Device memory is permitted to complete before it reaches the peripheral or memory component accessed by the write.

我不太确定这的真正含义是什么.我猜想,对使用 Strongly-ordered 或 Device 键入的内存的访问顺序应该与程序员的代码一致(没有乱序访问).但是如果类型为Device,CPU在访问内存时可能会执行下一条指令,如果类型为Strongly-ordered,它会等待直到访问完成.

I am not quite sure about what the real implification of this. I am guessing that, the order of the access to the memory typed with Strongly-ordered or Device should be coherent with programmers' codes (no out-of-order access). But the CPU will potentially execute the next instruction while accessing the memory if typed Device, and it will simply wait untill the access to be complete if typed Strongly-ordered.

如果我错了,请纠正我,请告诉我这样做的意义是什么.

Correct me if I am wrong and please tell me what is the meaning of doing this.

提前致谢.

推荐答案

要理解的一个重要一点是,内存类型对整个指令流没有保证影响 - 它们仅影响排序内存访问.(它们可能会对以特定方式与特定互连集成的特定处理器产生特定影响 - 但软件永远无法依赖.)

One important bit to understand is that memory types have no guaranted effect on the instruction stream as a whole - they affect only the ordering of memory accesses. (They may have a specific effect on a specific processor integrated in a specific way with a specific interconnect - but that can never be relied on by software.)

要理解的另一件重要的事情是,即使是强排序的内存也提供隐式保证,仅在访问相同外围设备时进行排序.任何比这更严格的订购要求都需要使用明确的屏障指令.

Another important thing to understand is that even Strongly-ordered memory provides implicit guarantees of ordering only with regards to accesses to the same peripheral. Any ordering requirements more strict than that require use of explicit barrier instructions.

第三个重点是,由于内存类型而发生的任何隐式内存访问顺序都不会影响对其他内存类型的访问顺序.同样,如果您的应用程序具有这样的依赖项,则需要明确的屏障指令.

A third important point is that any implicit memory access ordering that takes place due to memory types does not affect the ordering of accesses to other memory types. Again, if your application has dependencies like this, explicit barrier instructions are required.

现在,在这种背景下——描述设备和强有序内存之间区别的一种更简单的方法是设备内存访问可以被缓冲——在处理器本身或互连中.不同之处在于,缓冲访问可以在结束点完成(或什至启动)之前通知处理器完成.这以丢失任何错误情况的同步报告为代价提供了更好的性能.

Now, against that background - a simpler way of describing the difference between Device and Strongly-ordered memory is that Device memory accesses can be buffered - in the processor itself or in the interconnect. The difference being that a buffered access can be signalled as complete to the processor before it has completed (or even initiated) at the end point. This provides better performance at the cost of losing the synchronous reporting of any error condition.

这篇关于[ARM CortexA]强序和设备内存类型的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆