pc-simple-timing-ruby.py revision 9793
11689SN/A# Copyright (c) 2012 Mark D. Hill and David A. Wood 210785Sgope@wisc.edu# All rights reserved. 39480Snilay@cs.wisc.edu# 49480Snilay@cs.wisc.edu# Redistribution and use in source and binary forms, with or without 510785Sgope@wisc.edu# modification, are permitted provided that the following conditions are 610785Sgope@wisc.edu# met: redistributions of source code must retain the above copyright 710785Sgope@wisc.edu# notice, this list of conditions and the following disclaimer; 810785Sgope@wisc.edu# redistributions in binary form must reproduce the above copyright 910785Sgope@wisc.edu# notice, this list of conditions and the following disclaimer in the 1010785Sgope@wisc.edu# documentation and/or other materials provided with the distribution; 1110785Sgope@wisc.edu# neither the name of the copyright holders nor the names of its 1210785Sgope@wisc.edu# contributors may be used to endorse or promote products derived from 1310785Sgope@wisc.edu# this software without specific prior written permission. 1410785Sgope@wisc.edu# 1510785Sgope@wisc.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1610785Sgope@wisc.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 171689SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 181689SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 191689SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 201689SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 211689SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 221689SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 231689SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 241689SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 251689SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 261689SN/A# 271689SN/A# Authors: Nilay Vaish 281689SN/A 291689SN/Aimport m5, os, optparse, sys 301689SN/Afrom m5.objects import * 311689SN/Am5.util.addToPath('../configs/common') 321689SN/Afrom Benchmarks import SysConfig 331689SN/Aimport FSConfig 341689SN/A 351689SN/Am5.util.addToPath('../configs/ruby') 361689SN/Am5.util.addToPath('../configs/topologies') 371689SN/Aimport Ruby 381689SN/Aimport Options 391689SN/A 401689SN/A# Add the ruby specific and protocol specific options 412665SN/Aparser = optparse.OptionParser() 422665SN/AOptions.addCommonOptions(parser) 431689SN/ARuby.define_options(parser) 441061SN/A(options, args) = parser.parse_args() 4510785Sgope@wisc.edu 461061SN/A# Set the default cache size and associativity to be very small to encourage 4710785Sgope@wisc.edu# races between requests and writebacks. 4810785Sgope@wisc.eduoptions.l1d_size="32kB" 4910785Sgope@wisc.eduoptions.l1i_size="32kB" 5010785Sgope@wisc.eduoptions.l2_size="4MB" 5110785Sgope@wisc.eduoptions.l1d_assoc=2 5210785Sgope@wisc.eduoptions.l1i_assoc=2 5310785Sgope@wisc.eduoptions.l2_assoc=2 5410785Sgope@wisc.eduoptions.num_cpus = 2 5510785Sgope@wisc.edu 5610785Sgope@wisc.edu#the system 5710785Sgope@wisc.edumdesc = SysConfig(disk = 'linux-x86.img') 5810785Sgope@wisc.edusystem = FSConfig.makeLinuxX86System('timing', DDR3_1600_x64, options.num_cpus, 5910785Sgope@wisc.edu mdesc=mdesc, Ruby=True, 6010785Sgope@wisc.edu 6110785Sgope@wisc.edusystem.kernel = FSConfig.binary('x86_64-vmlinux-2.6.22.9.smp') 6211432Smitch.hayenga@arm.comsystem.cpu = [TimingSimpleCPU(cpu_id=i) for i in xrange(options.num_cpus)] 6311432Smitch.hayenga@arm.com 6410785Sgope@wisc.eduRuby.create_system(options, system, system.piobus, system._dma_ports) 6511433Smitch.hayenga@arm.com 6611433Smitch.hayenga@arm.com# Create a seperate clock domain for Ruby 6711433Smitch.hayenga@arm.comsystem.ruby.clk_domain = SrcClockDomain(clock = options.ruby_clock) 6811433Smitch.hayenga@arm.com 6911433Smitch.hayenga@arm.comfor (i, cpu) in enumerate(system.cpu): 7011433Smitch.hayenga@arm.com # create the interrupt controller 7111433Smitch.hayenga@arm.com cpu.createInterruptController() 7211433Smitch.hayenga@arm.com # Tie the cpu ports to the correct ruby system ports 7313810Spau.cabre@metempsy.com cpu.icache_port = system.ruby._cpu_ruby_ports[i].slave 7413810Spau.cabre@metempsy.com cpu.dcache_port = system.ruby._cpu_ruby_ports[i].slave 7510785Sgope@wisc.edu cpu.itb.walker.port = system.ruby._cpu_ruby_ports[i].slave 769480Snilay@cs.wisc.edu cpu.dtb.walker.port = system.ruby._cpu_ruby_ports[i].slave 7710785Sgope@wisc.edu cpu.interrupts.pio = system.piobus.master 7810785Sgope@wisc.edu cpu.interrupts.int_master = system.piobus.slave 7910785Sgope@wisc.edu cpu.interrupts.int_slave = system.piobus.master 8010785Sgope@wisc.edu 8110785Sgope@wisc.edu # Set access_phys_mem to True for ruby port 8210785Sgope@wisc.edu system.ruby._cpu_ruby_ports[i].access_phys_mem = True 8310785Sgope@wisc.edu 8411523Sdavid.guillen@arm.comroot = Root(full_system = True, system = system) 8511523Sdavid.guillen@arm.comm5.ticks.setGlobalFrequency('1THz') 8610785Sgope@wisc.edu