Pipeline Data Hazards

Pipeline数据冒险主要分为数据危害和控制危害。数据危害包括读写冲突(RAW),解决方法有检测并暂停或检测并转发。检测并暂停策略会在发现危害时使处理器暂停,直到危害消除,但会增加CPI。检测并转发则通过额外的数据路径和MUX控制来传递计算数据,减少暂停,但仍可能需要在某些情况下暂停,如加载指令后使用该寄存器的情况。
摘要由CSDN通过智能技术生成

Pipeline Hazards

What can go wrong in pipelining?

  • Data Hazards: Wrong data read before data is written.
  • Control Hazards: Wrong instruction fetched before a taken branch.
  • Exceptions

Data Hazards

read-after-write (RAW) dependences

add 1 2 3    //writes reg 3
nor 3 4 5    //reads reg 3

Two possible solutions.

Detect and Stall

If hazards exist, stall the processor until they go away.

  • Detect: Compare regA & regB with previous DestRegs

  • Stall:

    • Keep current instructions in fetch and decode (IF/ID reg & pc unchanged)
    • Pass a noop to execute

    在这里插入图片描述

    Time table for
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值