EX阶段在流水线式MIPS w转发中分支的作用是什么? [英] What's the role of EX stage for branching in Pipelined MIPS w Forwarding?

查看:228
本文介绍了EX阶段在流水线式MIPS w转发中分支的作用是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请考虑以下流水线处理器结构:

Consider the following Pipelined Processor structure:

请注意,在ID阶段执行对分支的条件测试(=电路)以及在发生分支的情况下下一条指令的目标地址计算-这是一种节省停顿/刷新的方法(如反对在EX阶段执行所有操作,并在给定分支指令的MEM阶段转发结果.

Notice that the condition test for branching (the = circuit), as well as the target address calculation for the next instruction in case of branch taken are executed in the ID phase - as a way to save on stalls/flushes (as opposed to doing all that in the EX phase and forwarding the results in the MEM phase of the given branch instruction).

既然所有工作都在指令解码阶段完成,为什么还要等待给定的分支指令到达EX阶段呢? EX级ALU单元是否可以通过某种方式发挥作用?

Since all the work gets done in Instruction Decode stage, why bother waiting for the given branching instruction to reach the EX stage? Does the EX stage ALU unit have a role in this, somehow?

谢谢.

推荐答案

既然所有工作都在指令解码阶段完成,为什么还要等待给定的分支指令到达EX阶段呢? EX级ALU单元是否可以通过某种方式发挥作用?

Since all the work gets done in Instruction Decode stage, why bother waiting for the given branching instruction to reach the EX stage? Does the EX stage ALU unit have a role in this, somehow?

仅在Decode阶段对分支指令进行解码和解析,我们不等待它进入EX阶段.

The branch instruction is decoded and resolved in the Decode stage only and we do not wait for it to go to the EX stage.

就像您在问题中指出的那样,分支结果和目标地址的计算都是在DEC阶段完成的.硬件通过从正确的阶段转发所需的数据来处理RAW危险(注意,在读取RegFile之后立即注意一些小复用).结果,分支相等性检查将看到正确的操作数,并且结果将驱动PCSrcD信号.该信号进一步确定了图中第一个Mux的输出(实际上决定了PC+4Branch Target之间的信号.因此,在DEC级本身中进行此操作变得安全,快捷.

Like you pointed out in the question, both the branch result and the target address calculation is done in the DEC stage. The hardware takes care of the RAW hazards by forwarding the required data from the correct stages (notice the little mux'es right after the RegFile is read). As a result the branch equality check sees the correct operands and the result drives the PCSrcD signal. This signal further decides the output of the first Mux in the diagram (which essentially decides between PC+4 or Branch Target. Hence it becomes safe and quick to do this in the DEC stage itself.

此外,没有与分支指令相关的信号(PCSrcDBranchDPCBranchD)进入EX级.如果看到ISS/EX寄存器的输入,则该信号不包含任何上述信号.因此,信息不会传递到EX阶段,并且分支在DEC阶段结束时会完全解析并退出.

Also, none of the branch instruction related signals (PCSrcD, BranchD, PCBranchD) make it to the EX stage. If you see the inputs to the ISS/EX register, it doesn't take in any of the above mentioned signals. Hence, the information isn't passed the to EX stage and the branch is completely resolved and retired at the end of the DEC stage itself.

这篇关于EX阶段在流水线式MIPS w转发中分支的作用是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆