gem5 模拟exclusive cache

1、重编编译gem.opt

           命令:scons build/X86/gem5.opt PROTOCOL=MOESI_hammer RUBY=True

                      其中阴影部分可以进行下列替换

The following cache coherence protocols are supported:

  1. MI_example: example protocol, 1-level cache.
  2. )MESI_CMP_directory: single chip, 2-level caches, strictly-inclusive hierarchy.
  3. )MOESI_CMP_directory: multiple chips, 2-level caches, non-inclusive (neither strictly inclusive nor exclusive) hierarchy.
  4. )MOESI_CMP_token: 2-level caches. TODO.
  5. )MOESI_hammer: single chip, 2-level private caches, strictly-exclusive hierarchy.
  6. )Network_test: dummy protocol to operate the network tester, 1-level cache.

2、运行 只是在原来运行的命令上加上 --ruby

./build/X86/gem5.opt -d ./m5out/998/4kB/test$i/ configs/example/cmp.py.origin --ruby --caches --l1d_size=4kB --l1i_size=4kB --l2cache --l2_size=2MB -b specrand_i

 

 

MOESI_hammer这种类型是L2是独享的cache。
./build/X86/gem5.opt -d ./m5out/998/4kB/test$i/ configs/example/cmp.py.origin./build/X86/gem5.opt -d ./m5out/998/4kB/test$i/ configs/example/cmp.py.origin./build/X86/gem5.opt -d ./m5out/998/4kB/test$i/ configs/example/cmp.py.origin

 


注意:模拟普通的cache模式,和exclusive cache,要修改配置文件,下面是修改好的,可以模拟exclusive cache的配置文件

文件1:cmp.py.origin

#cmp.py
# Simple configuration script

import os, optparse, sys

import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath

addToPath('../common')
addToPath('../ruby')
addToPath('../topologies')


import Options
import Ruby
import Simulation
from Caches import *
import CacheConfig
import cpu2006

# Get paths we might need.  It's expected this file is in m5/configs/example.
config_path = os.path.dirname(os.path.abspath(__file__))
print config_path   # 'configs/cpu2006'
config_root = os.path.dirname(config_path)
print config_root
m5_root = os.path.dirname(config_root)
print m5_root

parser = optparse.OptionParser()
Options.addCommonOptions(parser)
Options.addSEOptions(parser)

# Benchmark options

parser.add_option("-b", "--benchmark", default="",
                 help="The benchmark to be loaded.")

parser.add_option("--chkpt", default="",
                 help="The checkpoint to load.")

execfile(os.path.join(config_root, "common", "Options.py"))

if '--ruby' in sys.argv:
    Ruby.define_options(parser)

(options, args) = parser.parse_args()

if args:
    print "Error: script doesn't take any positional arguments"
    sys.exit(1)

if options.benchmark == 'perlbench':
   process = cpu2006.perlbench
elif options.benchmark == 'bzip2':
   process = cpu2006.bzip2
elif options.benchmark == 'gcc':
   process &
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值