本文介绍了如何计算三级缓存的有效 CPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无可救药地被一个家庭作业问题困住了,我希望得到一些帮助以更好地理解它.这是我得到的:

  1. CPU 基础 CPI = 2,时钟频率 = 2GHz
  2. 主缓存,未命中率/指令 = 7%
  3. L-2 缓存访问时间 = 15ns
  4. L-2 缓存,本地未命中率/指令 = 30%
  5. L-3 缓存访问时间 = 30ns
  6. L-3 缓存,全局未命中率/指令 = 3%,主内存访问时间 = 150ns

什么是有效的CPI?

据我所知,我需要计算每个缓存级别的未命中惩罚.

  • L1 未命中惩罚 = L2 的访问时间 = 15ns/(1ns/2cc) = 30 个时钟周期
  • L2 未命中惩罚 = L3 的访问时间 = 30ns/(1ns/2cc) = 60 个时钟周期
  • L3 未命中惩罚 = MM 的访问时间 = 150ns/(1ns/2cc) = 300 个时钟周期

现在我需要计算有效的CPI.这是我有点困惑的地方.

我认为公式应该是:

CPI = BaseCPI + (%L1 MR/Instr * L1 Miss Penalty) + (%L1 MR/Instr *%L2 MR/Instr * L2 Miss Penalty) + (%Global MR/Instr * L3 Miss Penalty)

如果我这样做,我会得到

CPI = 2.0 + (0.07 * 30) + (0.07 * 0.3 * 60) + (0.03 * 300) = 14.36

在给我的导师发电子邮件后,因为班上没有人理解 1-2 分钟的全局和本地解释,我被告知我的答案很接近,但错误.如果有人可以提供一些见解,甚至为我指出一个好的教程,我将不胜感激.我可以理解如何计算 1 级和 2 级缓存的有效 CPI.跳到 3 让我很困惑.

解决方案

如果是这样呢:对于二级缓存,有效 CPI 为:

CPi=CPI(正常)+MissRAteL1*MissPenaltyL2+GlobalMissRAte*TotalMissPenalty

那么对于三级缓存,它可能是:

CPI=CPI+MissRateL1*MissPenaltyL2+(MISSRATEL2/MissRateL1)(MissPEnaltyL1+MissPEnaltyL2)+GlobalMissRate(MissPEnaltyL1+MissPEnaltyL2+MissL2)

CPI=2+7%x60+(7%/30%)x​​(60+30)+3%x(300+60+90)..

I am hopelessly stuck on a homework problem, and I would love some help understanding it better. Here is what I was given:

  1. CPU base CPI = 2, clock rate = 2GHz
  2. Primary Cache, Miss Rate/Instruction = 7%
  3. L-2 Cache access time = 15ns
  4. L-2 Cache, Local Miss Rate/Instruction = 30%
  5. L-3 Cache access time = 30ns
  6. L-3 Cache, Global Miss Rate/Instruction = 3%, Main memory access time = 150ns


What is the effective CPI?

It is my understanding that I need to calculate the miss penalty for each cache level.

  • L1 miss penalty = Access time of L2 = 15ns / (1ns/2cc) = 30 clock cycles
  • L2 miss penalty = Access time of L3 = 30ns / (1ns/2cc) = 60 clock cycles
  • L3 miss penalty = Access time of MM = 150ns / (1ns/2cc) = 300 clock cycles

Now I need to calculate the effective CPI. This is where I am a bit confused.

I believe the formula should be:

If I do this, I get


After emailing my instructor because no one in the class understood the 1-2 minute explanation of global and local, I was told that my answer is close, but wrong. If anyone could provide some insight, or even point me towards a good tutorial, I would be grateful. I can understand how to figure out effective CPI for 1 and 2 level caches. Making the jump to 3 confuses me.

解决方案

What if it is like this :for a two level cache The effective CPI is:

then for three level cache it might be:

这篇关于如何计算三级缓存的有效 CPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 22:47