[The principle of computer composition for postgraduate entrance examination] Strengthen the storage system

Article directory:

1: Factors affecting the composition of Cache

Two: common questions

Three: Supplementary knowledge points 

Four: Storage system hardware diagram

1. Fully associative mapping TLB+2-way group associative mapping cache

2. TLB4-way group connection mapping diagram

3.4-way group connection mapping diagram

4. TLB full connection mapping diagram

5. TLB 4-way group connection mapping diagram

Five: Schematic diagram of the storage system


1: Factors affecting the composition of Cache

影响Cache组成的因素:Cache大题要注意的六个条件
    A:物理地址PA位数/主存地址
    B:Cache总行数
    C:Cache块大小
    D:Cache-主存映射方式(直接映射、全相联映射、组相连映射)
    E:写策略(直写write-through、写回write-back)
    F:替换算法(LRU、FIFO、随机RAND)

Two: common questions

1.Cache行组成
    1.1 标记位Tag
        判断“Tag”占多少个bit?
        关注条件A B C D
    1.2 有效位V
        一定存在,占1 bit
    1.3 替换信息
        判断"替换信息"占多少bit?
        关注条件D F
            1.3.1 若采用“随机替换算法”,则替换信息位占Obit
            1.3.2 若采用“直接映射方式”,则替换信息位占Obit    
            1.3.3 若采“用LRU 或 FIFO”,则替换信息位占Nbit
                1.3.3.1 N=log2(总行数)——“全相联映射”
                1.3.3.2 N=log2(路数)  ——“组相连映射”
    1.4 行号
        0 bit
    1.5 组号
    1.6 脏位
        关注条件E
            1.6.1 直写法,不需要设置脏位 0 bit脏位
            1.6.2 写回法,需要1 bit脏位
    1.7 块内数据
        关注条件C
            通常题目会直接说每个块内数据多大
            也可能通过块内地址位数推出块内数据大小
    1.8 块内地址



2.拆分物理地址PA
    关注条件A B C D
        2.1 全相联=Tag+块内地址
        2.2 组相联(多行一组)=Tag+组号+块内地址
        2.3 直接映射(一行一组)=Tag+行号+块内地址

3.地址访问的完整过程
    3.1 从虚拟地址开始,到最后访问到目标数据的过程
    3.2 TLB命中分析、缺页分析、Cache命中率分析
    3.2 结合一维数组、二维数组考察
        二维数组需注意按行优先 or列优先存储
        给出数组起始地址、某数组元素下标,要能算出来该元素的地址



4.看图说话
    硬件结构图——熟悉课件中给大家附上的几种硬件图的画法,混个眼熟
    C语言+机器语言视角的内容图

                      The following conditions should be noted                                                    Cache line composition

group associative / direct mapping =

Tag+group number/line number+block address

Tag bit valid bit V

replace

information

line number Group No dirty bit

within the block

data

within the block

address

Split physical address PA

Six conditions to pay attention to in the Cache issue

Physical address PA bits/main memory address

Cache total number of rows
Cache block size

Cache-main memory mapping method

  (direct, fully associative, group associative)

write strategy

 (Write directly, write back)

Replacement Algorithms (LRU, FIFO, Random RAND)

Three: Supplementary knowledge points 

1.知道其中2个可以求出第3个:Cache总行数、Cache块大小、Cache总大小

2.总行数=路数*组号

3.页=页框;页框=物理块/磁块&主存块可以不同;主存块=Cache块=Cache行大小相同;页框!=Cache行/块

4.PA——>Cache(未命中则访存)
    4.1 关注D映射方式
    4.2 根据A B C D拆分PA
    4.3 拆好PA后
            全:Tag有效位
            组:PA内的组号找分组,Tag有效位
            直:PA内的行号找行  ,Tag有效位

5.VA虚拟地址——>PA物理地址(未命中查页表    命中得PPN->PA)
    5.1 拆VA=虚拟页号VPN+页内偏移量vpo
    5.2 查TLB
            全:VPN=Tag,Tag有效位
            组:VPN末尾的M位确定组号 组号找分组(M=log2组数),VPN的前几个bit(去除组号)
    5.3 没有命中:查内存慢表(注意缺页问题 PPA)
            VPN拆分成多级页号
            查页目录->查页表

Four: Storage system hardware diagram

1. Fully associative mapping TLB+2-way group associative mapping cache

 

2. TLB4-way group connection mapping diagram

3.4-way group connection mapping diagram

4. TLB full connection mapping diagram

5. TLB 4-way group connection mapping diagram

Five: Schematic diagram of the storage system

Guess you like

Origin blog.csdn.net/liu17234050/article/details/124189714