simple-timing.py revision 8134
14390Sktlim@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: Steve Reinhardt
283005Sstever@eecs.umich.edu
292997SN/Aimport m5
302997SN/Afrom m5.objects import *
312997SN/A
322997SN/Aclass MyCache(BaseCache):
332997SN/A    assoc = 2
342997SN/A    block_size = 64
354444Ssaidi@eecs.umich.edu    latency = '1ns'
362997SN/A    mshrs = 10
372997SN/A    tgts_per_mshr = 5
382997SN/A
398134SAli.Saidi@ARM.comclass MyL1Cache(MyCache):
408134SAli.Saidi@ARM.com    is_top_level = True
418134SAli.Saidi@ARM.com
423170Sstever@eecs.umich.educpu = TimingSimpleCPU(cpu_id=0)
438134SAli.Saidi@ARM.comcpu.addTwoLevelCacheHierarchy(MyL1Cache(size = '128kB'),
448134SAli.Saidi@ARM.com                              MyL1Cache(size = '256kB'),
454444Ssaidi@eecs.umich.edu                              MyCache(size = '2MB', latency='10ns'))
462998SN/Asystem = System(cpu = cpu,
472998SN/A                physmem = PhysicalMemory(),
482998SN/A                membus = Bus())
492998SN/Asystem.physmem.port = system.membus.port
507876Sgblack@eecs.umich.educpu.connectAllPorts(system.membus)
514390Sktlim@umich.educpu.clock = '2GHz'
522997SN/A
532998SN/Aroot = Root(system = system)
54