文件名称:控制冒险branch-一道关于存储的详解题
文件大小:662KB
文件格式:PPT
更新时间:2024-05-12 07:15:15
题目
控制冒险(branch) “是否转移”在Mem阶段确定 所以在取正确的目标指令之前,已有三条指令被取出,取错了三条指令! 延迟损失时间片C=3 但如果预测正确则不会取错指令(C=0) Cycle 4 Cycle 5 Cycle 6 Cycle 7 Cycle 8 Cycle 9 Cycle 10 Cycle 11 16: R-type 24: R-type 12: Beq (target is 1000) 20: R-type Clk 1000: Target of Br Ifetch Reg/Dec Exec Mem Wr Ifetch Reg/Dec Exec Mem Wr Ifetch Reg/Dec Exec Mem Wr Ifetch Reg/Dec Exec Mem Wr Ifetch Reg/Dec Exec Mem Wr * Notice that although the branch instruction is fetched during Cycle 4, its target address is NOT written into the Program Counter until the end of clock Cycle 7. Consequently, the branch target instruction is not fetched until clock Cycle 8. In other words, there is a 3-instruction delay between the branch instruction is issued and the branch effect is felt in the program. This is referred to as Branch Hazard in the text book. And as we will show in the next lecture, by clever design techniques, we can reduce the delay to ONE instruction. That is if the branch instruction in Location 12 is issued in Cycle 4, we will only execute one more sequential instruction (Location 16) before the branch target is executed. +2 = 71 min. (Y:51)