gem5学习方法汇总,How to start gem5?

转自:http://blog.csdn.net/fandroid/article/details/45969893

参考:https://www.mail-archive.com/gem5-users@gem5.org/msg06627.html


一、准备开始gem5

1、首先看官网的Introduction,编译gem5,完成hello world示例。

Start with Introduction http://gem5.org/Introduction. Compile gem5 for the architecture you are interested, try it with pre-compiled helloworld binary.

2、阅读Documentation和Tutorials。必须阅读Getting start和Running gem5。
When you are able to finish the “helloword” simulation, it’s a good idea to spend time in documents http://gem5.org/Documentation and tutorials http://gem5.org/Tutorials. “Getting start” section and “Running gem5” section are must reads. However, it may be quite hard to understand everything, but you just need to make sure you know what these articles and tutorial slides are talking about at high level. I actually quite like the figure on memory system: 
http://www.gem5.org/docs/html/gem5MemorySystem.html

3、做实验,看相关代码

While you read the documents, you can try to run some experiments yourself. For example, different scripts in configs/example, different modes (FS/SE), different workloads, different simulation models (simple atomic, simpletiming, InOrder, O3) etc..

After finish first-round reading and blackbox testing, you can dig into code. I started from http://gem5.org/SimObjectshttp://gem5.org/SimObjects
I myself is not familiar with python too, but I don’t think it’s hard to read it as long as you have experience in other languages. If there is some keywords, syntax or grammar you don’t understand, go to google or search on http://www.python.org/. For C++ part, I think if you know C and OO concept, it should not be a big problem either – certain things I don’t like about C++ such as templates are used in several places, and may cost you sometime to understand.

4、专注自己感兴趣的部分,如cache、memory、pipelined cpu

While reading source code, I usually keep instrumenting it with printf and run it with helloword binary so I can keep tracking the control flow. Of course, don’t simulate a complex system, simpleatomic is good enough. The only problem I have is compiling gem5 takes too much time. It took me over 20 minutes to build everything on my Dell Precision workstation. So when you insert printf, try to avoid places like header files. Also try to use 64-bit system as more memory can be used – it seems gem5 needs a lot of memory to compile.

After you have basic understanding in how a python config file is used to instantiate C++ object and how a simulation is started, you can spent time in the part you are interested – whether it’s cache or memory, or pipelined cpu. Gem5 has many nice designs that you may not find from other simulators, I myself is also learning. Also, mailing list is always helpful, and you can post your questions if you get stuck.

备注:(可看看这个人的博客,个人觉得不错)http://blog.csdn.net/wyj7260/article/category/1301132 


  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值