• Rocket core structure/data/control hazard


    https://mp.weixin.qq.com/s/sRYIPj9tlxuZAPZxwYpEYQ

     

    简单介绍structure/data/control三大类hazard相关的实现。

     

    参考链接:https://www.elsevier.com/__data/assets/powerpoint_doc/0004/273712/Chapter_04-RISC-V.ppt

     

    1. 概述

     

    Hazard是指Situations that prevent starting the next instruction in the next cycle。

    主要分为三大类:

    a. Structure hazards: A required resource is busy

    b. Data hazard: Need to wait for previous instruction to complete its data read/write

    c. Control hazard: Deciding on control action depends on previous instruction

     

    2. structure hazard

     

    在EX阶段有一个structure hazard,即replay_ex_structural:

    包括两种情况:

    a. 指令需要使用数据存储,但是数据存储没有ready,处于busy状态无法被使用;

    b. 指令需要使用除法器,但是除法器没有ready,处于busy状态无法被使用;

     

    在当前的实现中,对replay_ex_structural的处理方法是重新执行所需资源无法满足的指令。

     

    3. data hazard

     

    data hazard包括如下几种情况:

    a. ID和EX阶段之间的hazard;

    b. ID和MEM阶段之间的hazard;

    c. ID和WB阶段之间的hazard;

    d. ID和MEM阶段之间还有一种load-use hazard;

     

    处理方法有如下几种:

    a. 能bypass的则使用bypass;

    b. 不能使用bypass,但是可以stall的,则将后续指令stall在ID阶段;

    c. 如果后续指令已经前进到EX阶段,则将其kill掉,然后重新执行(replay);

     

    4. control hazard

     

    在MEM阶段有一个control hazard,即mem_misprediction:

    如果分支预测错误,则需要重新取指。

     

  • 相关阅读:
    黑马java课程2222
    屏幕亮度软件和一些自己必用的软件设置
    ahk保存
    天天洗一次澡还真是好方法
    自动化测试 就这两张图
    python __init__.py用途
    bash检查文件格式
    cygwin中运行命令提示command not found的解决方法
    Python批量插入SQL Server数据库
    怎样去掉FireFox的导入向导
  • 原文地址:https://www.cnblogs.com/wjcdx/p/16036347.html
Copyright © 2020-2023  润新知