FSConfig.py revision 2934
112027Sjungma@eit.uni-kl.de# Copyright (c) 2006 The Regents of The University of Michigan 212027Sjungma@eit.uni-kl.de# All rights reserved. 312027Sjungma@eit.uni-kl.de# 412027Sjungma@eit.uni-kl.de# Redistribution and use in source and binary forms, with or without 512027Sjungma@eit.uni-kl.de# modification, are permitted provided that the following conditions are 612027Sjungma@eit.uni-kl.de# met: redistributions of source code must retain the above copyright 712027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer; 812027Sjungma@eit.uni-kl.de# redistributions in binary form must reproduce the above copyright 912027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer in the 1012027Sjungma@eit.uni-kl.de# documentation and/or other materials provided with the distribution; 1112027Sjungma@eit.uni-kl.de# neither the name of the copyright holders nor the names of its 1212027Sjungma@eit.uni-kl.de# contributors may be used to endorse or promote products derived from 1312027Sjungma@eit.uni-kl.de# this software without specific prior written permission. 1412027Sjungma@eit.uni-kl.de# 1512027Sjungma@eit.uni-kl.de# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1612027Sjungma@eit.uni-kl.de# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1712027Sjungma@eit.uni-kl.de# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1812027Sjungma@eit.uni-kl.de# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1912027Sjungma@eit.uni-kl.de# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2012027Sjungma@eit.uni-kl.de# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2112027Sjungma@eit.uni-kl.de# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2212027Sjungma@eit.uni-kl.de# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2312027Sjungma@eit.uni-kl.de# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2412027Sjungma@eit.uni-kl.de# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2512027Sjungma@eit.uni-kl.de# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2612027Sjungma@eit.uni-kl.de# 2712027Sjungma@eit.uni-kl.de# Authors: Kevin Lim 2812027Sjungma@eit.uni-kl.de 2912027Sjungma@eit.uni-kl.deimport m5 3012027Sjungma@eit.uni-kl.defrom m5.objects import * 3112027Sjungma@eit.uni-kl.defrom FullO3Config import * 3212027Sjungma@eit.uni-kl.defrom SysPaths import * 3312027Sjungma@eit.uni-kl.defrom Util import * 3412027Sjungma@eit.uni-kl.de 3512027Sjungma@eit.uni-kl.descript.dir = '/z/saidi/work/m5.newmem/configs/boot' 3612027Sjungma@eit.uni-kl.delinux_image = env.get('LINUX_IMAGE', disk('linux-latest.img')) 3712027Sjungma@eit.uni-kl.de 3812027Sjungma@eit.uni-kl.declass CowIdeDisk(IdeDisk): 3912027Sjungma@eit.uni-kl.de image = CowDiskImage(child=RawDiskImage(read_only=True), 4012027Sjungma@eit.uni-kl.de read_only=False) 4112027Sjungma@eit.uni-kl.de 4212027Sjungma@eit.uni-kl.de def childImage(self, ci): 4312027Sjungma@eit.uni-kl.de self.image.child.image_file = ci 4412027Sjungma@eit.uni-kl.de 4512027Sjungma@eit.uni-kl.declass BaseTsunami(Tsunami): 4612027Sjungma@eit.uni-kl.de ethernet = NSGigE(configdata=NSGigEPciData(), 4712027Sjungma@eit.uni-kl.de pci_bus=0, pci_dev=1, pci_func=0) 4812027Sjungma@eit.uni-kl.de etherint = NSGigEInt(device=Parent.ethernet) 4912027Sjungma@eit.uni-kl.de ide = IdeController(disks=[Parent.disk0, Parent.disk2], 5012027Sjungma@eit.uni-kl.de pci_func=0, pci_dev=0, pci_bus=0) 5112027Sjungma@eit.uni-kl.de 5212027Sjungma@eit.uni-kl.dedef MyLinuxAlphaSystem(cpu, mem_mode, linux_image, icache=None, dcache=None, l2cache=None): 5312027Sjungma@eit.uni-kl.de self = LinuxAlphaSystem() 5412027Sjungma@eit.uni-kl.de self.iobus = Bus(bus_id=0) 5512027Sjungma@eit.uni-kl.de self.membus = Bus(bus_id=1) 5612027Sjungma@eit.uni-kl.de self.bridge = Bridge() 5712027Sjungma@eit.uni-kl.de self.physmem = PhysicalMemory(range = AddrRange('128MB')) 5812027Sjungma@eit.uni-kl.de self.bridge.side_a = self.iobus.port 5912027Sjungma@eit.uni-kl.de self.bridge.side_b = self.membus.port 6012027Sjungma@eit.uni-kl.de self.physmem.port = self.membus.port 6112027Sjungma@eit.uni-kl.de self.disk0 = CowIdeDisk(driveID='master') 6212027Sjungma@eit.uni-kl.de self.disk2 = CowIdeDisk(driveID='master') 6312027Sjungma@eit.uni-kl.de self.disk0.childImage(linux_image) 6412027Sjungma@eit.uni-kl.de self.disk2.childImage(disk('linux-bigswap2.img')) 6512027Sjungma@eit.uni-kl.de self.tsunami = BaseTsunami() 6612027Sjungma@eit.uni-kl.de self.tsunami.attachIO(self.iobus) 6712027Sjungma@eit.uni-kl.de self.tsunami.ide.pio = self.iobus.port 6812027Sjungma@eit.uni-kl.de self.tsunami.ide.dma = self.iobus.port 6912027Sjungma@eit.uni-kl.de self.tsunami.ide.config = self.iobus.port 7012027Sjungma@eit.uni-kl.de self.tsunami.ethernet.pio = self.iobus.port 7112027Sjungma@eit.uni-kl.de self.tsunami.ethernet.dma = self.iobus.port 7212027Sjungma@eit.uni-kl.de self.tsunami.ethernet.config = self.iobus.port 7312027Sjungma@eit.uni-kl.de self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = linux_image, 7412027Sjungma@eit.uni-kl.de read_only = True)) 7512027Sjungma@eit.uni-kl.de self.intrctrl = IntrControl() 7612027Sjungma@eit.uni-kl.de self.cpu = cpu 7712027Sjungma@eit.uni-kl.de 7812027Sjungma@eit.uni-kl.de connectCpu(self.cpu, self.membus, icache, dcache, l2cache) 7912027Sjungma@eit.uni-kl.de for each_cpu in listWrapper(self.cpu): 80 each_cpu.itb = AlphaITB() 81 each_cpu.dtb = AlphaDTB() 82 self.cpu.clock = '2GHz' 83 self.sim_console = SimConsole(listener=ConsoleListener(port=3456)) 84 self.kernel = binary('vmlinux') 85 self.pal = binary('ts_osfpal') 86 self.console = binary('console') 87 self.boot_osflags = 'root=/dev/hda1 console=ttyS0' 88 89 return self 90 91class TsunamiRoot(Root): 92 pass 93 94def DualRoot(clientSystem, serverSystem): 95 self = Root() 96 self.client = clientSystem 97 self.server = serverSystem 98 99 self.etherdump = EtherDump(file='ethertrace') 100 self.etherlink = EtherLink(int1 = Parent.client.tsunami.etherint[0], 101 int2 = Parent.server.tsunami.etherint[0], 102 dump = Parent.etherdump) 103 self.clock = '1THz' 104 return self 105