memtest.py revision 9321:7f0464326b2b
12199SN/A# Copyright (c) 2006-2007 The Regents of The University of Michigan 22199SN/A# All rights reserved. 32199SN/A# 42199SN/A# Redistribution and use in source and binary forms, with or without 52199SN/A# modification, are permitted provided that the following conditions are 62199SN/A# met: redistributions of source code must retain the above copyright 72199SN/A# notice, this list of conditions and the following disclaimer; 82199SN/A# redistributions in binary form must reproduce the above copyright 92199SN/A# notice, this list of conditions and the following disclaimer in the 102199SN/A# documentation and/or other materials provided with the distribution; 112199SN/A# neither the name of the copyright holders nor the names of its 122199SN/A# contributors may be used to endorse or promote products derived from 132199SN/A# this software without specific prior written permission. 142199SN/A# 152199SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 162199SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 172199SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 182199SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 192199SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 202199SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 212199SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 222199SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 232199SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 242199SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 252199SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 262199SN/A# 272665Ssaidi@eecs.umich.edu# Authors: Ron Dreslinski 282665Ssaidi@eecs.umich.edu 292665Ssaidi@eecs.umich.eduimport m5 302665Ssaidi@eecs.umich.edufrom m5.objects import * 312199SN/Am5.util.addToPath('../configs/common') 322199SN/Afrom Caches import * 332561SN/A 342226SN/A#MAX CORES IS 8 with the fals sharing method 352561SN/Anb_cores = 8 362199SN/Acpus = [ MemTest(clock = '2GHz') for i in xrange(nb_cores) ] 372199SN/A 382680Sktlim@umich.edu# system simulated 392199SN/Asystem = System(cpu = cpus, funcmem = SimpleMemory(in_addr_map = False), 402199SN/A funcbus = NoncoherentBus(), 412199SN/A physmem = SimpleMemory(), 422199SN/A membus = CoherentBus(clock="1GHz", width=16)) 432199SN/A 442199SN/A# l2cache & bus 452209SN/Asystem.toL2Bus = CoherentBus(clock="2GHz", width=16) 462199SN/Asystem.l2c = L2Cache(clock = '2GHz', size='64kB', assoc=8) 472199SN/Asystem.l2c.cpu_side = system.toL2Bus.master 482458SN/A 492199SN/A# connect l2c to membus 502199SN/Asystem.l2c.mem_side = system.membus.slave 512199SN/A 522199SN/A# add L1 caches 532199SN/Afor cpu in cpus: 544111Sgblack@eecs.umich.edu cpu.l1c = L1Cache(size = '32kB', assoc = 4) 554188Sgblack@eecs.umich.edu cpu.l1c.cpu_side = cpu.test 564188Sgblack@eecs.umich.edu cpu.l1c.mem_side = system.toL2Bus.slave 574188Sgblack@eecs.umich.edu system.funcbus.slave = cpu.functional 584188Sgblack@eecs.umich.edu 594188Sgblack@eecs.umich.edusystem.system_port = system.membus.slave 604188Sgblack@eecs.umich.edu 614188Sgblack@eecs.umich.edu# connect reference memory to funcbus 624111Sgblack@eecs.umich.edusystem.funcmem.port = system.funcbus.master 634111Sgblack@eecs.umich.edu 644188Sgblack@eecs.umich.edu# connect memory to membus 654188Sgblack@eecs.umich.edusystem.physmem.port = system.membus.master 664111Sgblack@eecs.umich.edu 674111Sgblack@eecs.umich.edu 684111Sgblack@eecs.umich.edu# ----------------------- 694111Sgblack@eecs.umich.edu# run simulation 704188Sgblack@eecs.umich.edu# ----------------------- 714188Sgblack@eecs.umich.edu 724188Sgblack@eecs.umich.eduroot = Root( full_system = False, system = system ) 734111Sgblack@eecs.umich.eduroot.system.mem_mode = 'timing' 744111Sgblack@eecs.umich.edu#root.trace.flags="Cache CachePort MemoryAccess" 754111Sgblack@eecs.umich.edu#root.trace.cycle=1 764111Sgblack@eecs.umich.edu 774111Sgblack@eecs.umich.edu