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