tsunami-simple-timing.py revision 4444
12068SN/A# Copyright (c) 2006-2007 The Regents of The University of Michigan 22068SN/A# All rights reserved. 32068SN/A# 42068SN/A# Redistribution and use in source and binary forms, with or without 52068SN/A# modification, are permitted provided that the following conditions are 62068SN/A# met: redistributions of source code must retain the above copyright 72068SN/A# notice, this list of conditions and the following disclaimer; 82068SN/A# redistributions in binary form must reproduce the above copyright 92068SN/A# notice, this list of conditions and the following disclaimer in the 102068SN/A# documentation and/or other materials provided with the distribution; 112068SN/A# neither the name of the copyright holders nor the names of its 122068SN/A# contributors may be used to endorse or promote products derived from 132068SN/A# this software without specific prior written permission. 142068SN/A# 152068SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 162068SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 172068SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 182068SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 192068SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 202068SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 212068SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 222068SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 232068SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 242068SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 252068SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 262068SN/A# 272068SN/A# Authors: Steve Reinhardt 282665Ssaidi@eecs.umich.edu 292665Ssaidi@eecs.umich.eduimport m5 302068SN/Afrom m5.objects import * 312649Ssaidi@eecs.umich.edum5.AddToPath('../configs/common') 322649Ssaidi@eecs.umich.eduimport FSConfig 332649Ssaidi@eecs.umich.edu 342649Ssaidi@eecs.umich.edu 357799Sgblack@eecs.umich.edu# -------------------- 367799Sgblack@eecs.umich.edu# Base L1 Cache 377799Sgblack@eecs.umich.edu# ==================== 382649Ssaidi@eecs.umich.edu 392649Ssaidi@eecs.umich.educlass L1(BaseCache): 402068SN/A latency = '1ns' 412068SN/A block_size = 64 422068SN/A mshrs = 4 432090SN/A tgts_per_mshr = 8 442090SN/A protocol = CoherenceProtocol(protocol='moesi') 452132SN/A 462068SN/A# ---------------------- 477799Sgblack@eecs.umich.edu# Base L2 Cache 488738Sgblack@eecs.umich.edu# ---------------------- 492147SN/A 502068SN/Aclass L2(BaseCache): 512068SN/A block_size = 64 522068SN/A latency = '10ns' 532068SN/A mshrs = 92 542068SN/A tgts_per_mshr = 16 552068SN/A write_buffers = 8 562068SN/A 572068SN/A#cpu 582068SN/Acpu = TimingSimpleCPU(cpu_id=0) 592068SN/A#the system 602068SN/Asystem = FSConfig.makeLinuxAlphaSystem('timing') 612068SN/A 622068SN/Asystem.cpu = cpu 632068SN/A#create the l1/l2 bus 642068SN/Asystem.toL2Bus = Bus() 652068SN/A 662068SN/A#connect up the l2 cache 677799Sgblack@eecs.umich.edusystem.l2c = L2(size='4MB', assoc=8) 682068SN/Asystem.l2c.cpu_side = system.toL2Bus.port 697799Sgblack@eecs.umich.edusystem.l2c.mem_side = system.membus.port 707799Sgblack@eecs.umich.edu 717799Sgblack@eecs.umich.edu#connect up the cpu and l1s 722068SN/Acpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1), 732068SN/A L1(size = '32kB', assoc = 4)) 742068SN/A# connect cpu level-1 caches to shared level-2 cache 752068SN/Acpu.connectMemPorts(system.toL2Bus) 762068SN/Acpu.clock = '2GHz' 772068SN/A 782068SN/Aroot = Root(system=system) 792068SN/Am5.ticks.setGlobalFrequency('1THz') 807799Sgblack@eecs.umich.edu 812068SN/A