csapp2e 家庭作业 4.51

################ Pipeline Register Control #########################

# Should I stall or inject a bubble into Pipeline Register F?
# At most one of these can be true.
bool F_bubble = 0;
bool F_stall =
    # Modify the following to stall the update of pipeline register F
  d_srcA != RNONE && d_srcA in {E_dstM,E_dstE,M_dstE,M_dstM,W_dstE,W_dstM}
 ||d_srcB != RNONE && d_srcB in {E_dstM,E_dstE,M_dstE,M_dstM,W_dstE,W_dstM}
 # Stalling at fetch while ret passes through pipeline
 ||IRET in { D_icode, E_icode, M_icode } ;


# Should I stall or inject a bubble into Pipeline Register D?
# At most one of these can be true.
bool D_stall =
 # Modify the following to stall the instruction in decode
 (d_srcA != RNONE && d_srcA in {E_dstM,E_dstE,M_dstE,M_dstM,W_dstE,W_dstM}
 ||d_srcB != RNONE && d_srcB in {E_dstM,E_dstE,M_dstE,M_dstM,W_dstE,W_dstM})&& (!(E_icode == IJXX && !e_Cnd));


bool D_bubble =
 # Mispredicted branch
 (E_icode == IJXX && !e_Cnd) ||
 # Stalling at fetch while ret passes through pipeline
 !(E_icode in { IMRMOVL, IPOPL } && E_dstM in { d_srcA, d_srcB }) &&
 # but not condition for a generate/use hazard
 !(d_srcA != RNONE && d_srcA in { E_dstM, E_dstE, M_dstM, M_dstE, W_dstM, W_dstE } || d_srcB != RNONE && d_srcB in { E_dstM, E_dstE, M_dstM, M_dstE, W_dstM, W_dstE })
 &&  IRET in { D_icode, E_icode, M_icode };

# Should I stall or inject a bubble into Pipeline Register E?
# At most one of these can be true.
bool E_stall = 0;
bool E_bubble =
 # Mispredicted branch
 (E_icode == IJXX && !e_Cnd) ||
 # Modify the following to inject bubble into the execute stage
 d_srcA != RNONE && d_srcA in {E_dstM,E_dstE,M_dstE,M_dstM,W_dstE,W_dstM}
 ||d_srcB != RNONE && d_srcB in {E_dstM,E_dstE,M_dstE,M_dstM,W_dstE,W_dstM};

# Should I stall or inject a bubble into Pipeline Register M?
# At most one of these can be true.
bool M_stall = 0;
# Start injecting bubbles as soon as exception passes through memory stage
bool M_bubble = m_stat in { SADR, SINS, SHLT } || W_stat in { SADR, SINS, SHLT };

# Should I stall or inject a bubble into Pipeline Register W?
bool W_stall = W_stat in { SADR, SINS, SHLT };
bool W_bubble = 0;
#/* $end pipe-all-hcl */

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值