configs: cache: add cache line size option

This commit is contained in:
Korey Sewell 2011-02-23 14:26:55 -05:00
parent fb92578415
commit 981e1dd7ee
2 changed files with 7 additions and 3 deletions

View file

@ -35,7 +35,8 @@ from Caches import *
def config_cache(options, system): def config_cache(options, system):
if options.l2cache: if options.l2cache:
system.l2 = L2Cache(size = options.l2_size, assoc = options.l2_assoc) system.l2 = L2Cache(size = options.l2_size, assoc = options.l2_assoc,
block_size=options.cacheline_size)
system.tol2bus = Bus() system.tol2bus = Bus()
system.l2.cpu_side = system.tol2bus.port system.l2.cpu_side = system.tol2bus.port
system.l2.mem_side = system.membus.port system.l2.mem_side = system.membus.port
@ -43,8 +44,10 @@ def config_cache(options, system):
for i in xrange(options.num_cpus): for i in xrange(options.num_cpus):
if options.caches: if options.caches:
icache = L1Cache(size = options.l1i_size, assoc = options.l1i_assoc) icache = L1Cache(size = options.l1i_size, assoc = options.l1i_assoc,
dcache = L1Cache(size = options.l1d_size, assoc = options.l1d_assoc) block_size=options.cacheline_size)
dcache = L1Cache(size = options.l1d_size, assoc = options.l1d_assoc,
block_size=options.cacheline_size)
if buildEnv['TARGET_ISA'] == 'x86': if buildEnv['TARGET_ISA'] == 'x86':
system.cpu[i].addPrivateSplitL1Caches(icache, dcache, system.cpu[i].addPrivateSplitL1Caches(icache, dcache,
PageTableWalkerCache(), PageTableWalkerCache(),

View file

@ -46,6 +46,7 @@ parser.add_option("--l1d_assoc", type="int", default=2)
parser.add_option("--l1i_assoc", type="int", default=2) parser.add_option("--l1i_assoc", type="int", default=2)
parser.add_option("--l2_assoc", type="int", default=8) parser.add_option("--l2_assoc", type="int", default=8)
parser.add_option("--l3_assoc", type="int", default=16) parser.add_option("--l3_assoc", type="int", default=16)
parser.add_option("--cacheline_size", type="int", default=64)
# Run duration options # Run duration options
parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick, parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick,