通过以下处理器和缓存性能计算平均内存访问时间

发布于 2025-02-06 04:54:05 字数 1365 浏览 4 评论 0原文

考虑以下处理器和高速缓存配置

时钟速率500MHz
base CPI1
L1 CACHE类型单独的指令和数据缓存
L1 CACHE WRET POLICT策略写入cache
l1 cache命中时间2NS
l1 list ligh40ns(时间是从并从中读取并写入主机内存)L1指令
L1指令高速缓存率1%
L1日期缓存率5%
脏数据缓存块块的40%数据缓存块

(a)计算指令缓存的平均内存访问时间(AMAT)。

(b)计算假设加载和存储的数据缓存的平均内存访问时间(AMAT)表示指令的20%。

我的答案

(a):
根据公式
amat =命中时间+错过*罚款
AMAT = 2NS+0.01*40NS = 2.4NS

(b):
根据公式
amat =命中时间+错过*罚款
AMAT = 2NS+0.05* 40NS* 0.2 = 2.4NS

上面的答案是我的意见,但我不确定如何使用缓存配置,例如肮脏的数据缓存块和时钟速率。我的答案是正确的还是我错过了什么?感谢您的阅读!

Consider the following processor and cache configurations

Clock rate500MHz
Base CPI1
L1 cache typeSeparate Instruction and Data Cache
L1 cache write policyWrite-back
L1 cache hit time2ns
L1 miss penalty40ns(time to read from and write to main memory)
L1 instruction cache miss rate1%
L1 date cache miss rate5%
dirty data cache blocks40% of total data cache blocks

(a) Compute the average memory access time(AMAT) for Instruction cache.

(b) Compute the average memory access time(AMAT) for data cache assuming load and store represent 20% of instructions.

My answer

(a) :
According to the formula
AMAT= hit time+miss rate* miss penalty
AMAT= 2ns+0.01*40ns =2.4ns

(b) :
According to the formula
AMAT= hit time+miss rate* miss penalty
AMAT= 2ns+0.05* 40ns*0.2 =2.4ns

Above answer is my opinion but I am not sure how to use cache configurations such as dirty data cache blocks and Clock rate. Are my answers right or am I missing something? Thanks for reading!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫罗兰の梦幻 2025-02-13 04:54:09

40ns(是时候从中读取并写入主存储器)

该文本中的Code>和中使用的使用是尴尬的。 这可能意味着40ns =读取 +写下,因此40ns用于补充肮脏的高速缓存线,但我认为最好将其读成“两者”,因此可以阅读40ns,也可以将40ns读写为书写。我会在那里写,以避免从“ ”之间的混淆,从“又要”或“也是”的意义上,而在加法的意义上。

您的(a)看起来正确。

在(b)上:

  1. L1数据缓存遭受5%的失误率,在40%的情况下,失误必须写下和阅读。 因此,在这里,我们需要区分读取操作和写下操作,因为所有错过的读取时间,而40%也会产生写作时间​​。

  2. 我不用于指定数据的平均访问时间(加载商店),其中包括无法访问数据的说明。 但是,如果您想在某个时候组合I& D-CACHE TIMES可以全面了解AMAT每说明。 因此,沿着这条路线,我们需要将20%的命中率应用于命中,而不仅仅是错过。 我将在没有20%的情况下计算数据缓存性能(即指令是负载或商店:什么是AMAT),然后将20%的限制为平均为20%。

我看不到问题(a)或(b)的周期或MHz。

40ns(time to read from and write to main memory)

The use of the conjunction and in that text is awkward.  It could mean that 40ns = read + write-back, so 40ns for refilling a dirty cache line, but I think it is better to read that as "both" instead, so 40ns for read and also 40ns for write-back.  I would have written or there instead, to avoid the confusion between and in the sense of "both", or "as well", vs. in the sense of addition.

Your (a) looks right.

On (b):

  1. The L1 data cache suffers a miss rate of 5% and in 40% of those cases, the miss has to write-back as well as read.  So, here, we need to distinguish between the read operations and the write-back operations, since all misses incur read time, while 40% will also incur write-back time.

  2. I am not used to specifying an average access time for data (loads & stores), that includes instructions that don't access data.  However, that does make sense if at some point you want to combine the i & d-cache times to get an overall view of the AMAT per instruction.  So, going along that route, we need to apply the 20% to both hits and misses not just to misses.  I would compute the data cache performance without that 20% (i.e. given the instruction is a load or store: what is the AMAT), then factor that 20% in last to average that out over all instructions.

I don't see cycles or MHz involved in either question (a) or (b).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文