计算机体系结构¶
大二春夏专业课,这里直接参考学长的笔记了
4 ILP¶
Scoreboarding、Tomasulo and ROB¶
关于乱序流水线的引入与 scoreboard 算法的介绍:【计算机体系结构】记分牌ScoreBoard - 知乎
Tomasulo 算法的介绍:【计算机体系结构】Tomasulo算法 - 知乎
重排序结构的介绍:【计算机体系结构】重排序缓存ROB - 知乎
Exploiting ILP Using Multiple Issue and Static Scheduling¶
Superpipelining
超级流水线(Super-pipelined)处理器通过进一步细分每个流水线阶段,使得多个指令可以在一个时钟周期内进行时间共享处理。这种处理器被称为超级流水线处理器。
对于能够在一个时钟周期内流出n条指令的超级流水线计算机:
- 这n条指令并不是同时流出的。
- 而是每1/n个时钟周期流出一条指令。
- 实际上,超级流水线计算机的流水线周期为1/n个时钟周期。
Super-scalar
-
每个时钟周期发出的指令数量不固定,在超标量(Superscalar)处理器中,每个时钟周期可以发出的指令数量不是固定的,而是根据代码的具体情况而变化。这个数量可以在1到8之间,但有一个上限。
-
如果一个处理器在每个时钟周期最多可以发出n条指令,那么这个处理器就被称为n-issue处理器。
-
静态调度:可以通过编译器提前安排指令的执行顺序,这种方式称为静态调度。
- 动态调度:也可以在运行时根据 Tomasulo 算法来动态地安排指令的执行顺序,这种方式称为动态调度。
VLIW (Very Long Instruction Word)
-
固定数量的指令:在每个时钟周期内,VLIW 处理器会发出固定数量的指令,这个数量通常在 4 到 16 条之间。这些指令共同构成一个长指令或称为指令包。
-
显式表达并行性:在指令包中,指令之间的并行性是通过指令本身明确表示出来的。这意味着编译器需要提前确定哪些指令可以并行执行,并将它们打包在一起。
-
静态调度:指令调度是由编译器在编译阶段完成的,而不是由处理器在运行时动态决定。这使得编译器能够优化指令的顺序和组合,以最大化并行执行的效果。
5 DLP and TLP¶
5.1 SIMD: Vector Processor¶
(1) Horizontal processing method
(2) Vertical processing method
(3) Vertical and horizontal processing method (group processing method)
CRAY-1¶
Improve the Performance of Vector Processor
- Set up multiple functional components and make them work in parallel.
- Use vector chaining technology to speed up the execution of a string of vector instructions.
Example
乘法需要7个节拍,加法、从寄存器中取到向量寄存器均需要6个节拍。另外每一组都需要额外的两拍 It takes 1 beat of transmission delay to start the memory fetch, send the element to the functional part and send the calculation result to Vi.
(1) The execution time using serial method is: [(1+6+1)+N-1] + [(1+6+1)+N-1] + [(1+7+1)+N-1] = 3N + 22
(2) The first two instructions are parallel, and the third is serial. The execution time is: max{[(1+6+1)+N-1], [(1+6+1)+N-1]} + [(1+7+1)+N-1] = 2N + 15
(3) Use vector chaining technology. The execution time is:
max{(1+6+1), (1+6+1)} + (1+7+1)+N-1 = N + 16
- Adopt recycling mining technology to speed up recycling processing.
- Using a multi-processor system to further improve the performance.