根据程序的局部性原理,在主存与CPU之间设置的一个高速的容量较小的存储器,叫做cache。

ARM cache架构由cache存储器和写缓冲器(write-buffer)组成。其中Write_buffer是cache按照FIFO原则向主存写的缓冲器。

cache可以分为Dcache,Icache。分别cache data和 instruction。其中Dcache必须在MMU开启后才能在CP15寄存器中使能,Icache在MMU未使能的情

况下,也是可以使能的。

在armv6版本之前的memory attribute:

一般会在使能MMU的过程中,规定MMU page table的definition。其中20bit表示每一page的memory attributes。12位表示每一page的基地址。一共32

位。每一page都会设置两个属性,cacheable,bufferable。其中每一page的memory attribute有

strong ordered,

Outer and inner write-back, write allocate,

Outer and inner write-through, no write allocate,

Outer and inner write-through, no write allocate,shared Device.

Shared Device.

non-cacheable.

MMU_CACHE:

.word            0x5000_0000|strong ordered;(其中strong order由20bit来表示)

其中arm的基本memory attribute有四种:

NCNB(Non-cacheable,non-bufferable,Strongly-ordered),

NCB(Non-cacheable,bufferable,Device),

Write-Through Cacheable bufferable,

Write-Back Cacheable bufferable

Write-Through方式:CPU向cache写入数据时,同时也向memory写一份,使得cache和memory的数据保持一致,缺点是每次都要访问memory,速度较

慢。

Write-Back方式:CPU更新cache时,只是把更新的cache区标记一下,并不同步更新memory,只有在cache区被新进入的数据取代时,才更新memory。

会引起memory和cache的一致性问题。

Write-allocate方式:在cache miss的情况下,先对存储器进行read操作,将操作数读入cache,在进行读写,这样便cache hit。

Bufferable与non-bufferable的区别,主要表现在ack信号的返回上,bufferable--将结果写入buffer(某个component)便返回ack,

non-bufferable等到结果写入外存,返回ack。

在AMBA3---AXI中,有四位的arcache/awcache信号,来表示transaction的这种属性。

arcache/awcache[0]表示,bufferable信号,表示interconnect或其他compnonent可以先返回ack,之后再写向final distination,只用在write操作。

arcache/awcache[1]表示,cacheable信号,对写操作,表示可以有不同的write megered together。

对读操作,表示该地址的数据可以pre-fetched,可被用在多个read transaction中。

arcache/awcache[2]表示,Read Allocate信号,如果一个transfer 读操作cache miss,它会allocated后再读。

arcache/awcache[3]表示,Write Allocate信号,如果一个write transfer cache miss,它会allocated,后读外存,在write-back方式的写回。

      这两bit的信号在AXI3中主要是Cache的互联中,会进行设置,通过smmu出来之后的transaction,之间简单的加载外存的值。

在armv7及其之后的版本,Bus AXI4中的memory attribute:

主要的基点改动,

  1) AxCache[1]表示modified的意思;

  2) AXI4对non-modified的transaction有order的限制;

  3) RA,WA变为了对memory attribute的编码。

modifiable transaction表示,

  1)一个大的transaction,可以被分割为多个小的transaction;

  2)多个小的transaction,可以被merge为一个大的transaction;

  3)一个read operation,可以读取超过需要的数据,prefetch数据,这样之后可能可以少发送一些read transaction;

  4)一个write operation,也可以访问一个更大的地址空间,不合理的地址对应的数据,使用strb信号关闭;

  5)所以一个transaction,从源到目的地,AxAddr,AxSize,AxLen,AxBurst信号的值,都可以改动。

对于non-modifiable transaction,这些信号在传输过程中,是不能被修改的,transaction也就是不能被merge和split

  但是AxCache信号,从Bufferable转换为Non-Bufferable是可以的,

  一个burst length大于16的transaction,也可以被split为几个小的burst length的transaction。这是个例外可以改length的地方

Bus memory attribute的更多相关文章

  1. Bus,Exclusive access,memory attribute

    指令LDREX,STREX是在armv6中新加的指令,配合AMBA3--AXI中的lock[1:0]信号. 在Atomic Access一节中是这么规定的:ARLOCK[1:0]/AWLOCK[1:0 ...

  2. armv8 memory translation

    AArch32,arm的32bit架构: AArch64,arm的64bit架构: ARMv8.2-LPA,是armv8.2中的新feature,扩大了IPA和PA的支持范围,从48bit扩展到52b ...

  3. armv8 memory system

    在armv8中,由于processor的预取,流水线, 以及多线程并行的执行方式,而且armv8-a中,使用的是一种weakly-ordered memory model, 不保证program or ...

  4. memory consistency

    目前的计算机系统中,都是shared memory结构,提供统一的控制接口给软件, shared memory结构中,为了memory correctness,可以将问题分为:memory consi ...

  5. Memory Ordering in Modern Microprocessors

    Linux has supported a large number of SMP systems based on a variety of CPUs since the 2.0 kernel. L ...

  6. Interrupt distribution scheme for a computer bus

    A method of handling processor to processor interrupt requests in a multiprocessing computer bus env ...

  7. arm-cache coherency

    提高一个系统的performance,有两种办法: 1) 不断提高一个core的performance,手段就是不断提高freq,减小Vt,这样都会在增加power(dynamic,leakage) ...

  8. Linux内存初始化(二)identity mapping和kernel image mapping

    一.前言 本文没有什么框架性的东西,就是按照__create_page_tables代码的执行路径走读一遍,记录在初始化阶段,内核是如何创建内核运行需要的页表过程.想要了解一些概述性的.框架性的东西可 ...

  9. Method, apparatus, and system for speculative abort control mechanisms

    An apparatus and method is described herein for providing robust speculative code section abort cont ...

随机推荐

  1. Jenkins常见任务配置

    一.pmd 二.checkstyle -DskipTests=true clean compile package -Dcheckstyle.config.location="custom- ...

  2. android分辨率适配

    重要概念 什么是屏幕尺寸.屏幕分辨率.屏幕像素密度? 什么是dp.dip.dpi.sp.px?他们之间的关系是什么? 什么是mdpi.hdpi.xdpi.xxdpi?如何计算和区分? 在下面的内容中我 ...

  3. mysql概要(六)连接(内连接,左,右外连接

    内连接 [join on / from 表1,表二 ]效果一样 区别是:可以理解为首先取得笛卡儿积后,再匹配/还是根据条件获得笛卡尔积 内连接:取俩表的交叉匹配数据:(mysql 内连接 左连接 右连 ...

  4. tomcat如何配置context的docBase

    docbase是web应用和本地路径,path是tomcat访问这个应用的URL路径.Tomcat的项目部署方式有以下三种:1.直接把项目复制到Tomcat安装目录的webapps目录中,这是最简单的 ...

  5. /etc/vim/vimrc的一个的配置

    (转)Vim 配置文件===/etc/vimrc "===================================================================== ...

  6. Pycharm中如何使用科学计算库

    1.简便起见 比起麻烦的安装各种库,我们选择最方便的Anaconda的conda或pip(兼容支持)安装相关库. Pycharm本身缺少numpy和matplotlib这些库,而另一个Python的开 ...

  7. 金字塔原理——MECE(Mutually Exclusive Collectively Exhaustive)

    一.金字塔原理 它的样子: 一个中心思想,分出下面2到N个思想支撑,每个分论点下面又有2到N个思想(事实或数据)支撑,以此类推,形状如金字塔.原则是以终为始(先结果后原因),以上统下,归纳分组,逻辑递 ...

  8. 【紫书】BigInteger 高精度类型 原书上有一个bug:A+B!=B+A

    存个代码 struct BigInterger { static const int BASE = 1e8; ; vector<int> s; BigInterger() { *this ...

  9. Gym - 101020H Weekend floyd+next_permutation

    https://vjudge.net/problem/Gym-101020H 题意:正常读取方式给你一个图(双向的),然后给你f个点,让你找一条路从1到n的最短路,要求经过f个点(以任意顺序). 题解 ...

  10. 启用yarn日志聚集功能

    在yarn-site.xml配置文件中添加如下内容: ##开启日志聚集功能        <property>                <name>yarn.log-ag ...