memtest-filter.py revision 9321
13005Sstever@eecs.umich.edu# Copyright (c) 2006-2007 The Regents of The University of Michigan
23005Sstever@eecs.umich.edu# All rights reserved.
33005Sstever@eecs.umich.edu#
43005Sstever@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
53005Sstever@eecs.umich.edu# modification, are permitted provided that the following conditions are
63005Sstever@eecs.umich.edu# met: redistributions of source code must retain the above copyright
73005Sstever@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
83005Sstever@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
93005Sstever@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
103005Sstever@eecs.umich.edu# documentation and/or other materials provided with the distribution;
113005Sstever@eecs.umich.edu# neither the name of the copyright holders nor the names of its
123005Sstever@eecs.umich.edu# contributors may be used to endorse or promote products derived from
133005Sstever@eecs.umich.edu# this software without specific prior written permission.
143005Sstever@eecs.umich.edu#
153005Sstever@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
163005Sstever@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
173005Sstever@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
183005Sstever@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
193005Sstever@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
203005Sstever@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
213005Sstever@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
223005Sstever@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
233005Sstever@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
243005Sstever@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
253005Sstever@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
263005Sstever@eecs.umich.edu#
273005Sstever@eecs.umich.edu# Authors: Ron Dreslinski
283005Sstever@eecs.umich.edu
292889SN/Aimport m5
302889SN/Afrom m5.objects import *
312710SN/Am5.util.addToPath('../configs/common')
322710SN/Afrom Caches import *
332934SN/A
342934SN/A#MAX CORES IS 8 with the fals sharing method
352549SN/Anb_cores = 8
362995SN/Acpus = [ MemTest(clock = '2GHz') for i in xrange(nb_cores) ]
373395Shsul@eecs.umich.edu
382549SN/A# system simulated
393088Sstever@eecs.umich.edusystem = System(cpu = cpus, funcmem = SimpleMemory(in_addr_map = False),
403088Sstever@eecs.umich.edu                funcbus = NoncoherentBus(),
413088Sstever@eecs.umich.edu                physmem = SimpleMemory(),
422889SN/A                membus = CoherentBus(clock="1GHz", width=16))
432710SN/A
443322Shsul@eecs.umich.edu# l2cache & bus
452995SN/Asystem.toL2Bus = CoherentBus(clock="2GHz", width=16)
462995SN/Asystem.l2c = L2Cache(clock = '2GHz', size='64kB', assoc=8)
472995SN/Asystem.l2c.cpu_side = system.toL2Bus.master
482995SN/A
492995SN/A# connect l2c to membus
503143Shsul@eecs.umich.edusystem.l2c.mem_side = system.membus.slave
513322Shsul@eecs.umich.edu
523322Shsul@eecs.umich.edu# add L1 caches
533025Ssaidi@eecs.umich.edufor cpu in cpus:
543143Shsul@eecs.umich.edu    cpu.l1c = L1Cache(size = '32kB', assoc = 4)
553143Shsul@eecs.umich.edu    cpu.l1c.cpu_side = cpu.test
563322Shsul@eecs.umich.edu    cpu.l1c.mem_side = system.toL2Bus.slave
572710SN/A    system.funcbus.slave = cpu.functional
583395Shsul@eecs.umich.edu
593322Shsul@eecs.umich.edusystem.system_port = system.membus.slave
602710SN/A
612710SN/A# connect reference memory to funcbus
622710SN/Asystem.funcmem.port = system.funcbus.master
632710SN/A
642710SN/A# connect memory to membus
652710SN/Asystem.physmem.port = system.membus.master
663322Shsul@eecs.umich.edu
673304Sstever@eecs.umich.edu
683322Shsul@eecs.umich.edu# -----------------------
693322Shsul@eecs.umich.edu# run simulation
703304Sstever@eecs.umich.edu# -----------------------
713322Shsul@eecs.umich.edu
722934SN/Aroot = Root( full_system = False, system = system )
733322Shsul@eecs.umich.eduroot.system.mem_mode = 'timing'
743322Shsul@eecs.umich.edu#root.trace.flags="Cache CachePort MemoryAccess"
752934SN/A#root.trace.cycle=1
763322Shsul@eecs.umich.edu
773322Shsul@eecs.umich.edu