RealView.py revision 4486
112047Schristian.menard@tu-dresden.de# Copyright (c) 2006-2007 The Regents of The University of Michigan 212047Schristian.menard@tu-dresden.de# All rights reserved. 312047Schristian.menard@tu-dresden.de# 412047Schristian.menard@tu-dresden.de# Redistribution and use in source and binary forms, with or without 512047Schristian.menard@tu-dresden.de# modification, are permitted provided that the following conditions are 612047Schristian.menard@tu-dresden.de# met: redistributions of source code must retain the above copyright 712047Schristian.menard@tu-dresden.de# notice, this list of conditions and the following disclaimer; 812047Schristian.menard@tu-dresden.de# redistributions in binary form must reproduce the above copyright 912047Schristian.menard@tu-dresden.de# notice, this list of conditions and the following disclaimer in the 1012047Schristian.menard@tu-dresden.de# documentation and/or other materials provided with the distribution; 1112047Schristian.menard@tu-dresden.de# neither the name of the copyright holders nor the names of its 1212047Schristian.menard@tu-dresden.de# contributors may be used to endorse or promote products derived from 1312047Schristian.menard@tu-dresden.de# this software without specific prior written permission. 1412047Schristian.menard@tu-dresden.de# 1512047Schristian.menard@tu-dresden.de# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1612047Schristian.menard@tu-dresden.de# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1712047Schristian.menard@tu-dresden.de# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1812047Schristian.menard@tu-dresden.de# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1912047Schristian.menard@tu-dresden.de# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2012047Schristian.menard@tu-dresden.de# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2112047Schristian.menard@tu-dresden.de# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2212047Schristian.menard@tu-dresden.de# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2312047Schristian.menard@tu-dresden.de# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2412047Schristian.menard@tu-dresden.de# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2512047Schristian.menard@tu-dresden.de# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2612047Schristian.menard@tu-dresden.de# 2712047Schristian.menard@tu-dresden.de# Authors: Gabe Black 2812047Schristian.menard@tu-dresden.de 2912047Schristian.menard@tu-dresden.defrom m5.params import * 3012047Schristian.menard@tu-dresden.defrom m5.proxy import * 3112047Schristian.menard@tu-dresden.defrom Device import BasicPioDevice, PioDevice, IsaFake, BadAddr 3212047Schristian.menard@tu-dresden.defrom Uart import Uart8250 3312047Schristian.menard@tu-dresden.defrom Platform import Platform 3412047Schristian.menard@tu-dresden.defrom SimConsole import SimConsole 3512047Schristian.menard@tu-dresden.de 3612047Schristian.menard@tu-dresden.de 3712047Schristian.menard@tu-dresden.declass MmDisk(BasicPioDevice): 3812047Schristian.menard@tu-dresden.de type = 'MmDisk' 3912047Schristian.menard@tu-dresden.de image = Param.DiskImage("Disk Image") 4012047Schristian.menard@tu-dresden.de pio_addr = 0x1F40000000 4112047Schristian.menard@tu-dresden.de 4212047Schristian.menard@tu-dresden.declass DumbTOD(BasicPioDevice): 4312047Schristian.menard@tu-dresden.de type = 'DumbTOD' 4412047Schristian.menard@tu-dresden.de time = Param.Time('01/01/2009', "System time to use ('Now' for real time)") 4512047Schristian.menard@tu-dresden.de pio_addr = 0xfff0c1fff8 4612047Schristian.menard@tu-dresden.de 4712047Schristian.menard@tu-dresden.declass Iob(PioDevice): 4812047Schristian.menard@tu-dresden.de type = 'Iob' 4912047Schristian.menard@tu-dresden.de pio_latency = Param.Latency('1ns', "Programed IO latency in simticks") 5012047Schristian.menard@tu-dresden.de 5112047Schristian.menard@tu-dresden.de 5212047Schristian.menard@tu-dresden.declass T1000(Platform): 5312047Schristian.menard@tu-dresden.de type = 'T1000' 5412047Schristian.menard@tu-dresden.de system = Param.System(Parent.any, "system") 5512047Schristian.menard@tu-dresden.de 5612047Schristian.menard@tu-dresden.de fake_clk = IsaFake(pio_addr=0x9600000000, pio_size=0x100000000) 5712047Schristian.menard@tu-dresden.de #warn_access="Accessing Clock Unit -- Unimplemented!") 5812047Schristian.menard@tu-dresden.de 5912047Schristian.menard@tu-dresden.de fake_membnks = IsaFake(pio_addr=0x9700000000, pio_size=16384, 6012047Schristian.menard@tu-dresden.de ret_data64=0x0000000000000000, update_data=False) 6112047Schristian.menard@tu-dresden.de #warn_access="Accessing Memory Banks -- Unimplemented!") 6212047Schristian.menard@tu-dresden.de 6312047Schristian.menard@tu-dresden.de fake_jbi = IsaFake(pio_addr=0x8000000000, pio_size=0x100000000) 6412047Schristian.menard@tu-dresden.de #warn_access="Accessing JBI -- Unimplemented!") 6512047Schristian.menard@tu-dresden.de 6612047Schristian.menard@tu-dresden.de fake_l2_1 = IsaFake(pio_addr=0xA900000000, pio_size=0x8, 6712047Schristian.menard@tu-dresden.de ret_data64=0x0000000000000001, update_data=True) 6812047Schristian.menard@tu-dresden.de #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 6912047Schristian.menard@tu-dresden.de 7012047Schristian.menard@tu-dresden.de fake_l2_2 = IsaFake(pio_addr=0xA900000040, pio_size=0x8, 7112047Schristian.menard@tu-dresden.de ret_data64=0x0000000000000001, update_data=True) 7212047Schristian.menard@tu-dresden.de #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 7312047Schristian.menard@tu-dresden.de 7412047Schristian.menard@tu-dresden.de fake_l2_3 = IsaFake(pio_addr=0xA900000080, pio_size=0x8, 7512047Schristian.menard@tu-dresden.de ret_data64=0x0000000000000001, update_data=True) 7612047Schristian.menard@tu-dresden.de #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 7712047Schristian.menard@tu-dresden.de 7812047Schristian.menard@tu-dresden.de fake_l2_4 = IsaFake(pio_addr=0xA9000000C0, pio_size=0x8, 79 ret_data64=0x0000000000000001, update_data=True) 80 #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 81 82 fake_l2esr_1 = IsaFake(pio_addr=0xAB00000000, pio_size=0x8, 83 ret_data64=0x0000000000000000, update_data=True) 84 #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 85 86 fake_l2esr_2 = IsaFake(pio_addr=0xAB00000040, pio_size=0x8, 87 ret_data64=0x0000000000000000, update_data=True) 88 #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 89 90 fake_l2esr_3 = IsaFake(pio_addr=0xAB00000080, pio_size=0x8, 91 ret_data64=0x0000000000000000, update_data=True) 92 #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 93 94 fake_l2esr_4 = IsaFake(pio_addr=0xAB000000C0, pio_size=0x8, 95 ret_data64=0x0000000000000000, update_data=True) 96 #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 97 98 fake_ssi = IsaFake(pio_addr=0xff00000000, pio_size=0x10000000) 99 #warn_access="Accessing SSI -- Unimplemented!") 100 101 hconsole = SimConsole() 102 hvuart = Uart8250(pio_addr=0xfff0c2c000) 103 htod = DumbTOD() 104 105 pconsole = SimConsole() 106 puart0 = Uart8250(pio_addr=0x1f10000000) 107 108 iob = Iob() 109 # Attach I/O devices that are on chip 110 def attachOnChipIO(self, bus): 111 self.iob.pio = bus.port 112 self.htod.pio = bus.port 113 114 115 # Attach I/O devices to specified bus object. Can't do this 116 # earlier, since the bus object itself is typically defined at the 117 # System level. 118 def attachIO(self, bus): 119 self.hvuart.sim_console = self.hconsole 120 self.puart0.sim_console = self.pconsole 121 self.fake_clk.pio = bus.port 122 self.fake_membnks.pio = bus.port 123 self.fake_l2_1.pio = bus.port 124 self.fake_l2_2.pio = bus.port 125 self.fake_l2_3.pio = bus.port 126 self.fake_l2_4.pio = bus.port 127 self.fake_l2esr_1.pio = bus.port 128 self.fake_l2esr_2.pio = bus.port 129 self.fake_l2esr_3.pio = bus.port 130 self.fake_l2esr_4.pio = bus.port 131 self.fake_ssi.pio = bus.port 132 self.fake_jbi.pio = bus.port 133 self.puart0.pio = bus.port 134 self.hvuart.pio = bus.port 135