T1000.py revision 4486:aaeb03a8a6e1
12810SN/A# Copyright (c) 2006-2007 The Regents of The University of Michigan
212724Snikos.nikoleris@arm.com# All rights reserved.
38856Sandreas.hansson@arm.com#
48856Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without
58856Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are
68856Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright
78856Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer;
88856Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright
98856Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the
108856Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution;
118856Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its
128856Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from
138856Sandreas.hansson@arm.com# this software without specific prior written permission.
142810SN/A#
152810SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
162810SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
172810SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
182810SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
192810SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
202810SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
212810SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
222810SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
232810SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
242810SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
252810SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262810SN/A#
272810SN/A# Authors: Gabe Black
282810SN/A
292810SN/Afrom m5.params import *
302810SN/Afrom m5.proxy import *
312810SN/Afrom Device import BasicPioDevice, PioDevice, IsaFake, BadAddr
322810SN/Afrom Uart import Uart8250
332810SN/Afrom Platform import Platform
342810SN/Afrom SimConsole import SimConsole
352810SN/A
362810SN/A
372810SN/Aclass MmDisk(BasicPioDevice):
382810SN/A    type = 'MmDisk'
392810SN/A    image = Param.DiskImage("Disk Image")
402810SN/A    pio_addr = 0x1F40000000
4112724Snikos.nikoleris@arm.com
422810SN/Aclass DumbTOD(BasicPioDevice):
432810SN/A    type = 'DumbTOD'
442810SN/A    time = Param.Time('01/01/2009', "System time to use ('Now' for real time)")
452810SN/A    pio_addr = 0xfff0c1fff8
462810SN/A
472810SN/Aclass Iob(PioDevice):
482810SN/A    type = 'Iob'
4911486Snikos.nikoleris@arm.com    pio_latency = Param.Latency('1ns', "Programed IO latency in simticks")
5011486Snikos.nikoleris@arm.com
5112724Snikos.nikoleris@arm.com
5212724Snikos.nikoleris@arm.comclass T1000(Platform):
538232Snate@binkert.org    type = 'T1000'
5412724Snikos.nikoleris@arm.com    system = Param.System(Parent.any, "system")
5513222Sodanrc@yahoo.com.br
5612724Snikos.nikoleris@arm.com    fake_clk = IsaFake(pio_addr=0x9600000000, pio_size=0x100000000)
5711486Snikos.nikoleris@arm.com            #warn_access="Accessing Clock Unit -- Unimplemented!")
5812724Snikos.nikoleris@arm.com
5912724Snikos.nikoleris@arm.com    fake_membnks = IsaFake(pio_addr=0x9700000000, pio_size=16384,
6012724Snikos.nikoleris@arm.com            ret_data64=0x0000000000000000, update_data=False)
6113352Snikos.nikoleris@arm.com            #warn_access="Accessing Memory Banks -- Unimplemented!")
6212724Snikos.nikoleris@arm.com
6312724Snikos.nikoleris@arm.com    fake_jbi = IsaFake(pio_addr=0x8000000000, pio_size=0x100000000)
6412724Snikos.nikoleris@arm.com            #warn_access="Accessing JBI -- Unimplemented!")
6512724Snikos.nikoleris@arm.com
662810SN/A    fake_l2_1 = IsaFake(pio_addr=0xA900000000, pio_size=0x8,
672810SN/A            ret_data64=0x0000000000000001, update_data=True)
682810SN/A            #warn_access="Accessing L2 Cache Banks -- Unimplemented!")
698856Sandreas.hansson@arm.com
708856Sandreas.hansson@arm.com    fake_l2_2 = IsaFake(pio_addr=0xA900000040, pio_size=0x8,
718856Sandreas.hansson@arm.com            ret_data64=0x0000000000000001, update_data=True)
7213564Snikos.nikoleris@arm.com            #warn_access="Accessing L2 Cache Banks -- Unimplemented!")
7313564Snikos.nikoleris@arm.com
7412084Sspwilson2@wisc.edu    fake_l2_3 = IsaFake(pio_addr=0xA900000080, pio_size=0x8,
7512084Sspwilson2@wisc.edu            ret_data64=0x0000000000000001, update_data=True)
768856Sandreas.hansson@arm.com            #warn_access="Accessing L2 Cache Banks -- Unimplemented!")
778856Sandreas.hansson@arm.com
784475SN/A    fake_l2_4 = IsaFake(pio_addr=0xA9000000C0, pio_size=0x8,
7911053Sandreas.hansson@arm.com            ret_data64=0x0000000000000001, update_data=True)
805034SN/A            #warn_access="Accessing L2 Cache Banks -- Unimplemented!")
8112724Snikos.nikoleris@arm.com
8212724Snikos.nikoleris@arm.com    fake_l2esr_1 = IsaFake(pio_addr=0xAB00000000, pio_size=0x8,
8311377Sandreas.hansson@arm.com            ret_data64=0x0000000000000000, update_data=True)
8411377Sandreas.hansson@arm.com            #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!")
8512724Snikos.nikoleris@arm.com
8612724Snikos.nikoleris@arm.com    fake_l2esr_2 = IsaFake(pio_addr=0xAB00000040, pio_size=0x8,
8713352Snikos.nikoleris@arm.com            ret_data64=0x0000000000000000, update_data=True)
8812724Snikos.nikoleris@arm.com            #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!")
8912724Snikos.nikoleris@arm.com
9012724Snikos.nikoleris@arm.com    fake_l2esr_3 = IsaFake(pio_addr=0xAB00000080, pio_size=0x8,
9112724Snikos.nikoleris@arm.com            ret_data64=0x0000000000000000, update_data=True)
9212724Snikos.nikoleris@arm.com            #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!")
9311053Sandreas.hansson@arm.com
9411722Ssophiane.senni@gmail.com    fake_l2esr_4 = IsaFake(pio_addr=0xAB000000C0, pio_size=0x8,
9511722Ssophiane.senni@gmail.com            ret_data64=0x0000000000000000, update_data=True)
9611722Ssophiane.senni@gmail.com            #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!")
9711722Ssophiane.senni@gmail.com
989263Smrinmoy.ghosh@arm.com    fake_ssi = IsaFake(pio_addr=0xff00000000, pio_size=0x10000000)
9913418Sodanrc@yahoo.com.br            #warn_access="Accessing SSI -- Unimplemented!")
1005034SN/A
10111331Sandreas.hansson@arm.com    hconsole = SimConsole()
10212724Snikos.nikoleris@arm.com    hvuart = Uart8250(pio_addr=0xfff0c2c000)
10310884Sandreas.hansson@arm.com    htod = DumbTOD()
1044626SN/A
10510360Sandreas.hansson@arm.com    pconsole = SimConsole()
10611484Snikos.nikoleris@arm.com    puart0 = Uart8250(pio_addr=0x1f10000000)
1075034SN/A
1088883SAli.Saidi@ARM.com    iob = Iob()
1098833Sdam.sunwoo@arm.com    # Attach I/O devices that are on chip
1104458SN/A    def attachOnChipIO(self, bus):
11111377Sandreas.hansson@arm.com        self.iob.pio = bus.port
11211377Sandreas.hansson@arm.com        self.htod.pio = bus.port
11311377Sandreas.hansson@arm.com
11411377Sandreas.hansson@arm.com
11511377Sandreas.hansson@arm.com    # Attach I/O devices to specified bus object.  Can't do this
11611377Sandreas.hansson@arm.com    # earlier, since the bus object itself is typically defined at the
11711331Sandreas.hansson@arm.com    # System level.
11811331Sandreas.hansson@arm.com    def attachIO(self, bus):
11912724Snikos.nikoleris@arm.com        self.hvuart.sim_console = self.hconsole
12012843Srmk35@cl.cam.ac.uk        self.puart0.sim_console = self.pconsole
12112724Snikos.nikoleris@arm.com        self.fake_clk.pio = bus.port
12213419Sodanrc@yahoo.com.br        self.fake_membnks.pio = bus.port
12312724Snikos.nikoleris@arm.com        self.fake_l2_1.pio = bus.port
12412724Snikos.nikoleris@arm.com        self.fake_l2_2.pio = bus.port
12512724Snikos.nikoleris@arm.com        self.fake_l2_3.pio = bus.port
12612724Snikos.nikoleris@arm.com        self.fake_l2_4.pio = bus.port
12712724Snikos.nikoleris@arm.com        self.fake_l2esr_1.pio = bus.port
12812724Snikos.nikoleris@arm.com        self.fake_l2esr_2.pio = bus.port
12912724Snikos.nikoleris@arm.com        self.fake_l2esr_3.pio = bus.port
1302810SN/A        self.fake_l2esr_4.pio = bus.port
1312810SN/A        self.fake_ssi.pio = bus.port
1323013SN/A        self.fake_jbi.pio = bus.port
1338856Sandreas.hansson@arm.com        self.puart0.pio = bus.port
1342810SN/A        self.hvuart.pio = bus.port
1353013SN/A