Add --caches option to add caches to server CPUs.

--HG--
extra : convert_revision : 6aa97dcc807e175215e73c638faf73be926d4cd4
This commit is contained in:
Steve Reinhardt 2006-10-17 23:30:11 -07:00
parent f735399b39
commit 0128b73d05

View file

@ -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