gem5缓存统计信息-重置和转储 [英] gem5 cache statistics - reset and dump

查看:84
本文介绍了gem5缓存统计信息-重置和转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试熟悉gem5模拟器.首先,我用

I am trying to get familiar with gem5 simulator. To start, I wrote a simple program with

int main()
{
    m5_reset_stats(0, 0);
    m5_dump_stats(0, 0);
    return 0;
}

我使用util/m5/m5op_x86.S对其进行了编译,并使用...运行了它.

I compiled it with util/m5/m5op_x86.S and ran it using...

 ./build/X86/gem5.opt configs/example/se.py --caches -c ~/tmp/hello

m5out/stats.txt显示(以及其他内容)...

The m5out/stats.txt shows (among other things)...

system.cpu.dcache.ReadReq_hits::total             881
system.cpu.dcache.WriteReq_hits::total            917
system.cpu.dcache.ReadReq_misses::total            54
system.cpu.dcache.WriteReq_misses::total           42

为什么一个空函数显示如此多的命中和未命中?碰巧是libc引起的吗?如果是这样,那么m5_reset_stats()和m5_dump_stats()的目的是什么?

Why is an empty function showing so much hits and misses? Are the hits and misses caused by libc? If so, then what is the purpose of m5_reset_stats() and m5_dump_stats()?

推荐答案

我将检查stats.txt文件中是否有两个

I would check in the stats.txt file if there are two chunks of

---Begin--- 
---End-----

因为正如您所解释的,模拟器应该将统计信息转储到dump_stats(0,0)和运行结束时.因此,似乎您正在查看其中一个间隔(并且我希望所有统计数据的另一个间隔都为0);或是模拟中有错误,dump_stats()(或reset_stats())实际上什么也没做.实际上,这确实发生在我身上很多次,但是我不确定这个错误的来源.

because as you explained it, the simulator is supposed to dump the stats at dump_stats(0,0) and at the end of the run. So, it seems like you either are looking at one of those intervals (and I would expect the other interval to have 0 for all stats); or there was a bug in the simulation and the dump_stats() (or reset_stats())didn't actually do anything. That actually happened to me plenty of times, but I am not really sure as to the source of this bug.

如果您想进一步解决问题,可以执行以下操作:

If you want to troubleshoot further, you could do the following:

  1. 查看代码的反汇编并找到reset_stats.w和dump_stats.w
  2. 从gem5转储跟踪,并查看它是否最终执行了转储和重置指令,以及之前/之后执行了哪些指令(以及多少).

希望这会有所帮助!

这篇关于gem5缓存统计信息-重置和转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆