Skip to the content.

BOOM 微架构学习(1)——取指单元与分支预测

BOOM 微架构学习(2)——译码单元与寄存器重命名

所谓寄存器重命名即是将每条指令使用的 ISA 寄存器映射到物理寄存器上的过程。 寄存器重命名的主要目的是解决流水线中的 WAW 和 WAR 依赖(RAW 依赖是真依赖,无法通过寄存器重命名的方法解决)。 之所以能通过寄存器重命名方式解决 WAW 和 WAR 依赖,是因为这两种依赖本质上是由于这两种情况导致的:

  1. 指令集规定的寄存器数量不足,导致可用的寄存器“标号”过少,编译器只能重复使用相同的寄存器,导致出现本不应该出现的依赖
  2. 在循环中,每次使用的都是同一个寄存器,但实际上每次循环中该寄存器的值直接并不一定存在关联

总结的太好了

重命名映射表里包括了

重命名映射表分为

所谓的 busyTable 也就是是否 ready 而已

BOOM 微架构学习(3)——ROB 和指令发射

Entry 含义
valid 该 Entry 是否有效
busy 该 Entry 的指令是否在执行中
exception 该 Entry 是否是一个异常
br_mask 该 Entry 的指令属于哪个处于预测中的分支上
rename_state 该 Entry 的逻辑目标寄存器和物理目标寄存器分别是什么

发射队列存储着已经派遣(进入 ROB)但还没执行的指令。当某个指令的全部操作数均 ready 时,该指令即可请求发射;发射后,该指令即可从发射队列中移除出去。

在 BOOM 中存在着三个发射队列(整数指令、浮点指令和访存指令),不同类型的指令会放入不同的发射队列中。

目前 PNR 仅仅用于 RoCC 的场景下。很多 RoCC 要求发来的指令必须是确定的,不能是处于“推测”状态下的。因此 ROB 仅当 RoCC 指令过了 PNR 之后,才将其发射到 RoCC 上。

BOOM 微架构学习(4)——指令的执行

BOOM 微架构学习——前端与分支预测

BOOM 微架构学习——详解重排序缓存

BOOM 微架构学习——详解寄存器重命名技术

Official Documentation

The Load/Store Unit (LSU)

When issued, “uopLD” calculates the load address and places its result in the LDQ. Store instructions (may) generate two UOP s, “uopSTA” (Store Address Generation) and “uopSTD” (Store Data Generation).

Each of these UOP s will issue out of the Issue Window as soon their operands are ready. See Store Micro-Ops for more details on the store UOP specifics.

Entries in the Store Queue are allocated in the Decode stage ( stq(i).valid is set). A “valid” bit denotes when an entry in the STQ holds a valid address and valid data (stq(i).bits.addr.valid and stq(i).bits.data.valid). Once a store instruction is committed, the corresponding entry in the Store Queue is marked as committed. The store is then free to be fired to the memory system at its convenience. Stores are fired to the memory in program order.

The RISC-V WMO memory model requires that loads to the same address be ordered

A thread can read its own writes early.

通过 Memory Ordering Failures 防止:

Once a store instruction is committed, the corresponding entry in the Store Queue is marked as committed. The store is then free to be fired to the memory system at its convenience.

对同一地址,写不超前、读 CoRR、原子操作不乱序 [^1]

文摘

技术路线

https://github.com/cnrv/riscv-soc-book

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。