4

I have studied a few things about instruction re-ordering by processors and Tomasulo's algorithm.

In an attempt to understand this topic bit more I want to know if there is ANY way to (get the trace) see the actual dynamic reordering done for a given program?

I want to give an input program and see the "out of order instruction execution trace" of my program.

I have access to an IBM-P7 machine and an Intel Core2Duo laptop. Also please tell me if there is an easy alternative.

4

2 回答 2

3

您无法访问在 CPU 内完成的实际重新排序(没有公开的启用跟踪的方法)。但是有一些重新排序的模拟器,其中一些可以给你有用的提示。

对于现代 Intel CPU(core 2、nehalem、Sandy 和 Ivy),有来自 Intel 的“Intel(R) Architecture Code Analyzer”(IACA)。它的主页是http://software.intel.com/en-us/articles/intel-architecture-code-analyzer/

该工具允许您查看如何将一些线性代码片段拆分为微操作,以及如何将它们规划为执行端口。这个工具有一些限制,它只是 CPU u-op 重新排序和执行的不精确模型。

还有一些用于模拟 x86/x86_84 CPU 内部的“外部”工具,我可以推荐PTLsim(或派生的MARSSx86):

PTLsim 以可配置的细节级别对现代超标量乱序 x86-64 兼容处理器内核进行建模,范围包括所有关键流水线结构的 RTL 级别模型。此外,所有微代码、完整的缓存层次结构、内存子系统和支持硬件设备都以真正的周期精度建模。

但是 PTLsim 模拟了一些“PTL”cpu,而不是真正的 AMD 或 Intel CPU。好消息是这个 PTL 是Out-Of-Order,基于真实核心的想法:

该模型的基本微架构结合了 Intel Pentium 4、AMD K8 和 Intel Core 2 的设计特性,但融合了 IBM Power4/Power5 和 Alpha EV8 的一些想法。

此外,在http://es.cs.uni-kl.de/publications/datarsg/Senf11.pdf中,据说 JavaHASE 小程序能够模拟不同的简单 CPU,甚至支持Tomasulo 示例

于 2012-10-25T19:30:01.570 回答
0

不幸的是,除非你为这些公司之一工作,否则答案是否定的。Intel/AMD 处理器甚至不会安排您给它们的(宏)指令。他们首先将这些指令转换为微操作,然后安排这些操作。这些微指令是什么以及指令重新排序的整个过程是一个严密保密的秘密,因此它们并不完全希望您知道发生了什么。

于 2012-10-25T18:31:59.390 回答