考虑一个没有任何分支预测的五级指令流水线:取指令(FI)、译码指令(DI)、Fetch Operand(FO)、执行指令(EI)和写操作数(WO)。FI、DI、FO、EI和WO的级延迟分别为5ns、7ns、10ns、8ns和6ns。每个阶段后都有中间存储缓冲区,每个缓冲区的延迟为1ns。在这个流水线处理器中执行一个由12条指令I1、I2、I3、…、I12组成的程序。指令I4是唯一的分支指令,其分支目标是I9。如果在执行该程序期间执行了分支,则完成该程序所需的时间(单位:ns)为
null
(A) 132 (B) 165 (C) 176 (D) 328 答复: (B) 说明:
Pipeline will have to be stalled till Ei stage of l4 completes, as Ei stage will tell whether to take branch or not. After that l4(WO) and l9(Fi) can go in parallel and later the following instructions. So, till l4(Ei) completes : 7 cycles * (10 + 1 ) ns = 77ns From l4(WO) or l9(Fi) to l12(WO) : 8 cycles * (10 + 1)ns = 88ns Total = 77 + 88 = 165 ns
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END