memtest.py (4892:298bc09b72fa) | memtest.py (4893:3439144e474a) |
---|---|
1# Copyright (c) 2006-2007 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 23 unchanged lines hidden (view full) --- 32m5.AddToPath('../common') 33 34parser = optparse.OptionParser() 35 36parser.add_option("-a", "--atomic", action="store_true", 37 help="Use atomic (non-timing) mode") 38parser.add_option("-b", "--blocking", action="store_true", 39 help="Use blocking caches") | 1# Copyright (c) 2006-2007 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 23 unchanged lines hidden (view full) --- 32m5.AddToPath('../common') 33 34parser = optparse.OptionParser() 35 36parser.add_option("-a", "--atomic", action="store_true", 37 help="Use atomic (non-timing) mode") 38parser.add_option("-b", "--blocking", action="store_true", 39 help="Use blocking caches") |
40parser.add_option("-l", "--maxloads", metavar="N", | 40parser.add_option("-l", "--maxloads", metavar="N", default=0, |
41 help="Stop after N loads") 42parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick, 43 metavar="T", 44 help="Stop after T ticks") 45 46# 47# The "tree" specification is a colon-separated list of one or more 48# integers. The first integer is the number of caches/testers --- 62 unchanged lines hidden (view full) --- 111proto_l1 = BaseCache(size = '32kB', assoc = 4, block_size = block_size, 112 latency = '1ns', tgts_per_mshr = 8) 113 114if options.blocking: 115 proto_l1.mshrs = 1 116else: 117 proto_l1.mshrs = 8 118 | 41 help="Stop after N loads") 42parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick, 43 metavar="T", 44 help="Stop after T ticks") 45 46# 47# The "tree" specification is a colon-separated list of one or more 48# integers. The first integer is the number of caches/testers --- 62 unchanged lines hidden (view full) --- 111proto_l1 = BaseCache(size = '32kB', assoc = 4, block_size = block_size, 112 latency = '1ns', tgts_per_mshr = 8) 113 114if options.blocking: 115 proto_l1.mshrs = 1 116else: 117 proto_l1.mshrs = 8 118 |
119# build a list of prototypes, one for each cache level (L1 is at end, 120# followed by the tester pseudo-cpu objects) 121prototypes = [ proto_l1, 122 MemTest(atomic=options.atomic, max_loads=options.maxloads, | 119# build a list of prototypes, one for each level of treespec, starting 120# at the end (last entry is tester objects) 121prototypes = [ MemTest(atomic=options.atomic, max_loads=options.maxloads, |
123 percent_functional=options.functional, 124 percent_uncacheable=options.uncacheable, 125 progress_interval=options.progress) ] 126 | 122 percent_functional=options.functional, 123 percent_uncacheable=options.uncacheable, 124 progress_interval=options.progress) ] 125 |
126# next comes L1 cache, if any 127if len(treespec) > 1: 128 prototypes.insert(0, proto_l1) 129 130# now add additional cache levels (if any) by scaling L1 params |
|
127while len(prototypes) < len(treespec): 128 # clone previous level and update params 129 prev = prototypes[0] 130 next = prev() 131 next.size = prev.size * 4 132 next.latency = prev.latency * 10 133 next.assoc = prev.assoc * 2 134 prototypes.insert(0, next) --- 50 unchanged lines hidden --- | 131while len(prototypes) < len(treespec): 132 # clone previous level and update params 133 prev = prototypes[0] 134 next = prev() 135 next.size = prev.size * 4 136 next.latency = prev.latency * 10 137 next.assoc = prev.assoc * 2 138 prototypes.insert(0, next) --- 50 unchanged lines hidden --- |