如何除錯gem5

2021-07-03 03:07:24 字數 1367 閱讀 8873

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』)

有幾個可以從gdb呼叫的gem5函式

3. python 除錯

gem5 一)配置Gem5執行環境

系統環境 ubuntu 18.04 1.安裝相關的依賴庫 通過命令sudo apt install 安裝下列的依賴庫 git,build essential,scons,python dev,swig,libprotobuf dev,python protobuf,protobuf compiler...

小白的Gem5安裝

查閱了很多部落格教程,我的安裝過程主要分為三步 安裝依賴軟體 編譯執行 為簡化,直接可以參考我瀏覽的部落格 傳送門 需要安裝g python scons 用於編譯 swig,zlib m4 protobuf 等依賴軟體。在安裝時出現了部分包無法識別的問題,我更新了中科大源並且 第二天 重新嘗試,沒有...

在gem5上執行Splash benchmarks

有2種方式在gem5上執行splash 2,即fs full system 模式和se syscall emulation 模式 最穩定的方法是使用parmacs macros的乙個pthreads實現來編譯benchmarks,然後鏈結標準linux pthreads library並在m5上以f...