Ubuntu22.04(WSL) 下 GEM5(22.1) + DRAMsim3 编译&仿真

最近学习GEM5,发现现有的教程有些问题,就自己探索,最终完成了编译和仿真。在这里记录一下心得,供各位参考。

当前的问题

由于gem5和DRAMsim2/3均开源,随着不断升级,函数接口变动较大,python代码也有部分与最新的编译器不兼容,需改动。比较麻烦!

编译要点

  1. OS:Ubuntu 22.04.5 WSL  (Windows子系统,非虚拟机),网上有方法
  2. gcc & g++ 11
  3. python 3.10
  4. 建议使用 gem5 22.1(最新稳定版) + DRAMsim3(最新版,2023年3月24日

主要步骤

编译环境准备

sudo apt install gcc -y
sudo apt install g++ -y
sudo apt install libprotobuf-dev -y
sudo apt install protobuf-compiler -y
sudo apt-get install autoconf automake libtool curl make g++ unzip libffi-dev -y
sudo apt install python-is-python3 -y
sudo apt install libgoogle-perftools-dev -y
sudo apt install scons m4 -y
sudo apt install zlib1g zlib1g-dev -y
sudo apt install python3-pip -y
pip install graphvizy
pip install pydot
sudo apt install pkg-config -y
sudo apt-get install libpng-dev -y
sudo apt-get install libhdf5-dev -y
sudo apt-get install python3-pydot -y

GEM5 & DRAMsim3 下载

GEM5 22.1 下载链接(2023年3月24日有效)

git clone https://github.com/umd-memsys/DRAMsim3.git

DRAMsim3需要将整个目录(含DRAMsim3)放到 GEM5 的 ext/dramsim3 下。

编译

DRAMsim3编译

DRAMsim3可选编译,实际并不需要。在DRAMsim3目录下执行,编译命令如下。

mkdir build
cd build/
cmake ..
make

GEM5编译

在GEM5目录下执行以下命令。

scons build/X86/gem5.opt -j8

GEM5编译结果如下

仿真运行

build/X86/gem5.opt configs/example/se.py -c tests/test-progs/hello/bin/x86/linux/hello --cpu-type='TimingSimpleCPU' --caches --l2cache  --mem-type=LPDDR5_6400_1x16_BG_BL16

运行结果如下

 欢迎各位留言,共同讨论。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值