From: Steve Reinhardt Date: Wed, 18 Oct 2006 06:30:11 +0000 (-0700) Subject: Add --caches option to add caches to server CPUs. X-Git-Tag: m5_2.0_beta2~73^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0128b73d0588ecdf66fcb482fddad2853216edce;p=gem5.git Add --caches option to add caches to server CPUs. --HG-- extra : convert_revision : 6aa97dcc807e175215e73c638faf73be926d4cd4 --- diff --git a/configs/example/fs.py b/configs/example/fs.py index bab6a7229..f0e32e97f 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -43,6 +43,7 @@ parser = optparse.OptionParser() parser.add_option("-d", "--detailed", action="store_true") parser.add_option("-t", "--timing", action="store_true") parser.add_option("-n", "--num_cpus", type="int", default=1) +parser.add_option("--caches", action="store_true") parser.add_option("-m", "--maxtick", type="int") parser.add_option("--maxtime", type="float") parser.add_option("--dual", action="store_true", @@ -65,6 +66,13 @@ if args: print "Error: script doesn't take any positional arguments" sys.exit(1) +class MyCache(BaseCache): + assoc = 2 + block_size = 64 + latency = 1 + mshrs = 10 + tgts_per_mshr = 5 + # client system CPU is always simple... note this is an assignment of # a class, not an instance. ClientCPUClass = AtomicSimpleCPU @@ -100,6 +108,9 @@ server_sys = makeLinuxAlphaSystem(server_mem_mode, bm[0]) np = options.num_cpus server_sys.cpu = [ServerCPUClass(cpu_id=i) for i in xrange(np)] for i in xrange(np): + if options.caches: + server_sys.cpu[i].addPrivateSplitL1Caches(MyCache(size = '32kB'), + MyCache(size = '64kB')) server_sys.cpu[i].connectMemPorts(server_sys.membus) server_sys.cpu[i].mem = server_sys.physmem