如何实现单个周期CPU并避免延迟插槽?

发布于 2025-02-06 09:20:46 字数 261 浏览 2 评论 0原文

我正在Verilog中实施一个CPU的单个周期(一个指令)。 CPU应支持RISC-V addLWSWBEQ指令。

问题是,当指令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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文