Merge zizzer:/bk/newmem
[gem5.git] / configs / common / FSConfig.py
1 # Copyright (c) 2006 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
29 import m5
30 from m5 import makeList
31 from m5.objects import *
32 from Benchmarks import *
33
34 class 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
41 class BaseTsunami(Tsunami):
42 ethernet = NSGigE(configdata=NSGigEPciData(),
43 pci_bus=0, pci_dev=1, pci_func=0)
44 etherint = NSGigEInt(device=Parent.ethernet)
45 ide = IdeController(disks=[Parent.disk0, Parent.disk2],
46 pci_func=0, pci_dev=0, pci_bus=0)
47
48 def makeLinuxAlphaSystem(mem_mode, mdesc = None):
49 self = LinuxAlphaSystem()
50 if not mdesc:
51 # generic system
52 mdesc = SysConfig()
53 self.readfile = mdesc.script()
54 self.iobus = Bus(bus_id=0)
55 self.membus = Bus(bus_id=1)
56 self.bridge = Bridge()
57 self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
58 self.bridge.side_a = self.iobus.port
59 self.bridge.side_b = self.membus.port
60 self.physmem.port = self.membus.port
61 self.disk0 = CowIdeDisk(driveID='master')
62 self.disk2 = CowIdeDisk(driveID='master')
63 self.disk0.childImage(mdesc.disk())
64 self.disk2.childImage(disk('linux-bigswap2.img'))
65 self.tsunami = BaseTsunami()
66 self.tsunami.attachIO(self.iobus)
67 self.tsunami.ide.pio = self.iobus.port
68 self.tsunami.ethernet.pio = self.iobus.port
69 self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
70 read_only = True))
71 self.intrctrl = IntrControl()
72 self.mem_mode = mem_mode
73 self.sim_console = SimConsole(listener=ConsoleListener(port=3456))
74 self.kernel = binary('vmlinux')
75 self.pal = binary('ts_osfpal')
76 self.console = binary('console')
77 self.boot_osflags = 'root=/dev/hda1 console=ttyS0'
78
79 return self
80
81 def makeSparcSystem(mem_mode, mdesc = None):
82 self = SparcSystem()
83 if not mdesc:
84 # generic system
85 mdesc = SysConfig()
86 self.readfile = mdesc.script()
87 self.membus = Bus(bus_id=1)
88 self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
89 self.physmem.port = self.membus.port
90 self.rom.port = self.membus.port
91 self.intrctrl = IntrControl()
92 self.mem_mode = mem_mode
93 self.kernel = binary('vmlinux')
94
95 self.reset_bin = binary('reset.bin')
96 self.hypervisor_bin = binary('q.bin')
97 self.openboot_bin = binary('openboot.bin')
98
99 return self
100
101
102 def makeDualRoot(testSystem, driveSystem, dumpfile):
103 self = Root()
104 self.testsys = testSystem
105 self.drivesys = driveSystem
106 self.etherlink = EtherLink(int1 = Parent.testsys.tsunami.etherint[0],
107 int2 = Parent.drivesys.tsunami.etherint[0])
108 if dumpfile:
109 self.etherdump = EtherDump(file=dumpfile)
110 self.etherlink.dump = Parent.etherdump
111
112 self.clock = '1THz'
113 return self