【问题标题】:Trying to calculate the time to execute instructions of a five-stage Pipeline processor试图计算一个五级流水线处理器执行指令的时间
【发布时间】:2012-09-06 09:58:42
【问题描述】:

假设 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

【问题讨论】:

  • 我不明白为什么我应该得到-1?需要解释一下吗?
  • 您还需要考虑到分支和跳转上的管道刷新。
  • 那么你将如何继续计算呢?

标签: mips pipeline


【解决方案1】:

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

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

(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

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

时钟频率 = 1.2Ghz

=> 1 个周期所用时间 = 8.33 * 10^-10

=> 423 个周期所用的时间 = 3.5236 * 10^-7 = Ans

【讨论】:

    猜你喜欢
    • 2014-01-06
    • 2013-08-15
    • 2017-06-02
    • 1970-01-01
    • 1970-01-01
    • 2020-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多