<超標量處理器概覽> 第 1 章 - 超標量處理器概覽
1.2 - 普通處理器的流水線 1.2.2 - 流水線的劃分 Pipeline CPU,其 cycle time 由最長 cycle time 的 pipeline stage 所決定 因此,最好每個 pipeline stage 的 cycle time 都是差不多長的 解決各個 pipeline stage cycle time 不平衡的方法: 合: 將多個 pipeline stages 合併成一個 stage,例如: Fetch (7 ns) & Decode (3 ns) | Operand fetch (8 ns) & Execute (5 ns) | Memory (10 ns) & Write back (3 ns) 此方法將 pipeline stages 從 5 個降為 3 個,原本各個 pipeline stage cycle time 不平衡的情況也變成:10 ns | 13 ns | 13 ns 適用於對於性能要求不高的 CPU,例如:ARM7、ARM9、Cortex-M0、Cortex-M3 因為 pipeline stage 的 cycle time 增加了,從原本的 max(7 ns, 3 ns, 8 ns, 5 ns, 10 ns, 3 ns) ⇒ 10 ns,增加為 max(10 ns, 13 ns, 13 ns) ⇒ 13 ns,cycle time 增加,就代表 CPU 的 frequency 會降低 拆: 將 pipeline stage 拆成更小的 stages,例如: Fetch (7 ns) ⇒ Fetch1 (3.5 ns) & Fetch2 (3.5 ns) 適用於高性能 CPU,因為可以提昇 CPU 的 frequency 缺點: 增加所需的硬體元件,例如:需要多個 pipeline registers 功耗會增大 較深的 pipeline 也會增加 branch misprediction 的 penalty 1.2.3 - 指令間的相依性 Instructions hazard: ...