使用流水线理解加速方程

Understanding the speedup equation with Pipelining

我在计算流水线加速比时遇到了很多问题。这是我的计算机组织中为此提供的幻灯片 class。

公式我不是很懂

为什么是2n? 为什么是 0.5n + 1.5?

我的教授开始解释 1.5 来自 A 开始和 B 开始之间的 1.5 小时......用这样的图片很容易看出来,但问题是......

Suppose you have a pipelined machine with a 10 stage pipeline and a program with 1000 instructions whose dependencies are such that the pipeline does not stall. If each stage of the pipe takes 1 cycle, what is the speedup gained by pipelining compared to execution of the program on the same machine without exploiting the pipeline?

我不认为我可以只画一幅画...而且我知道必须有比画一幅画更好的方法。

任何人都可以解释管道加速 and/or 提供一些很好的在线 material 来理解这个吗?

我遇到的流水线的经典例子就是流水线! 假设您将 A-B-C-D-E 作为完成的五个阶段,并且每个阶段涉及不同的资源; 当 E 正在处理时,可以执行 A-D 的资源是空闲的,这就是流水线利用以获得某种形式的并发的原因。

所以你的时间表看起来像 - 假设你有 1000 个工作项,每个工作项都执行上述操作 1. 如果没有流水线,您基本上会重复 A-B-C-D-E a 1000 次,导致时隙为 5000! 2. 使用管道,您会在第一轮获得 A-B-C-D-E,然后每隔一段时间,您将获得一个输出,即

A-B-C-D-E       // ends at t=5
__A-B-C-D-E     // ends at t=6!
____A-B-C-D-E   // ends at t=7!
.....
...... 
............
A-B-C-D-E // 1000th process ends at t=1005 (starts at t=1000)

我想您也可以将其扩展到 10 级流水线案例。