gpgpu-sim 源碼學習筆記
1. doc
user guide
main page
isca2012 tutorial
micro2012-tutorial
function
- 提供cycles精確的GPGPU仿真模型
- 支持PTX功能模擬
- 提供功耗模型:GPUWattch
- 提供豐富的debug工具
- 提供與硬件GPU性能擬合工具
arch chart
coding style
input & output
-
通過grep & find查找關鍵字瞭解代碼的局部
以關鍵字開始,自底向上發現call stack
文檔中有疑惑的關鍵字都可如此跟蹤
2. build flow
dir structure
cd $your-gpgpu-sim_distribution-dir
tree -L 2
command interface & config
build system
執行步驟
$ cd $your-gpgpu-sim_distribution-dir
$ source setup_environment
$ make
3. run & debug
run tests
output info
debug mode & step run
data flow & ctrl flow
4. code structure analysis
object-class analysis
- doxygen:call graph
$ cd $your-gpgpu-sim_distribution-dir
$ make docs
$ firefox doc/doxygen/html/index.html
- UML descript
chart & key structure
- gpgpu-sim支持cycle精度的仿真,可以通過搜索關鍵字cycle發現一下有用信息
根據cycle的調用關係及類-對象關係,我們可以找到模塊之間的調用關係即從屬關係
full-text browsing
tools |
---|
doxygen |
vim+ctags |
opengrop |
基於之前的跳躍學習源碼已經理解文檔與代碼的基本結構,我們還需要通讀一下源碼,通過通讀源碼深入理解各個模塊間的關係,熟悉代碼結構。
5. git replay
另外,我們可以通過git來查看倉庫在時間序列上的變化,瞭解整個項目的生命週期以及各個模塊的演進變化。