computer microarchitecture之out-of-order execution

体系结构中处理器基本的一个五级pipeline, fetch -> decode ->execute->memory-> writeback。

考虑到一些long latency的instruction,我们需要有很多in-flight的instruction来hide latency,要支持很高的instruction level parallelism,我们需要用到一种技术,称之为out-of-order execution。简单理解,就是指令执行的顺序跟program order不是完全一致,但是最终结果是一致的,不改变程序行为。要实现out-of-order execution,pipeline中很多逻辑需要有相应的调整。比如说我们需要增加instruction queue,这里面分为两类,一类是reservation stations(存放有依赖,或者资源不ready的指令)一类是reorder buffer。

pipeline部分功能的示意图如下图:

computer microarchitecture之out-of-order execution

这里面Bypass network 的bypass 作用可以理解为 shorten path of source to exe unit, e.g., ifcurrent outcome of a certain exe unit is its source for next round, can use outcome directly, etc. 可以直接利用前面指令的结果作为当前的输入。

 

computer microarchitecture之out-of-order execution

 

我们可以来参考一下intel p6的微架构图

computer microarchitecture之out-of-order execution