• 计算机组成与设计-第五章 memory hierarchy(一)


    5.1 Introduction

    存储器访问是计算机中最常见的动作。我们希望有无限大的存储空间,并且访问速度很快,但这两者是矛盾的。通常来说,存储器越小,离CPU越近,访问速度会快;存储器越大,离 CPU越远,访问速度越慢。

    Memory access有两个局部性(principle of locality):这里直接复制书中的内容

    Temporal locality (locality in time): if an item is referenced, it will tend to be referenced again soon.

    Spatial locality (locality in space): if an item is referenced, items whose

    addresses are close by will tend to be referenced soon

    时间局部性通常体现在循环中。

    空间局部性的例子有顺序执行的程序,数组等块存储结构

    Cache既利用了空间局部性,也利用了时间局部性。空间局部性是cache中的每一个cache line包含一段地址相邻的数据;时间局部性,缓存在cache中的数据,下次被访问的时候,直接从cache中取。

    根据局部性原则,引入了memory hierarchy,如下图

    顶层的memory:容量小;速度快;价格贵;存储密度低

    底层的memory:容量大;速度慢;价格低;存储密度高

    顶层memory中的内容一定包含在底层memory中;通常数据的交换只会发生在相邻的两层memory之间。

    hit rate The fraction of memory accesses found  in a level of the memory hierarchy.

    miss rate The fraction of memory accesses not found in a level of the memory hierarchy.

    hit time The time required to access a level of the memory hierarchy, including the time needed to determine whether the access is a hit or a miss.

    miss penalty The time required to fetch a block into a level of the memory hierarchy from the lower level, including the time to access the block, transmit it from one level to the other, insert it in the level that experienced

    the miss, and then pass the block to the requestor.

     

    5.2 memory technology

    SRAM (static  random access memory)

    每bit由6-8个晶体管组成;读操作不会影响数据,不需要刷新;访问速度快;只要不掉电,数据就不会丢失。

    DRAM(dynamic random access memory)

    - the value kept in a cell is stored as a charge in a capacitor.

    - A single transistor is then used to access this stored charge。 So one transistor per

    bit of storage

    - must periodically be refreshed

    refresh方式:读出来,再写进去。

    数据保持时间是几个ms,所以要每隔几个ms要做一次refresh。DDR颗粒可以是每个bank refresh,也可以所有bank一起refresh。

     

    DDR SDRAM。

    每个bank都有一个buffer。

    Address interleaving:向多个bank发出地址,同时访问多个bank,带宽倍增。

    参考:

    1. 计算机组成与设计 第五版 ARM版

  • 相关阅读:
    存储模块 --- Cache
    【C++】继承 ⑥ ( 类型兼容性原则 | 父类指针 指向 子类对象 | 使用 子类对象 为 父类对象 进行初始化 )
    专精特新企业申报条件是什么?
    智慧物联仓储可视化管理系统
    okHttp的https请求忽略ssl证书认证
    Oracle整体架构
    基于Linux的Web小型服务器HTTP项目的自主实现
    H5点击复制功能 兼容安卓、IOS
    【Iterator模式】C++设计模式——迭代器
    C++——构造函数
  • 原文地址:https://blog.csdn.net/m0_38037810/article/details/126638169