[我要考试]计算机体系结构_威斯康星_博士资格考试_Spring1988_Q2_Cache地址

这道题目是有关cache地址访问问题,在文章《学习笔记——Cache访问地址问题》中有技术说明。

2

The memory system for a processor has the following characteristics:

(a) A single 4G-bytevirtual address space of aligned four-byte words, addressed with 32-bitbyte-addresses. The memory system, therefore, accepts the 32-bit addresses, discardsthe two low-order bits, and uses the upper 30 bits to select one of 230words.

(b) Pages and page frames are 4K bytes large.

(c) Physical memory will not exceed 226 bytes.

(d) The cache size is 16K bytes, associativity is four-way, block size is32 bytes, and blocks are tagged with physical addresses.

(e) The Translation Lookaside Buffer (TLB) holds 128 entries and is directmapped.

 

Draw a block diagram of the important datapath components and connectionsfor data read or instruction fetch that hits in a cache accessed in parallelwith the TLB. Be sure to indicate the width of connections (e.g., how many bitsare used to select the set of a reference?). Explicitly state any assumptionsyou make. Discuss the advantages and disadvantages of reducing cacheassociativity to two way.

 

Answer:

这个系统有4G的虚拟地址空间,即VA是32位;

有64M的物理地址空间,即PA是26位;

页大小是4K,即页内偏移时12位;

Cache是16K,4路组相连,cache行大小是32位,cache的entry有128个,cache寻址是7位地址比较,并且重要的是cache是物理地址映射方式,这样在进行cache访问的时候,需要先把虚拟地址通过TLB进行物理地址的转换。

系统完整的寻址模式如下:

注意,这儿由于cache是16K,而页大小是4K,并且是4-way组相连,因此相当于cache一下子可以覆盖4个页空间,从而使得可以同时用页内偏移进行cache寻址。寻址图如下:


o       首先在第一个周期,同时发出VA的TLB查找以及利用VA的低7位进行Cache查找;

o       在第二个周期可以得到物理地址PA的高14位以及Cache中的Tag值和数据,并能进行比较;

o       第三个周期就可以得到所需要的数据

 

如果现在cache变为2路组相连,则在第一个周期无法利用VA的低7位进行cache查找,这个时候的查找流程变为:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值