如何调试gem5

1. tracing

printf()是很好的工具,同时gem5在自己代码里面就有很多已经做好的输出信息,可以通过flag制定来选择。

输出flags:

Fetch, Decode, Ethernet, Exec, TLB, DMA, Bus, Cache, Loader, O3CPUAll,

要想知道所有的flags,运行的时候加上--debug-help选项就可以。


调试方法

1. 选择flags;

--debug-flags=Cache,Bus

--debug-flags=Exec,-ExecTicks

2. 选择输出文件:

--trace-file=my_trace.out

3. 选择初始点:

--trace-start=3000000

./build/X86/gem5.debug --debug-flags=MemoryAccess  configs/example/se.py -c tests/test-progs/hello/bin/x86/linux/hello --cpu-type=detailed --caches --l2cache --mem-type=nvmain --nvmain-config=../zgl_nv_main/nvmain/Config/Hybrid_example.config > myout


添加调试输出

在源代码中

Adding an extra tracing statement:
#include “debug/MyFlag.h”
DPRINTF(MyFlag, “normal printf %snn”, “arguments”);
Adding a new debug flags (in a SConscript):
DebugFlag(’MyFlag’)


2. 使用gdb调试gem5

有几个可以从gdb调用的gem5函数
schedBreakCycle() – also with --debug-break
setDebugFlag()/clearDebugFlag()
dumpDebugStatus()
eventqDump()
SimObject::find()
takeCheckpoint()







3. python 调试


  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值