FSConfig.py revision 7730
17586SAli.Saidi@arm.com# Copyright (c) 2010 ARM Limited 27586SAli.Saidi@arm.com# All rights reserved. 37586SAli.Saidi@arm.com# 47586SAli.Saidi@arm.com# The license below extends only to copyright in the software and shall 57586SAli.Saidi@arm.com# not be construed as granting a license to any other intellectual 67586SAli.Saidi@arm.com# property including but not limited to intellectual property relating 77586SAli.Saidi@arm.com# to a hardware implementation of the functionality of the software 87586SAli.Saidi@arm.com# licensed hereunder. You may use the software subject to the license 97586SAli.Saidi@arm.com# terms below provided that you ensure that this notice is replicated 107586SAli.Saidi@arm.com# unmodified and in its entirety in all distributions of the software, 117586SAli.Saidi@arm.com# modified or unmodified, in source code or in binary form. 127586SAli.Saidi@arm.com# 135323Sgblack@eecs.umich.edu# Copyright (c) 2006-2008 The Regents of The University of Michigan 142934Sktlim@umich.edu# All rights reserved. 152934Sktlim@umich.edu# 162934Sktlim@umich.edu# Redistribution and use in source and binary forms, with or without 172934Sktlim@umich.edu# modification, are permitted provided that the following conditions are 182934Sktlim@umich.edu# met: redistributions of source code must retain the above copyright 192934Sktlim@umich.edu# notice, this list of conditions and the following disclaimer; 202934Sktlim@umich.edu# redistributions in binary form must reproduce the above copyright 212934Sktlim@umich.edu# notice, this list of conditions and the following disclaimer in the 222934Sktlim@umich.edu# documentation and/or other materials provided with the distribution; 232934Sktlim@umich.edu# neither the name of the copyright holders nor the names of its 242934Sktlim@umich.edu# contributors may be used to endorse or promote products derived from 252934Sktlim@umich.edu# this software without specific prior written permission. 262934Sktlim@umich.edu# 272934Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 282934Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 292934Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 302934Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 312934Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 322934Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 332934Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 342934Sktlim@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 352934Sktlim@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 362934Sktlim@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 372934Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 382934Sktlim@umich.edu# 392934Sktlim@umich.edu# Authors: Kevin Lim 402934Sktlim@umich.edu 412934Sktlim@umich.edufrom m5.objects import * 422995Ssaidi@eecs.umich.edufrom Benchmarks import * 432934Sktlim@umich.edu 442934Sktlim@umich.educlass CowIdeDisk(IdeDisk): 452934Sktlim@umich.edu image = CowDiskImage(child=RawDiskImage(read_only=True), 462934Sktlim@umich.edu read_only=False) 472934Sktlim@umich.edu 482934Sktlim@umich.edu def childImage(self, ci): 492934Sktlim@umich.edu self.image.child.image_file = ci 502934Sktlim@umich.edu 516122SSteve.Reinhardt@amd.comclass MemBus(Bus): 526122SSteve.Reinhardt@amd.com badaddr_responder = BadAddr() 536122SSteve.Reinhardt@amd.com default = Self.badaddr_responder.pio 546122SSteve.Reinhardt@amd.com 556122SSteve.Reinhardt@amd.com 564520Ssaidi@eecs.umich.edudef makeLinuxAlphaSystem(mem_mode, mdesc = None): 574520Ssaidi@eecs.umich.edu class BaseTsunami(Tsunami): 584982Ssaidi@eecs.umich.edu ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0) 594520Ssaidi@eecs.umich.edu ide = IdeController(disks=[Parent.disk0, Parent.disk2], 604520Ssaidi@eecs.umich.edu pci_func=0, pci_dev=0, pci_bus=0) 612934Sktlim@umich.edu 622934Sktlim@umich.edu self = LinuxAlphaSystem() 633005Sstever@eecs.umich.edu if not mdesc: 643005Sstever@eecs.umich.edu # generic system 653304Sstever@eecs.umich.edu mdesc = SysConfig() 662995Ssaidi@eecs.umich.edu self.readfile = mdesc.script() 672934Sktlim@umich.edu self.iobus = Bus(bus_id=0) 686122SSteve.Reinhardt@amd.com self.membus = MemBus(bus_id=1) 694965Ssaidi@eecs.umich.edu self.bridge = Bridge(delay='50ns', nack_delay='4ns') 705266Sksewell@umich.edu self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem())) 712934Sktlim@umich.edu self.bridge.side_a = self.iobus.port 722934Sktlim@umich.edu self.bridge.side_b = self.membus.port 732934Sktlim@umich.edu self.physmem.port = self.membus.port 742934Sktlim@umich.edu self.disk0 = CowIdeDisk(driveID='master') 752934Sktlim@umich.edu self.disk2 = CowIdeDisk(driveID='master') 762995Ssaidi@eecs.umich.edu self.disk0.childImage(mdesc.disk()) 772934Sktlim@umich.edu self.disk2.childImage(disk('linux-bigswap2.img')) 782934Sktlim@umich.edu self.tsunami = BaseTsunami() 792934Sktlim@umich.edu self.tsunami.attachIO(self.iobus) 802934Sktlim@umich.edu self.tsunami.ide.pio = self.iobus.port 812934Sktlim@umich.edu self.tsunami.ethernet.pio = self.iobus.port 822995Ssaidi@eecs.umich.edu self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(), 832934Sktlim@umich.edu read_only = True)) 842934Sktlim@umich.edu self.intrctrl = IntrControl() 852953Sktlim@umich.edu self.mem_mode = mem_mode 865478Snate@binkert.org self.terminal = Terminal() 872934Sktlim@umich.edu self.kernel = binary('vmlinux') 883449Shsul@eecs.umich.edu self.pal = binary('ts_osfpal') 892934Sktlim@umich.edu self.console = binary('console') 902934Sktlim@umich.edu self.boot_osflags = 'root=/dev/hda1 console=ttyS0' 912934Sktlim@umich.edu 922934Sktlim@umich.edu return self 932934Sktlim@umich.edu 947014SBrad.Beckmann@amd.comdef makeLinuxAlphaRubySystem(mem_mode, mdesc = None): 956765SBrad.Beckmann@amd.com class BaseTsunami(Tsunami): 966765SBrad.Beckmann@amd.com ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0) 976765SBrad.Beckmann@amd.com ide = IdeController(disks=[Parent.disk0, Parent.disk2], 986765SBrad.Beckmann@amd.com pci_func=0, pci_dev=0, pci_bus=0) 996765SBrad.Beckmann@amd.com 1007014SBrad.Beckmann@amd.com physmem = PhysicalMemory(range = AddrRange(mdesc.mem())) 1017014SBrad.Beckmann@amd.com self = LinuxAlphaSystem(physmem = physmem) 1026765SBrad.Beckmann@amd.com if not mdesc: 1036765SBrad.Beckmann@amd.com # generic system 1046765SBrad.Beckmann@amd.com mdesc = SysConfig() 1056765SBrad.Beckmann@amd.com self.readfile = mdesc.script() 1066765SBrad.Beckmann@amd.com 1076765SBrad.Beckmann@amd.com # Create pio bus to connect all device pio ports to rubymem's pio port 1086765SBrad.Beckmann@amd.com self.piobus = Bus(bus_id=0) 1096893SBrad.Beckmann@amd.com 1106893SBrad.Beckmann@amd.com # 1116893SBrad.Beckmann@amd.com # Pio functional accesses from devices need direct access to memory 1126893SBrad.Beckmann@amd.com # RubyPort currently does support functional accesses. Therefore provide 1136893SBrad.Beckmann@amd.com # the piobus a direct connection to physical memory 1146893SBrad.Beckmann@amd.com # 1157014SBrad.Beckmann@amd.com self.piobus.port = physmem.port 1166893SBrad.Beckmann@amd.com 1176765SBrad.Beckmann@amd.com self.disk0 = CowIdeDisk(driveID='master') 1186765SBrad.Beckmann@amd.com self.disk2 = CowIdeDisk(driveID='master') 1196765SBrad.Beckmann@amd.com self.disk0.childImage(mdesc.disk()) 1206765SBrad.Beckmann@amd.com self.disk2.childImage(disk('linux-bigswap2.img')) 1216765SBrad.Beckmann@amd.com self.tsunami = BaseTsunami() 1226765SBrad.Beckmann@amd.com self.tsunami.attachIO(self.piobus) 1236765SBrad.Beckmann@amd.com self.tsunami.ide.pio = self.piobus.port 1246765SBrad.Beckmann@amd.com self.tsunami.ethernet.pio = self.piobus.port 1256765SBrad.Beckmann@amd.com 1266893SBrad.Beckmann@amd.com # 1277633SBrad.Beckmann@amd.com # Store the dma devices for later connection to dma ruby ports. 1287633SBrad.Beckmann@amd.com # Append an underscore to dma_devices to avoid the SimObjectVector check. 1296893SBrad.Beckmann@amd.com # 1307633SBrad.Beckmann@amd.com self._dma_devices = [self.tsunami.ide, self.tsunami.ethernet] 1316765SBrad.Beckmann@amd.com 1326765SBrad.Beckmann@amd.com self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(), 1336765SBrad.Beckmann@amd.com read_only = True)) 1346765SBrad.Beckmann@amd.com self.intrctrl = IntrControl() 1356765SBrad.Beckmann@amd.com self.mem_mode = mem_mode 1366765SBrad.Beckmann@amd.com self.terminal = Terminal() 1376765SBrad.Beckmann@amd.com self.kernel = binary('vmlinux') 1386765SBrad.Beckmann@amd.com self.pal = binary('ts_osfpal') 1396765SBrad.Beckmann@amd.com self.console = binary('console') 1406765SBrad.Beckmann@amd.com self.boot_osflags = 'root=/dev/hda1 console=ttyS0' 1416765SBrad.Beckmann@amd.com 1426765SBrad.Beckmann@amd.com return self 1436765SBrad.Beckmann@amd.com 1443584Ssaidi@eecs.umich.edudef makeSparcSystem(mem_mode, mdesc = None): 1454486Sbinkertn@umich.edu class CowMmDisk(MmDisk): 1464486Sbinkertn@umich.edu image = CowDiskImage(child=RawDiskImage(read_only=True), 1474486Sbinkertn@umich.edu read_only=False) 1484486Sbinkertn@umich.edu 1494486Sbinkertn@umich.edu def childImage(self, ci): 1504486Sbinkertn@umich.edu self.image.child.image_file = ci 1514486Sbinkertn@umich.edu 1523584Ssaidi@eecs.umich.edu self = SparcSystem() 1533584Ssaidi@eecs.umich.edu if not mdesc: 1543584Ssaidi@eecs.umich.edu # generic system 1553584Ssaidi@eecs.umich.edu mdesc = SysConfig() 1563584Ssaidi@eecs.umich.edu self.readfile = mdesc.script() 1573743Sgblack@eecs.umich.edu self.iobus = Bus(bus_id=0) 1586122SSteve.Reinhardt@amd.com self.membus = MemBus(bus_id=1) 1594972Ssaidi@eecs.umich.edu self.bridge = Bridge(delay='50ns', nack_delay='4ns') 1603743Sgblack@eecs.umich.edu self.t1000 = T1000() 1614104Ssaidi@eecs.umich.edu self.t1000.attachOnChipIO(self.membus) 1623743Sgblack@eecs.umich.edu self.t1000.attachIO(self.iobus) 1633823Ssaidi@eecs.umich.edu self.physmem = PhysicalMemory(range = AddrRange(Addr('1MB'), size = '64MB'), zero = True) 1643814Ssaidi@eecs.umich.edu self.physmem2 = PhysicalMemory(range = AddrRange(Addr('2GB'), size ='256MB'), zero = True) 1653743Sgblack@eecs.umich.edu self.bridge.side_a = self.iobus.port 1663743Sgblack@eecs.umich.edu self.bridge.side_b = self.membus.port 1673584Ssaidi@eecs.umich.edu self.physmem.port = self.membus.port 1683814Ssaidi@eecs.umich.edu self.physmem2.port = self.membus.port 1693584Ssaidi@eecs.umich.edu self.rom.port = self.membus.port 1703745Sgblack@eecs.umich.edu self.nvram.port = self.membus.port 1713745Sgblack@eecs.umich.edu self.hypervisor_desc.port = self.membus.port 1723745Sgblack@eecs.umich.edu self.partition_desc.port = self.membus.port 1733584Ssaidi@eecs.umich.edu self.intrctrl = IntrControl() 1743898Ssaidi@eecs.umich.edu self.disk0 = CowMmDisk() 1753898Ssaidi@eecs.umich.edu self.disk0.childImage(disk('disk.s10hw2')) 1763898Ssaidi@eecs.umich.edu self.disk0.pio = self.iobus.port 1774103Ssaidi@eecs.umich.edu self.reset_bin = binary('reset_new.bin') 1784103Ssaidi@eecs.umich.edu self.hypervisor_bin = binary('q_new.bin') 1794103Ssaidi@eecs.umich.edu self.openboot_bin = binary('openboot_new.bin') 1803745Sgblack@eecs.umich.edu self.nvram_bin = binary('nvram1') 1813745Sgblack@eecs.umich.edu self.hypervisor_desc_bin = binary('1up-hv.bin') 1823745Sgblack@eecs.umich.edu self.partition_desc_bin = binary('1up-md.bin') 1833584Ssaidi@eecs.umich.edu 1843584Ssaidi@eecs.umich.edu return self 1853584Ssaidi@eecs.umich.edu 1867586SAli.Saidi@arm.comdef makeLinuxArmSystem(mem_mode, mdesc = None, bare_metal=False, 1877586SAli.Saidi@arm.com machine_type = None): 1887586SAli.Saidi@arm.com if bare_metal: 1897586SAli.Saidi@arm.com self = ArmSystem() 1907586SAli.Saidi@arm.com else: 1917586SAli.Saidi@arm.com self = LinuxArmSystem() 1927586SAli.Saidi@arm.com 1937586SAli.Saidi@arm.com if not mdesc: 1947586SAli.Saidi@arm.com # generic system 1957586SAli.Saidi@arm.com mdesc = SysConfig() 1967586SAli.Saidi@arm.com 1977586SAli.Saidi@arm.com self.readfile = mdesc.script() 1987586SAli.Saidi@arm.com self.iobus = Bus(bus_id=0) 1997586SAli.Saidi@arm.com self.membus = MemBus(bus_id=1) 2007586SAli.Saidi@arm.com self.membus.badaddr_responder.warn_access = "warn" 2017586SAli.Saidi@arm.com self.bridge = Bridge(delay='50ns', nack_delay='4ns') 2027586SAli.Saidi@arm.com self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()), zero = True) 2037730SAli.Saidi@ARM.com self.diskmem = PhysicalMemory(range = AddrRange(Addr('128MB'), size = '128MB'), 2047730SAli.Saidi@ARM.com file = disk('ael-arm.ext2')) 2057586SAli.Saidi@arm.com self.bridge.side_a = self.iobus.port 2067586SAli.Saidi@arm.com self.bridge.side_b = self.membus.port 2077586SAli.Saidi@arm.com self.physmem.port = self.membus.port 2087730SAli.Saidi@ARM.com self.diskmem.port = self.membus.port 2097586SAli.Saidi@arm.com 2107586SAli.Saidi@arm.com self.mem_mode = mem_mode 2117586SAli.Saidi@arm.com 2127586SAli.Saidi@arm.com if machine_type == "RealView_PBX": 2137586SAli.Saidi@arm.com self.realview = RealViewPBX() 2147586SAli.Saidi@arm.com elif machine_type == "RealView_EB": 2157586SAli.Saidi@arm.com self.realview = RealViewEB() 2167586SAli.Saidi@arm.com else: 2177586SAli.Saidi@arm.com print "Unknown Machine Type" 2187586SAli.Saidi@arm.com sys.exit(1) 2197586SAli.Saidi@arm.com 2207586SAli.Saidi@arm.com if not bare_metal and machine_type: 2217586SAli.Saidi@arm.com self.machine_type = machine_type 2227586SAli.Saidi@arm.com elif bare_metal: 2237586SAli.Saidi@arm.com self.realview.uart.end_on_eot = True 2247586SAli.Saidi@arm.com 2257586SAli.Saidi@arm.com self.realview.attachOnChipIO(self.membus) 2267586SAli.Saidi@arm.com self.realview.attachIO(self.iobus) 2277586SAli.Saidi@arm.com 2287586SAli.Saidi@arm.com self.intrctrl = IntrControl() 2297586SAli.Saidi@arm.com self.terminal = Terminal() 2307730SAli.Saidi@ARM.com self.kernel = binary('vmlinux.arm') 2317730SAli.Saidi@ARM.com self.boot_osflags = 'earlyprintk mem=128MB console=ttyAMA0 lpj=19988480' + \ 2327730SAli.Saidi@ARM.com ' norandmaps slram=slram0,0x8000000,+0x8000000' + \ 2337730SAli.Saidi@ARM.com ' mtdparts=slram0:- rw loglevel=8 root=/dev/mtdblock0' 2347586SAli.Saidi@arm.com 2357586SAli.Saidi@arm.com return self 2367586SAli.Saidi@arm.com 2377586SAli.Saidi@arm.com 2385222Sksewell@umich.edudef makeLinuxMipsSystem(mem_mode, mdesc = None): 2395222Sksewell@umich.edu class BaseMalta(Malta): 2405222Sksewell@umich.edu ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0) 2415222Sksewell@umich.edu ide = IdeController(disks=[Parent.disk0, Parent.disk2], 2425222Sksewell@umich.edu pci_func=0, pci_dev=0, pci_bus=0) 2435222Sksewell@umich.edu 2445222Sksewell@umich.edu self = LinuxMipsSystem() 2455222Sksewell@umich.edu if not mdesc: 2465222Sksewell@umich.edu # generic system 2475222Sksewell@umich.edu mdesc = SysConfig() 2485222Sksewell@umich.edu self.readfile = mdesc.script() 2495222Sksewell@umich.edu self.iobus = Bus(bus_id=0) 2506122SSteve.Reinhardt@amd.com self.membus = MemBus(bus_id=1) 2515222Sksewell@umich.edu self.bridge = Bridge(delay='50ns', nack_delay='4ns') 2525222Sksewell@umich.edu self.physmem = PhysicalMemory(range = AddrRange('1GB')) 2535222Sksewell@umich.edu self.bridge.side_a = self.iobus.port 2545222Sksewell@umich.edu self.bridge.side_b = self.membus.port 2555222Sksewell@umich.edu self.physmem.port = self.membus.port 2565222Sksewell@umich.edu self.disk0 = CowIdeDisk(driveID='master') 2575222Sksewell@umich.edu self.disk2 = CowIdeDisk(driveID='master') 2585222Sksewell@umich.edu self.disk0.childImage(mdesc.disk()) 2595222Sksewell@umich.edu self.disk2.childImage(disk('linux-bigswap2.img')) 2605222Sksewell@umich.edu self.malta = BaseMalta() 2615222Sksewell@umich.edu self.malta.attachIO(self.iobus) 2625222Sksewell@umich.edu self.malta.ide.pio = self.iobus.port 2635222Sksewell@umich.edu self.malta.ethernet.pio = self.iobus.port 2645222Sksewell@umich.edu self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(), 2655222Sksewell@umich.edu read_only = True)) 2665222Sksewell@umich.edu self.intrctrl = IntrControl() 2675222Sksewell@umich.edu self.mem_mode = mem_mode 2685478Snate@binkert.org self.terminal = Terminal() 2695222Sksewell@umich.edu self.kernel = binary('mips/vmlinux') 2705222Sksewell@umich.edu self.console = binary('mips/console') 2715222Sksewell@umich.edu self.boot_osflags = 'root=/dev/hda1 console=ttyS0' 2725222Sksewell@umich.edu 2735222Sksewell@umich.edu return self 2745222Sksewell@umich.edu 2755323Sgblack@eecs.umich.edudef x86IOAddress(port): 2765357Sgblack@eecs.umich.edu IO_address_space_base = 0x8000000000000000 2775323Sgblack@eecs.umich.edu return IO_address_space_base + port; 2785323Sgblack@eecs.umich.edu 2796135Sgblack@eecs.umich.edudef makeX86System(mem_mode, numCPUs = 1, mdesc = None, self = None): 2805613Sgblack@eecs.umich.edu if self == None: 2815613Sgblack@eecs.umich.edu self = X86System() 2825613Sgblack@eecs.umich.edu 2835133Sgblack@eecs.umich.edu if not mdesc: 2845133Sgblack@eecs.umich.edu # generic system 2855133Sgblack@eecs.umich.edu mdesc = SysConfig() 2865841Sgblack@eecs.umich.edu mdesc.diskname = 'x86root.img' 2875133Sgblack@eecs.umich.edu self.readfile = mdesc.script() 2885133Sgblack@eecs.umich.edu 2896802Sgblack@eecs.umich.edu self.mem_mode = mem_mode 2906802Sgblack@eecs.umich.edu 2915133Sgblack@eecs.umich.edu # Physical memory 2926122SSteve.Reinhardt@amd.com self.membus = MemBus(bus_id=1) 2935450Sgblack@eecs.umich.edu self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem())) 2945133Sgblack@eecs.umich.edu self.physmem.port = self.membus.port 2955133Sgblack@eecs.umich.edu 2965613Sgblack@eecs.umich.edu # North Bridge 2975613Sgblack@eecs.umich.edu self.iobus = Bus(bus_id=0) 2985613Sgblack@eecs.umich.edu self.bridge = Bridge(delay='50ns', nack_delay='4ns') 2995613Sgblack@eecs.umich.edu self.bridge.side_a = self.iobus.port 3005613Sgblack@eecs.umich.edu self.bridge.side_b = self.membus.port 3015613Sgblack@eecs.umich.edu 3025613Sgblack@eecs.umich.edu # Platform 3035638Sgblack@eecs.umich.edu self.pc = Pc() 3045613Sgblack@eecs.umich.edu self.pc.attachIO(self.iobus) 3055613Sgblack@eecs.umich.edu 3065613Sgblack@eecs.umich.edu self.intrctrl = IntrControl() 3075613Sgblack@eecs.umich.edu 3085841Sgblack@eecs.umich.edu # Disks 3095841Sgblack@eecs.umich.edu disk0 = CowIdeDisk(driveID='master') 3105841Sgblack@eecs.umich.edu disk2 = CowIdeDisk(driveID='master') 3115841Sgblack@eecs.umich.edu disk0.childImage(mdesc.disk()) 3125841Sgblack@eecs.umich.edu disk2.childImage(disk('linux-bigswap2.img')) 3135841Sgblack@eecs.umich.edu self.pc.south_bridge.ide.disks = [disk0, disk2] 3145841Sgblack@eecs.umich.edu 3155615Sgblack@eecs.umich.edu # Add in a Bios information structure. 3165615Sgblack@eecs.umich.edu structures = [X86SMBiosBiosInformation()] 3175615Sgblack@eecs.umich.edu self.smbios_table.structures = structures 3185615Sgblack@eecs.umich.edu 3195641Sgblack@eecs.umich.edu # Set up the Intel MP table 3206135Sgblack@eecs.umich.edu for i in xrange(numCPUs): 3216135Sgblack@eecs.umich.edu bp = X86IntelMPProcessor( 3226135Sgblack@eecs.umich.edu local_apic_id = i, 3236135Sgblack@eecs.umich.edu local_apic_version = 0x14, 3246135Sgblack@eecs.umich.edu enable = True, 3256135Sgblack@eecs.umich.edu bootstrap = (i == 0)) 3266135Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(bp) 3275644Sgblack@eecs.umich.edu io_apic = X86IntelMPIOAPIC( 3286135Sgblack@eecs.umich.edu id = numCPUs, 3295644Sgblack@eecs.umich.edu version = 0x11, 3305644Sgblack@eecs.umich.edu enable = True, 3315644Sgblack@eecs.umich.edu address = 0xfec00000) 3326135Sgblack@eecs.umich.edu self.pc.south_bridge.io_apic.apic_id = io_apic.id 3335644Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(io_apic) 3345644Sgblack@eecs.umich.edu isa_bus = X86IntelMPBus(bus_id = 0, bus_type='ISA') 3355644Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(isa_bus) 3365843Sgblack@eecs.umich.edu pci_bus = X86IntelMPBus(bus_id = 1, bus_type='PCI') 3375843Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(pci_bus) 3385843Sgblack@eecs.umich.edu connect_busses = X86IntelMPBusHierarchy(bus_id=0, 3395843Sgblack@eecs.umich.edu subtractive_decode=True, parent_bus=1) 3405843Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(connect_busses) 3415843Sgblack@eecs.umich.edu pci_dev4_inta = X86IntelMPIOIntAssignment( 3425843Sgblack@eecs.umich.edu interrupt_type = 'INT', 3435843Sgblack@eecs.umich.edu polarity = 'ConformPolarity', 3445843Sgblack@eecs.umich.edu trigger = 'ConformTrigger', 3455843Sgblack@eecs.umich.edu source_bus_id = 1, 3465843Sgblack@eecs.umich.edu source_bus_irq = 0 + (4 << 2), 3476044Sgblack@eecs.umich.edu dest_io_apic_id = io_apic.id, 3485843Sgblack@eecs.umich.edu dest_io_apic_intin = 16) 3496074Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(pci_dev4_inta); 3506135Sgblack@eecs.umich.edu def assignISAInt(irq, apicPin): 3516135Sgblack@eecs.umich.edu assign_8259_to_apic = X86IntelMPIOIntAssignment( 3526135Sgblack@eecs.umich.edu interrupt_type = 'ExtInt', 3536135Sgblack@eecs.umich.edu polarity = 'ConformPolarity', 3546135Sgblack@eecs.umich.edu trigger = 'ConformTrigger', 3556135Sgblack@eecs.umich.edu source_bus_id = 0, 3566135Sgblack@eecs.umich.edu source_bus_irq = irq, 3576135Sgblack@eecs.umich.edu dest_io_apic_id = io_apic.id, 3586135Sgblack@eecs.umich.edu dest_io_apic_intin = 0) 3596135Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(assign_8259_to_apic) 3606135Sgblack@eecs.umich.edu assign_to_apic = X86IntelMPIOIntAssignment( 3616135Sgblack@eecs.umich.edu interrupt_type = 'INT', 3626135Sgblack@eecs.umich.edu polarity = 'ConformPolarity', 3636135Sgblack@eecs.umich.edu trigger = 'ConformTrigger', 3646135Sgblack@eecs.umich.edu source_bus_id = 0, 3656135Sgblack@eecs.umich.edu source_bus_irq = irq, 3666135Sgblack@eecs.umich.edu dest_io_apic_id = io_apic.id, 3676135Sgblack@eecs.umich.edu dest_io_apic_intin = apicPin) 3686135Sgblack@eecs.umich.edu self.intel_mp_table.add_entry(assign_to_apic) 3696135Sgblack@eecs.umich.edu assignISAInt(0, 2) 3706135Sgblack@eecs.umich.edu assignISAInt(1, 1) 3716135Sgblack@eecs.umich.edu for i in range(3, 15): 3726135Sgblack@eecs.umich.edu assignISAInt(i, i) 3735641Sgblack@eecs.umich.edu 3745613Sgblack@eecs.umich.edu 3756135Sgblack@eecs.umich.edudef makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None): 3765613Sgblack@eecs.umich.edu self = LinuxX86System() 3775613Sgblack@eecs.umich.edu 3785613Sgblack@eecs.umich.edu # Build up a generic x86 system and then specialize it for Linux 3796135Sgblack@eecs.umich.edu makeX86System(mem_mode, numCPUs, mdesc, self) 3805613Sgblack@eecs.umich.edu 3815450Sgblack@eecs.umich.edu # We assume below that there's at least 1MB of memory. We'll require 2 3825450Sgblack@eecs.umich.edu # just to avoid corner cases. 3837069Snate@binkert.org assert(self.physmem.range.second.getValue() >= 0x200000) 3845450Sgblack@eecs.umich.edu 3855450Sgblack@eecs.umich.edu # Mark the first megabyte of memory as reserved 3865450Sgblack@eecs.umich.edu self.e820_table.entries.append(X86E820Entry( 3875450Sgblack@eecs.umich.edu addr = 0, 3885450Sgblack@eecs.umich.edu size = '1MB', 3895450Sgblack@eecs.umich.edu range_type = 2)) 3905450Sgblack@eecs.umich.edu 3915450Sgblack@eecs.umich.edu # Mark the rest as available 3925450Sgblack@eecs.umich.edu self.e820_table.entries.append(X86E820Entry( 3935450Sgblack@eecs.umich.edu addr = 0x100000, 3946072Sgblack@eecs.umich.edu size = '%dB' % (self.physmem.range.second - 0x100000 + 1), 3955450Sgblack@eecs.umich.edu range_type = 1)) 3965450Sgblack@eecs.umich.edu 3975330Sgblack@eecs.umich.edu # Command line 3985847Sgblack@eecs.umich.edu self.boot_osflags = 'earlyprintk=ttyS0 console=ttyS0 lpj=7999923 ' + \ 3995845Sgblack@eecs.umich.edu 'root=/dev/hda1' 4005133Sgblack@eecs.umich.edu return self 4015133Sgblack@eecs.umich.edu 4023584Ssaidi@eecs.umich.edu 4033025Ssaidi@eecs.umich.edudef makeDualRoot(testSystem, driveSystem, dumpfile): 4042934Sktlim@umich.edu self = Root() 4052995Ssaidi@eecs.umich.edu self.testsys = testSystem 4062995Ssaidi@eecs.umich.edu self.drivesys = driveSystem 4074981Ssaidi@eecs.umich.edu self.etherlink = EtherLink() 4084981Ssaidi@eecs.umich.edu self.etherlink.int0 = Parent.testsys.tsunami.ethernet.interface 4094981Ssaidi@eecs.umich.edu self.etherlink.int1 = Parent.drivesys.tsunami.ethernet.interface 4104981Ssaidi@eecs.umich.edu 4113025Ssaidi@eecs.umich.edu if dumpfile: 4123025Ssaidi@eecs.umich.edu self.etherdump = EtherDump(file=dumpfile) 4133025Ssaidi@eecs.umich.edu self.etherlink.dump = Parent.etherdump 4142934Sktlim@umich.edu 4152934Sktlim@umich.edu return self 4165253Sksewell@umich.edu 4175263Sksewell@umich.edudef setMipsOptions(TestCPUClass): 4185253Sksewell@umich.edu #CP0 Configuration 4195253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_PRId_CompanyOptions = 0 4205253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_PRId_CompanyID = 1 4215253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_PRId_ProcessorID = 147 4225253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_PRId_Revision = 0 4235253Sksewell@umich.edu 4245253Sksewell@umich.edu #CP0 Interrupt Control 4255253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_IntCtl_IPTI = 7 4265253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_IntCtl_IPPCI = 7 4275253Sksewell@umich.edu 4285253Sksewell@umich.edu # Config Register 4295253Sksewell@umich.edu #TestCPUClass.CoreParams.CP0_Config_K23 = 0 # Since TLB 4305253Sksewell@umich.edu #TestCPUClass.CoreParams.CP0_Config_KU = 0 # Since TLB 4315253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config_BE = 0 # Little Endian 4325253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config_AR = 1 # Architecture Revision 2 4335253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config_AT = 0 # MIPS32 4345253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config_MT = 1 # TLB MMU 4355253Sksewell@umich.edu #TestCPUClass.CoreParams.CP0_Config_K0 = 2 # Uncached 4365253Sksewell@umich.edu 4375253Sksewell@umich.edu #Config 1 Register 4385253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_M = 1 # Config2 Implemented 4395253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_MMU = 63 # TLB Size 4405253Sksewell@umich.edu # ***VERY IMPORTANT*** 4415253Sksewell@umich.edu # Remember to modify CP0_Config1 according to cache specs 4425253Sksewell@umich.edu # Examine file ../common/Cache.py 4435253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_IS = 1 # I-Cache Sets Per Way, 16KB cache, i.e., 1 (128) 4445253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_IL = 5 # I-Cache Line Size, default in Cache.py is 64, i.e 5 4455253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_IA = 1 # I-Cache Associativity, default in Cache.py is 2, i.e, a value of 1 4465253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_DS = 2 # D-Cache Sets Per Way (see below), 32KB cache, i.e., 2 4475253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_DL = 5 # D-Cache Line Size, default is 64, i.e., 5 4485253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_DA = 1 # D-Cache Associativity, default is 2, i.e. 1 4495253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_C2 = 0 # Coprocessor 2 not implemented(?) 4505253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_MD = 0 # MDMX ASE not implemented in Mips32 4515253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_PC = 1 # Performance Counters Implemented 4525253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_WR = 0 # Watch Registers Implemented 4535253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_CA = 0 # Mips16e NOT implemented 4545253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_EP = 0 # EJTag Not Implemented 4555253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config1_FP = 0 # FPU Implemented 4565253Sksewell@umich.edu 4575253Sksewell@umich.edu #Config 2 Register 4585253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_M = 1 # Config3 Implemented 4595253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_TU = 0 # Tertiary Cache Control 4605253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_TS = 0 # Tertiary Cache Sets Per Way 4615253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_TL = 0 # Tertiary Cache Line Size 4625253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_TA = 0 # Tertiary Cache Associativity 4635253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_SU = 0 # Secondary Cache Control 4645253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_SS = 0 # Secondary Cache Sets Per Way 4655253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_SL = 0 # Secondary Cache Line Size 4665253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config2_SA = 0 # Secondary Cache Associativity 4675253Sksewell@umich.edu 4685253Sksewell@umich.edu 4695253Sksewell@umich.edu #Config 3 Register 4705253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_M = 0 # Config4 Not Implemented 4715253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_DSPP = 1 # DSP ASE Present 4725253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_LPA = 0 # Large Physical Addresses Not supported in Mips32 4735253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_VEIC = 0 # EIC Supported 4745253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_VInt = 0 # Vectored Interrupts Implemented 4755253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_SP = 0 # Small Pages Supported (PageGrain reg. exists) 4765253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_MT = 0 # MT Not present 4775253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_SM = 0 # SmartMIPS ASE Not implemented 4785253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_Config3_TL = 0 # TraceLogic Not implemented 4795253Sksewell@umich.edu 4805253Sksewell@umich.edu #SRS Ctl - HSS 4815253Sksewell@umich.edu TestCPUClass.CoreParams.CP0_SrsCtl_HSS = 3 # Four shadow register sets implemented 4825253Sksewell@umich.edu 4835253Sksewell@umich.edu 4845253Sksewell@umich.edu #TestCPUClass.CoreParams.tlb = TLB() 4855253Sksewell@umich.edu #TestCPUClass.CoreParams.UnifiedTLB = 1 486