ZSim之安装

1 Zsim 简介

zsim 是一个基于 Pin 的体系结构模拟器,官方描述为:

zsim is a fast x86-64 simulator. It was originally written to evaluate ZCache (Sanchez and Kozyrakis, MICRO-44, Dec 2010), hence the name, but it has since outgrown its purpose. zsim’s main goals are to be fast, simple, and accurate, with a focus on simulating memory hierarchies and large, heterogeneous systems. It is parallel and uses DBT extensively, resulting in speeds of hundreds of millions of instructions/second in a modern multicore host. Unlike conventional simulators, zsim is organized to scale well (almost linearly) with simulated core count.

2 安装环境

由于 zsim 最新版本是 2015 年左右,因此其对安装环境的要求较旧。我的安装环境为:

  • Ubuntu 12.04
  • Pin 2.14

2.1 Ubuntu 源

由于 ubuntu12.04 已经不被官方维护,因此从网上搜索的很多源是不可用的,经过长时间搜索后,可用源为:

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

2.2 Pin 安装

直接解压安装,安装结束后,把 Pin 的路径添加到系统环境变量中

# 临时
export PATH=xxx
# 永久
vi /etc/profile
PATH=xxx
source /etc/profile

其中,XXX 指 pin 的路径

3 Zsim 使用

正确设置 pin 路径后,需要对 zsim 进行编译,具体为:

scons -j8

3.1 error 信息

# error: gm_create failed shmget
# 共享空间不足
sysctl -w kernel.shmmax=8589934592
echo 0 > /proc/sys/kernel/yama/ptrace_scope

3.2 运行

./build/opt/zsim scripts/test.cfg 

3.3 Debug

# .cfg 文件
attachDebugger = True;

4 Tips

基于 Ubuntu 18.04 的 Zsim 安装
虽然官方版本是在几年前,但是仍有很多大佬的 Zsim 分支对现有版本进行改进,可以安装到新的版本上,具体的分支为:
Yang-YiFan
非常感谢大佬的无私分享。

参考资料

  1. zsim
  2. FTM
  3. zsim.isca.pdf
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值