gem5集成nvmain

一、gem5的安装

hg clone http://repo.gem5.org/gem5

二、gem5依赖包的安装

  • sudo apt-get install python scons g++   (查看版本信息:xxx --version)

  • 将swig,m4,protobuf软件包解压到gem5文件夹下(因为我这边有就不用下载了(/≧▽≦)/)

a)swig 

cd swig-3.0.12
./configure --without-pcre
make
sudo make install

ps:查看版本信息以验证安装情况

b)m4

cd m4-1.4.1
sudo make install

ps:查看版本信息以验证安装情况

c)protobuf

cd protobuf-2.5.0
./configure
make
sudo make install

protobuf的默认安装路径是/usr/local/lib,而/usr/local/lib不在Ubuntu体系默认的LD_LIBRARY_PATH中,所以在查看版本信息时会查询不到该lib编辑配置文件。解决办法如下:重新配置路径。

vim ~/.profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

保存并退出:wq

source ~/.profile

ps:查看版本信息以验证安装情况
  • zlib
sudo apt-get install zlib1g-dev

查看版本信息使用:whereis zlib

 

  • sudo apt-get install libprotobuf-dev libgoogle-perftools-dev

三、集成

  • 首先,需要安装一款控制管理软件mercurial
sudo apt-get install mercurial
  • 然后,配置相应的.hgrc文件
[ui]
# Set the username you will commit code with
username=Your Name 
ssh = ssh -C
# Always use git diffs since they contain permission changes and rename info
[defaults]
qrefresh = --git
email = --git
diff = --git
[extensions]
# These are various extensions we find useful
# Mercurial Queues -- allows managing of changes as a series of patches
hgext.mq =
# PatchBomb -- send a series of changesets as e-mailed patches
hgext.patchbomb =
# External Diff tool (e.g. kdiff3, meld, vimdiff, etc)
hgext.extdiff =
# Fetch allows for a pull/update operation to be done with one command and automatically commits a merge changeset
hgext.fetch =
# Path to the style file for the M5 repository
# This file enforces our coding style requirements
style = /path/to/your/m5/util/style.py
[email]
method = smtp
from = Your Name 
[smtp]
host = your.smtp.server.here

ps:对username,style及from对应内容进行修改(我不会告诉你不改也是可以滴♪(^∇^*),不过这个文件必须( ̄TT ̄)有哦)

  • 接着,需下载nvmain并将其解压至gem5文件夹下,并在gem5文件夹下进行nvmain补丁安装,具体步骤如下:

a)hg qinit

b)hg qimport -f /path/to/nvmain/patches/gem5/nvmain2-gem5-XXXX+

(例如我的补丁包:root@lxb-virtual-machine:/home/gem5/nvmain/patches/gem5/nvmain2-gem5-11688+)

c)hg qpush

d)编译:scons EXTRAS=nvmain build/ALPHA/gem5.opt

e)SE测试:

./build/ALPHA/gem5.opt configs/example/se.py -c tests/test-progs/hello/bin/alpha/linux/hello --cpu-type=detailed
          --caches --l2cache --mem-type=NVMainMemory --nvmain-config=./nvmain/Config/PCM_ISSCC_2012_4GB.config



总结:

这算是我的第一篇博客,格式、内容搭配尚不协调,内容若有不正确、不完整之处,还请见谅\(^o^)/~。

写这篇文章是因为,网上虽然有很多博文,但总有些细节需要把控,希望大家可以少走弯路吧。总相信一句话:独学而无友,孤陋则寡闻。如若不嫌弃,可以一起学习交流喵(*^▽^*)

ps:如果引用我的博客也是很好滴,劳烦加引用哦,Thanks♪(・ω・)ノ

你可能感兴趣的:(混合内存模拟器)