试图计算执行五级Pipeline处理器指令的时间

问题描述 投票:1回答:1

假设M5是一个五阶段流水线实现。

我知道五阶段管道有以下步骤:

    IF -- instruction fetch (and PC update)
    ID -- instruction decode (and get operands from registers)
    EX -- ALU operation (can be effective address calculation)
    MA -- memory access
    WB -- write back (results written to register(s))

如果假设有100条MIPS指令与以下指令组合:

Loads 23%, Stores 12%, Conditional Branches 12%, Jumps
8% and R-type instructions 45%.

The CPU clock frequency is 1.2 GHz

我正在尝试计算执行100条指令的时间。我理解如何使用此公式计算非管道的时间

ExTime = Instruction count * CPI * Clock period in seconds

我使用1/f = 8.33 * 10^-10 seconds将频率转换为周期但我不确定如何计算此管道的执行时间,我是否需要知道管道实现的周期?

请帮帮我,因为我在网上找不到合适的例子。谢谢

编辑

我想我找到了答案!

我发现了一些信息

INSTRUCTION LATENCY = 5 time units THEREFORE
INSTRUCTION THROUGHPUT = 5 * (1 / 5) = 1 instruction per time unit
So in this case it would be: 
ExTime in seconds = Number of instructions * clock cycle period in seconds
mips pipeline
1个回答
0
投票

忽略分支/跳转时刷新所花费的时间:

给定指令组合中指令的平均周期数=

(0.23)* 5 +(0.12)* 4 +(0.12)* 4 +(0.08)* 4 +(0.45)* 4 = 4.23个时钟周期

(加载需要5个周期,存储:4,R:4,跳转/分支:4)

现在,

1条指令平均占用的周期数= 4.23

=>平均值= 423的100条指令的周期数

时钟频率= 1.2Ghz

=> 1个循环所需的时间= 8.33 * 10 ^ -10

=> 423个循环所需的时间= 3.5236 * 10 ^ -7 = Ans

© www.soinside.com 2019 - 2024. All rights reserved.