Tsunami.py revision 5480
14486Sbinkertn@umich.edu# Copyright (c) 2005-2007 The Regents of The University of Michigan
24486Sbinkertn@umich.edu# All rights reserved.
34486Sbinkertn@umich.edu#
44486Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without
54486Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are
64486Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright
74486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer;
84486Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright
94486Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the
104486Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution;
114486Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its
124486Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from
134486Sbinkertn@umich.edu# this software without specific prior written permission.
144486Sbinkertn@umich.edu#
154486Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
164486Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
174486Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
184486Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
194486Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
204486Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
214486Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
224486Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
234486Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
244486Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
254486Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
264486Sbinkertn@umich.edu#
274486Sbinkertn@umich.edu# Authors: Nathan Binkert
284486Sbinkertn@umich.edu
293102SN/Afrom m5.params import *
303102SN/Afrom m5.proxy import *
315480Snate@binkert.orgfrom BadDevice import BadDevice
325480Snate@binkert.orgfrom AlphaBackdoor import AlphaBackdoor
333812SN/Afrom Device import BasicPioDevice, IsaFake, BadAddr
345480Snate@binkert.orgfrom Pci import PciConfigAll
351310SN/Afrom Platform import Platform
362916SN/Afrom Uart import Uart8250
371310SN/A
382542SN/Aclass TsunamiCChip(BasicPioDevice):
391366SN/A    type = 'TsunamiCChip'
401692SN/A    tsunami = Param.Tsunami(Parent.any, "Tsunami")
411310SN/A
422542SN/Aclass TsunamiIO(BasicPioDevice):
431366SN/A    type = 'TsunamiIO'
443934SN/A    time = Param.Time('01/01/2009',
453885SN/A        "System time to use ('Now' for actual time)")
463932SN/A    year_is_bcd = Param.Bool(False,
473932SN/A        "The RTC should interpret the year as a BCD value")
481692SN/A    tsunami = Param.Tsunami(Parent.any, "Tsunami")
491634SN/A    frequency = Param.Frequency('1024Hz', "frequency of interrupts")
501310SN/A
512542SN/Aclass TsunamiPChip(BasicPioDevice):
521366SN/A    type = 'TsunamiPChip'
531692SN/A    tsunami = Param.Tsunami(Parent.any, "Tsunami")
542916SN/A
552916SN/Aclass Tsunami(Platform):
562916SN/A    type = 'Tsunami'
572916SN/A    system = Param.System(Parent.any, "system")
582916SN/A
592916SN/A    cchip = TsunamiCChip(pio_addr=0x801a0000000)
602916SN/A    pchip = TsunamiPChip(pio_addr=0x80180000000)
612916SN/A    pciconfig = PciConfigAll()
622916SN/A    fake_sm_chip = IsaFake(pio_addr=0x801fc000370)
632916SN/A
642916SN/A    fake_uart1 = IsaFake(pio_addr=0x801fc0002f8)
652916SN/A    fake_uart2 = IsaFake(pio_addr=0x801fc0003e8)
662916SN/A    fake_uart3 = IsaFake(pio_addr=0x801fc0002e8)
672916SN/A    fake_uart4 = IsaFake(pio_addr=0x801fc0003f0)
682916SN/A
693847SN/A    fake_ppc = IsaFake(pio_addr=0x801fc0003bb)
702916SN/A
712916SN/A    fake_OROM = IsaFake(pio_addr=0x800000a0000, pio_size=0x60000)
722916SN/A
732916SN/A    fake_pnp_addr = IsaFake(pio_addr=0x801fc000279)
742916SN/A    fake_pnp_write = IsaFake(pio_addr=0x801fc000a79)
752916SN/A    fake_pnp_read0 = IsaFake(pio_addr=0x801fc000203)
762916SN/A    fake_pnp_read1 = IsaFake(pio_addr=0x801fc000243)
772916SN/A    fake_pnp_read2 = IsaFake(pio_addr=0x801fc000283)
782916SN/A    fake_pnp_read3 = IsaFake(pio_addr=0x801fc0002c3)
792916SN/A    fake_pnp_read4 = IsaFake(pio_addr=0x801fc000303)
802916SN/A    fake_pnp_read5 = IsaFake(pio_addr=0x801fc000343)
812916SN/A    fake_pnp_read6 = IsaFake(pio_addr=0x801fc000383)
822916SN/A    fake_pnp_read7 = IsaFake(pio_addr=0x801fc0003c3)
832916SN/A
842916SN/A    fake_ata0 = IsaFake(pio_addr=0x801fc0001f0)
852916SN/A    fake_ata1 = IsaFake(pio_addr=0x801fc000170)
862916SN/A
872916SN/A    fb = BadDevice(pio_addr=0x801fc0003d0, devicename='FrameBuffer')
882916SN/A    io = TsunamiIO(pio_addr=0x801fc000000)
892916SN/A    uart = Uart8250(pio_addr=0x801fc0003f8)
905480Snate@binkert.org    backdoor = AlphaBackdoor(pio_addr=0x80200000000, disk=Parent.simple_disk)
912916SN/A
922916SN/A    # Attach I/O devices to specified bus object.  Can't do this
932916SN/A    # earlier, since the bus object itself is typically defined at the
942916SN/A    # System level.
952916SN/A    def attachIO(self, bus):
962916SN/A        self.cchip.pio = bus.port
972916SN/A        self.pchip.pio = bus.port
982916SN/A        self.pciconfig.pio = bus.default
993489SN/A        bus.responder_set = True
1003502SN/A        bus.responder = self.pciconfig
1012916SN/A        self.fake_sm_chip.pio = bus.port
1022916SN/A        self.fake_uart1.pio = bus.port
1032916SN/A        self.fake_uart2.pio = bus.port
1042916SN/A        self.fake_uart3.pio = bus.port
1052916SN/A        self.fake_uart4.pio = bus.port
1062916SN/A        self.fake_ppc.pio = bus.port
1072916SN/A        self.fake_OROM.pio = bus.port
1082916SN/A        self.fake_pnp_addr.pio = bus.port
1092916SN/A        self.fake_pnp_write.pio = bus.port
1102916SN/A        self.fake_pnp_read0.pio = bus.port
1112916SN/A        self.fake_pnp_read1.pio = bus.port
1122916SN/A        self.fake_pnp_read2.pio = bus.port
1132916SN/A        self.fake_pnp_read3.pio = bus.port
1142916SN/A        self.fake_pnp_read4.pio = bus.port
1152916SN/A        self.fake_pnp_read5.pio = bus.port
1162916SN/A        self.fake_pnp_read6.pio = bus.port
1172916SN/A        self.fake_pnp_read7.pio = bus.port
1182916SN/A        self.fake_ata0.pio = bus.port
1192916SN/A        self.fake_ata1.pio = bus.port
1202916SN/A        self.fb.pio = bus.port
1212916SN/A        self.io.pio = bus.port
1222916SN/A        self.uart.pio = bus.port
1235480Snate@binkert.org        self.backdoor.pio = bus.port
124