memtest.py (7525:722f2ad014a7) | memtest.py (7656:dd4d229b716d) |
---|---|
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 --- 101 unchanged lines hidden (view full) --- 110 111# define prototype L1 cache 112proto_l1 = BaseCache(size = '32kB', assoc = 4, block_size = block_size, 113 latency = '1ns', tgts_per_mshr = 8) 114 115if options.blocking: 116 proto_l1.mshrs = 1 117else: | 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 --- 101 unchanged lines hidden (view full) --- 110 111# define prototype L1 cache 112proto_l1 = BaseCache(size = '32kB', assoc = 4, block_size = block_size, 113 latency = '1ns', tgts_per_mshr = 8) 114 115if options.blocking: 116 proto_l1.mshrs = 1 117else: |
118 proto_l1.mshrs = 8 | 118 proto_l1.mshrs = 4 |
119 120# build a list of prototypes, one for each level of treespec, starting 121# at the end (last entry is tester objects) 122prototypes = [ MemTest(atomic=options.atomic, max_loads=options.maxloads, 123 percent_functional=options.functional, 124 percent_uncacheable=options.uncacheable, 125 progress_interval=options.progress) ] 126 127# next comes L1 cache, if any 128if len(treespec) > 1: 129 prototypes.insert(0, proto_l1) 130 131# now add additional cache levels (if any) by scaling L1 params | 119 120# build a list of prototypes, one for each level of treespec, starting 121# at the end (last entry is tester objects) 122prototypes = [ MemTest(atomic=options.atomic, max_loads=options.maxloads, 123 percent_functional=options.functional, 124 percent_uncacheable=options.uncacheable, 125 progress_interval=options.progress) ] 126 127# next comes L1 cache, if any 128if len(treespec) > 1: 129 prototypes.insert(0, proto_l1) 130 131# now add additional cache levels (if any) by scaling L1 params |
132while len(prototypes) < len(treespec): | 132for scale in treespec[:-2]: |
133 # clone previous level and update params 134 prev = prototypes[0] 135 next = prev() | 133 # clone previous level and update params 134 prev = prototypes[0] 135 next = prev() |
136 next.size = prev.size * 4 | 136 next.size = prev.size * scale |
137 next.latency = prev.latency * 10 | 137 next.latency = prev.latency * 10 |
138 next.assoc = prev.assoc * 2 | 138 next.assoc = prev.assoc * scale 139 next.mshrs = prev.mshrs * scale |
139 prototypes.insert(0, next) 140 141# system simulated 142system = System(funcmem = PhysicalMemory(), 143 physmem = PhysicalMemory(latency = "100ns")) 144 145def make_level(spec, prototypes, attach_obj, attach_port): 146 fanout = spec[0] --- 43 unchanged lines hidden --- | 140 prototypes.insert(0, next) 141 142# system simulated 143system = System(funcmem = PhysicalMemory(), 144 physmem = PhysicalMemory(latency = "100ns")) 145 146def make_level(spec, prototypes, attach_obj, attach_port): 147 fanout = spec[0] --- 43 unchanged lines hidden --- |