如何实现单个周期CPU并避免延迟插槽?
我正在Verilog中实施一个CPU的单个周期(一个指令)。 CPU应支持RISC-V add
,LW
,SW
,BEQ
指令。
问题是,当指令BEQ
被解码时,BEQ
之后的指令已经在管道中并将执行,无论比较结果如何。
RISC-V规格说应该没有延迟插槽。如何实现这一目标,而不会破坏每个周期设计规则的指令?
I am implementing a single cycle (one instruction per cycle) CPU in verilog. The CPU should support RISC-V add
, lw
, sw
, beq
instructions.
The problem is, when the instruction beq
is decoded, the instruction after beq
has already been in the pipeline and will be executed, no matter what the comparison result is.
RISC-V specification says there should be no delay slots. How can I achieve that, without breaking the one instruction per cycle design rule?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论