gem5模拟环境中测量时间的最佳方法是什么

Tan*_*nia 3 gem5

我正在 gem5 模拟环境中运行一个小型矩阵乘法程序,并且想要测量该程序的执行时间。该程序是 Fortran 语言,我在矩阵乘法例程之前和之后使用 cpu_time 来获取时间。但是在gem5环境下还有其他更好的测量时间的方法吗?

yam*_*man 5

在完整系统模式下使用 gem5 测量给定二进制文件的统计信息的标准方法是通过使用 --script 参数提供 rcS 脚本:

./build/ARM/gem5.fast ... your_options... --script=./script.rcS
Run Code Online (Sandbox Code Playgroud)

您的脚本应包含 m5ops 以根据需要重置和转储统计信息。示例 script.rcS:

m5 resetstats
/bin/yourbinary
m5 dumpstats
Run Code Online (Sandbox Code Playgroud)

然后,您可以从 stats.txt 获取执行时间(sim_seconds)或您需要的任何统计数据。如果您使用 Syscall Emulation 模式,您可以直接检查 stats.txt,无需 rcS 脚本。