MIPS 流水线问题
是否需要转发(以蓝色箭头突出显示)?我认为在 OR 指令读取寄存器之前,add 指令会成功写回寄存器。
Is the forwarding (highlighted by the blue arrow) necessary? I figured the add instruction would successfully write back to register before the OR instruction reads it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
add
写入寄存器的步骤与or
从寄存器读取的步骤相同,因此不能保证正确的值将安全地存在于寄存器处or
看到它 -add
允许一个完整的时钟周期来进行写入并使信号在整个硬件中传播。相比之下,xor
是安全的,因为它在add
写入后的下一个时钟周期内从 r1 读取。add
is writing to register in the same step thator
is reading from register, so there's no guarantee that the correct value will be safely in the register at the pointor
sees it--add
is allowed one full clock cycle to make that write and have the signals propagate throughout the hardware. By contrast,xor
is safe because it reads from r1 in the next clock cycle afteradd
's write.