1# Copyright (c) 2006 The Regents of The University of Michigan
|
1# Copyright (c) 2006-2007 The Regents of The University of Michigan |
2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright 9# notice, this list of conditions and the following disclaimer in the 10# documentation and/or other materials provided with the distribution; 11# neither the name of the copyright holders nor the names of its 12# contributors may be used to endorse or promote products derived from 13# this software without specific prior written permission. 14# 15# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Kevin Lim 28 29import m5 30from m5 import makeList 31from m5.objects import * 32from Benchmarks import * 33 34class CowIdeDisk(IdeDisk): 35 image = CowDiskImage(child=RawDiskImage(read_only=True), 36 read_only=False) 37 38 def childImage(self, ci): 39 self.image.child.image_file = ci 40
|
41class CowMmDisk(MmDisk): 42 image = CowDiskImage(child=RawDiskImage(read_only=True), 43 read_only=False) 44 45 def childImage(self, ci): 46 self.image.child.image_file = ci 47 48 |
49class BaseTsunami(Tsunami): 50 ethernet = NSGigE(configdata=NSGigEPciData(), 51 pci_bus=0, pci_dev=1, pci_func=0) 52 etherint = NSGigEInt(device=Parent.ethernet) 53 ide = IdeController(disks=[Parent.disk0, Parent.disk2], 54 pci_func=0, pci_dev=0, pci_bus=0) 55 56def makeLinuxAlphaSystem(mem_mode, mdesc = None): 57 self = LinuxAlphaSystem() 58 if not mdesc: 59 # generic system 60 mdesc = SysConfig() 61 self.readfile = mdesc.script() 62 self.iobus = Bus(bus_id=0) 63 self.membus = Bus(bus_id=1) 64 self.bridge = Bridge() 65 self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem())) 66 self.bridge.side_a = self.iobus.port 67 self.bridge.side_b = self.membus.port 68 self.physmem.port = self.membus.port 69 self.disk0 = CowIdeDisk(driveID='master') 70 self.disk2 = CowIdeDisk(driveID='master') 71 self.disk0.childImage(mdesc.disk()) 72 self.disk2.childImage(disk('linux-bigswap2.img')) 73 self.tsunami = BaseTsunami() 74 self.tsunami.attachIO(self.iobus) 75 self.tsunami.ide.pio = self.iobus.port 76 self.tsunami.ethernet.pio = self.iobus.port 77 self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(), 78 read_only = True)) 79 self.intrctrl = IntrControl() 80 self.mem_mode = mem_mode 81 self.sim_console = SimConsole(listener=ConsoleListener(port=3456)) 82 self.kernel = binary('vmlinux') 83 self.pal = binary('ts_osfpal') 84 self.console = binary('console') 85 self.boot_osflags = 'root=/dev/hda1 console=ttyS0' 86 87 return self 88 89def makeSparcSystem(mem_mode, mdesc = None): 90 self = SparcSystem() 91 if not mdesc: 92 # generic system 93 mdesc = SysConfig() 94 self.readfile = mdesc.script() 95 self.iobus = Bus(bus_id=0) 96 self.membus = Bus(bus_id=1) 97 self.bridge = Bridge() 98 self.t1000 = T1000() 99 self.t1000.attachIO(self.iobus) 100 self.physmem = PhysicalMemory(range = AddrRange(Addr('1MB'), size = '64MB'), zero = True) 101 self.physmem2 = PhysicalMemory(range = AddrRange(Addr('2GB'), size ='256MB'), zero = True) 102 self.bridge.side_a = self.iobus.port 103 self.bridge.side_b = self.membus.port 104 self.physmem.port = self.membus.port 105 self.physmem2.port = self.membus.port 106 self.rom.port = self.membus.port 107 self.nvram.port = self.membus.port 108 self.hypervisor_desc.port = self.membus.port 109 self.partition_desc.port = self.membus.port 110 self.intrctrl = IntrControl()
|
103 self.mem_mode = mem_mode
104
|
111 self.disk0 = CowMmDisk() 112 self.disk0.childImage(disk('disk.s10hw2')) 113 self.disk0.pio = self.iobus.port |
114 self.reset_bin = binary('reset.bin') 115 self.hypervisor_bin = binary('q.bin') 116 self.openboot_bin = binary('openboot.bin') 117 self.nvram_bin = binary('nvram1') 118 self.hypervisor_desc_bin = binary('1up-hv.bin') 119 self.partition_desc_bin = binary('1up-md.bin') 120 121 return self 122 123 124def makeDualRoot(testSystem, driveSystem, dumpfile): 125 self = Root() 126 self.testsys = testSystem 127 self.drivesys = driveSystem 128 self.etherlink = EtherLink(int1 = Parent.testsys.tsunami.etherint[0], 129 int2 = Parent.drivesys.tsunami.etherint[0]) 130 if dumpfile: 131 self.etherdump = EtherDump(file=dumpfile) 132 self.etherlink.dump = Parent.etherdump 133 134 self.clock = '1THz' 135 return self
|