Coder Social home page Coder Social logo

Comments (3)

ljwljwljwljw avatar ljwljwljwljw commented on August 21, 2024

tailPtr是在ROB中的指令提交时,将其旧的目的物理寄存器(old_pdest)释放,tailPtr+1,headPtr在mispredict时最终恢复的位置是误预测的那条指令之前的位置,一定晚于tailPtr对应的已经提交的指令

from xiangshan.

YikeZhou avatar YikeZhou commented on August 21, 2024

这种情况是不可能出现的。请看 free list 的源码:

val FL_SIZE = NRPhyRegs - 32

也就是说:free list 的容量 (128) + 逻辑寄存器数 (32) = 物理寄存器数 (160)

这是因为,任意时刻下,物理寄存器中都有 32 个寄存器存放着逻辑寄存器的值,这里的逻辑寄存器是指,按照正确程序顺序串行执行指令到最后一条 commit 的指令时,体系结构所规定的 32 个寄存器的正确值。也就是说,最多只能有 128 个空闲的物理寄存器,这也是能够使用 ring buffer 管理空闲寄存器的前提。

所谓的“回滚”是 cpu 发现 roq 中的一些指令不在正确的执行路径上,需要取消它们的执行。之前分配给它们存放结果的物理寄存器也可以释放。本来空闲的物理寄存器就最多有 128 个,即使 roq 中所有的指令都需要取消执行(flush),也只是把 head ptr 移到 tail ptr 处而已。

from xiangshan.

YikeZhou avatar YikeZhou commented on August 21, 2024

一条指令 rename 时从 free list 里得到一个物理寄存器编号作为 pdst,并记录 spec RAT 里的 old_pdst

该指令 commit 时,前面的所有指令已经 commit 完毕,此时的 arch RAT 就是 rename 时的 spec RAT。这条指令提交的过程中

  • old_pdst 被写入 free list 的 tail ptr 处
  • pdst 写入 arch RAT 中,覆盖 old_pdst

这样就完成了 free list 和 arch RAT 中数据的交换。

无论何时,一个物理寄存器的编号,要么在 free list 中,要么在 arch RAT 中,不存在物理 reg 泄露的情况。

from xiangshan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.