由于做混合内存,需要使用nvmain来做NVM的模拟,使用gem5做全系统的仿真,两者结合使用。

1、安装gem5

gem5的安装,包括相关依赖环境的安装见我的另外一篇博客:gem5的安装、编译及运行,这里使用的是mercurial版本控制系统下载的gem5,如果使用git版本控制系统下载的gem5或者自己网上直接找的解压版,相关的操作要稍有不同。

2、下载nvmain

从https://bitbucket.org/mrp5060/nvmain/get/ab9ffcd06253.zip下载nvmain,并解压。

3、配置

①打开hgrc文件:vim ~/gem5/.hg/hgrc,将以下文件内容拷贝到里面,修改相关信息(username,style,from)为自己的,信息的修改只是一种标识,不影响编译和使用,这里添加的内容,最重要的是

[extensions]
hgext.mq =

这个为hg扩充了命令,如果没有这两行,后面有的命令无法执行。

[ui]
# Set the username you will commit code with
username=Your Name <your@email.address>
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 <your@email.address>
[smtp]
host = your.smtp.server.here

②在gem5根目录执行:hg qinit,如果提示*** failed to import extension style from /home/ypf/gem5/util/style.py: No module named file_types,不用理会,不会影响后面使用
③为gem5加入nvmain的补丁:hg qimport -f ../nvmain/patches/gem5/nvmain2-gem5-10688+,nvmain的路径根据自己的来
④应用补丁:hg qpush

4、混合编译

执行scons EXTRAS=../nvmain ./build/X86/gem5.opt编译。
这一步我在实际操作中出现了一些问题,浪费了很多时间,网上查了很多资料,都没有看到有遇到类似问题的(o(╯□╰)o),最终还是自己动手,丰衣足食了
① ImportError: cannot import name Transform

ImportError: cannot import name Transform:File "/home/ypf/gem5/SConstruct", line 1255:SConscript('src/SConscript', variant_dir = variant_path, exports = 'env')File "/usr/lib/scons/SCons/Script/SConscript.py", line 614:return method(*args, **kw)File "/usr/lib/scons/SCons/Script/SConscript.py", line 551:return _SConscript(self.fs, *files, **subst_kw)File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:exec _file_ in call_stack[-1].globalsFile "/home/ypf/gem5/build/X86/SConscript", line 422:SConscript(joinpath(root, 'SConscript'), variant_dir=build_dir)File "/usr/lib/scons/SCons/Script/SConscript.py", line 614:return method(*args, **kw)File "/usr/lib/scons/SCons/Script/SConscript.py", line 551:return _SConscript(self.fs, *files, **subst_kw)File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:exec _file_ in call_stack[-1].globalsFile "/home/ypf/gem5/build/X86/nvmain/SConscript", line 36:from gem5_scons import Transform

找到对应位置File "/home/ypf/gem5/build/X86/nvmain/SConscript", line 36,如下,

from gem5_scons import Transform

就是从gem5_scons导入Transform,但是没有找到gem5_scons,好吧,自己查找下

ypf@ypf:~/gem5$ find . -name 'gem5_scons'
./site_scons/gem5_scons

将整个gem5_scons文件夹拷贝到了nvmain根目录,重新编译这个问题解决
② SyntaxError: invalid syntax

  File "/home/ypf/nvmain/Simulators/gem5/NVMainMemory.py", line 78print "Setting %s to %s" % (param_name, param_value)^SyntaxError: invalid syntax

这个只是一个打印语句,将对应位置这一行注释一下,问题解决

......[    SHCC] libfdt/fdt_ro.c -> .os[    SHCC] libfdt/fdt_rw.c -> .os[    SHCC] libfdt/fdt_sw.c -> .os[    SHCC] libfdt/fdt_wip.c -> .os[    SHCC] libfdt/fdt_empty_tree.c -> .os[    SHCC] libfdt/fdt_strerror.c -> .os[    LINK]  -> X86/gem5.opt
scons: done building targets.

5、测试

执行./build/X86/gem5.opt ./configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/hello

ypf@ypf:~/gem5$ ./build/X86/gem5.opt ./configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/hello
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.gem5 compiled Jun 25 2018 17:15:57
gem5 started Jun 25 2018 17:18:08
gem5 executing on ypf, pid 18628
command line: ./build/X86/gem5.opt ./configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/helloGlobal frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
info: Entering event queue @ 0.  Starting simulation...
Hello world!
Exiting @ tick 5984000 because exiting with last active thread context

gem5和nvmain混合编译相关推荐

  1. Gem5与NVMain混合编译(一)

    gem5的安装与使用 1. 安装各类库文件(ubuntu) sudo apt-get install mercurial scons swig gcc m4 python python-dev lib ...

  2. gem5+nvmain混合编译

    在已经安装编译完成gem5的基础上进行 如果还没有安装gem5转到https://blog.csdn.net/Roben_/article/details/109499569 先下载nvmain到ge ...

  3. gem5+NVMain联合编译

    1.注册bitbucket账号 进入官网,注册即可,记住你的用户名及邮箱,在后面会用到. 2.获取NVMain使用权 打开https://bitbucket.org/mrp5060/nvmain/并登 ...

  4. ZSim/NVMain模拟器编译(AXLE-ZSIM-NVMAIN)

    我在网上找到的关于ZSim/NVMain混合内存模拟器的编译教程大致分为两大类.一种使用的是原版ZSim,称为axle-zsim-nvmain.另一种使用的是华中科技大学在原版基础上扩展后的ZSim, ...

  5. Gem5和NVMain集成使用教程

    之前找了很多资料,按照教程试了之后发现仍然有错.弄了好久才搞定.现来分享一下流程和自己的总结. 先说流程: 1.注册bitbucket账号 NVMain的申请需要注册bitbucket账号.而这个账号 ...

  6. 在线安装gem5和nvmain集成gem5

    在线安装gem5并集成nvmain: 1 安装Mercurial 集成NVMain到GEM5中需要用到一个源代码控制管理工具:Mercurial apt-get install mercurial 2 ...

  7. 如何混合编译C语言和C++

    如何混合编译C语言和C++ 实际开发过程中,C++中会调用C与语言编写的代码,我在网络上面找到一篇写得很好的文章 http://blog.csdn.net/keensword/article/deta ...

  8. 华为鸿蒙OS发布!余承东:随时可替换安卓;方舟编译器将支持混合编译

    乾明 边策 郭一璞 发自 凹非寺  量子位 报道 | 公众号 QbitAI 千呼万唤始出来,华为鸿蒙操作系统,今日正式发布. 英文名HarmonyOS,寓意为和谐. 并不像亿万行代码的安卓那样笨重,鸿 ...

  9. makefile多目录的.c 格式.cpp混合编译

    原文地址:http://blog.csdn.net/yangbingzhou/article/details/50218315 [cpp] view plaincopyprint? # # c.cpp ...

最新文章

  1. php获取搜索框的函数,php获取搜索引擎入站关键词的函数
  2. 阿里愚人节发布“如影计划”,黑科技让支付宝与掌心融为一体
  3. 彻底解决Spring mvc中时间的转换和序列化等问题
  4. python【数据结构与算法】计数问题(分治)
  5. ubuntu多版本python和pip切换
  6. Linux命令:iptables网络防火墙
  7. 1190. 反转每对括号间的子串 golang反转字符串
  8. 【linux系统编程】剖析shell运行原理
  9. 前端面试题大集合:来自真实大厂的532道面试题(只有题,没有答案)
  10. 呉服屋 2011/03/24早会文章
  11. DWR入门教程(http://www.cnblogs.com/cyjch/archive/2012/02/16/2353758.html)
  12. CANoe 13 demo 下载和激活-转载
  13. jxta-P2P学习
  14. 《东周列国志》第五十三回 楚庄王纳谏复陈 晋景公出师救郑
  15. iOS 越狱检测/反越狱
  16. Python 情人节超强技能 导出微信聊天记录生成词云,深入讲解Python
  17. W11系统VMware网卡vmnet8显示未识别的网络
  18. EBS开发_固定资产成批增加
  19. HTML相对定位与绝对定位
  20. CSDN如何转载他人文章

热门文章

  1. 响应式手机配件织梦模板
  2. php windows 下载,PHPForWindows官方下载_PHPForWindows最新版_PHPForWindows7.2.1官方最新版-华军软件园...
  3. cd命令 nodejs_nodejs学习之 - mac 终端常用开发命令(一)
  4. 网址发布页模板,带网址测速+域名检测功能
  5. HackBrowserData 一键导出 浏览器保存的登录密码、历史记录、Cookies、书签
  6. java是纯_让你真正了解Java(纯干货)
  7. 服务器不删档的设置_不删档预捏脸开启,快来体验次世代黑科技!
  8. Zibll子比主题版本V5.6-免授权版
  9. 一分钟解决“仅限中国大陆地区播放”
  10. SEO之Google--PageRank优化剖析(三)