memtest: scale associativity and mshrs according to config

Use the actual fanouts in the tree specification to scale
cache associativity and mshrs instead of dumb constants.
This commit is contained in:
Steve Reinhardt 2010-08-25 21:55:42 -07:00
parent 546eaa6109
commit 6d9fc4175e

View file

@ -115,7 +115,7 @@ proto_l1 = BaseCache(size = '32kB', assoc = 4, block_size = block_size,
if options.blocking: if options.blocking:
proto_l1.mshrs = 1 proto_l1.mshrs = 1
else: else:
proto_l1.mshrs = 8 proto_l1.mshrs = 4
# build a list of prototypes, one for each level of treespec, starting # build a list of prototypes, one for each level of treespec, starting
# at the end (last entry is tester objects) # at the end (last entry is tester objects)
@ -129,13 +129,14 @@ if len(treespec) > 1:
prototypes.insert(0, proto_l1) prototypes.insert(0, proto_l1)
# now add additional cache levels (if any) by scaling L1 params # now add additional cache levels (if any) by scaling L1 params
while len(prototypes) < len(treespec): for scale in treespec[:-2]:
# clone previous level and update params # clone previous level and update params
prev = prototypes[0] prev = prototypes[0]
next = prev() next = prev()
next.size = prev.size * 4 next.size = prev.size * scale
next.latency = prev.latency * 10 next.latency = prev.latency * 10
next.assoc = prev.assoc * 2 next.assoc = prev.assoc * scale
next.mshrs = prev.mshrs * scale
prototypes.insert(0, next) prototypes.insert(0, next)
# system simulated # system simulated