T1000.py revision 8847
14486Sbinkertn@umich.edu# Copyright (c) 2006-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: Gabe Black 284486Sbinkertn@umich.edu 293630SN/Afrom m5.params import * 303630SN/Afrom m5.proxy import * 314104SN/Afrom Device import BasicPioDevice, PioDevice, IsaFake, BadAddr 325478Snate@binkert.orgfrom Platform import Platform 335478Snate@binkert.orgfrom Terminal import Terminal 343743SN/Afrom Uart import Uart8250 353630SN/A 363898SN/A 373898SN/Aclass MmDisk(BasicPioDevice): 383898SN/A type = 'MmDisk' 393898SN/A image = Param.DiskImage("Disk Image") 403898SN/A pio_addr = 0x1F40000000 413898SN/A 423914SN/Aclass DumbTOD(BasicPioDevice): 433914SN/A type = 'DumbTOD' 443914SN/A time = Param.Time('01/01/2009', "System time to use ('Now' for real time)") 453914SN/A pio_addr = 0xfff0c1fff8 463914SN/A 474104SN/Aclass Iob(PioDevice): 484104SN/A type = 'Iob' 498742Sgblack@eecs.umich.edu platform = Param.Platform(Parent.any, "Platform this device is part of.") 504104SN/A pio_latency = Param.Latency('1ns', "Programed IO latency in simticks") 514104SN/A 523914SN/A 533630SN/Aclass T1000(Platform): 543630SN/A type = 'T1000' 553630SN/A system = Param.System(Parent.any, "system") 563630SN/A 574007SN/A fake_clk = IsaFake(pio_addr=0x9600000000, pio_size=0x100000000) 584007SN/A #warn_access="Accessing Clock Unit -- Unimplemented!") 593630SN/A 603814SN/A fake_membnks = IsaFake(pio_addr=0x9700000000, pio_size=16384, 614007SN/A ret_data64=0x0000000000000000, update_data=False) 624007SN/A #warn_access="Accessing Memory Banks -- Unimplemented!") 633814SN/A 644007SN/A fake_jbi = IsaFake(pio_addr=0x8000000000, pio_size=0x100000000) 654007SN/A #warn_access="Accessing JBI -- Unimplemented!") 663814SN/A 673814SN/A fake_l2_1 = IsaFake(pio_addr=0xA900000000, pio_size=0x8, 684007SN/A ret_data64=0x0000000000000001, update_data=True) 694007SN/A #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 703814SN/A 713814SN/A fake_l2_2 = IsaFake(pio_addr=0xA900000040, pio_size=0x8, 724007SN/A ret_data64=0x0000000000000001, update_data=True) 734007SN/A #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 743814SN/A 753814SN/A fake_l2_3 = IsaFake(pio_addr=0xA900000080, pio_size=0x8, 764007SN/A ret_data64=0x0000000000000001, update_data=True) 774007SN/A #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 783814SN/A 793814SN/A fake_l2_4 = IsaFake(pio_addr=0xA9000000C0, pio_size=0x8, 804007SN/A ret_data64=0x0000000000000001, update_data=True) 814007SN/A #warn_access="Accessing L2 Cache Banks -- Unimplemented!") 823814SN/A 833825SN/A fake_l2esr_1 = IsaFake(pio_addr=0xAB00000000, pio_size=0x8, 844007SN/A ret_data64=0x0000000000000000, update_data=True) 854007SN/A #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 863825SN/A 873825SN/A fake_l2esr_2 = IsaFake(pio_addr=0xAB00000040, pio_size=0x8, 884007SN/A ret_data64=0x0000000000000000, update_data=True) 894007SN/A #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 903825SN/A 913825SN/A fake_l2esr_3 = IsaFake(pio_addr=0xAB00000080, pio_size=0x8, 924007SN/A ret_data64=0x0000000000000000, update_data=True) 934007SN/A #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 943825SN/A 953825SN/A fake_l2esr_4 = IsaFake(pio_addr=0xAB000000C0, pio_size=0x8, 964007SN/A ret_data64=0x0000000000000000, update_data=True) 974007SN/A #warn_access="Accessing L2 ESR Cache Banks -- Unimplemented!") 983825SN/A 994007SN/A fake_ssi = IsaFake(pio_addr=0xff00000000, pio_size=0x10000000) 1004007SN/A #warn_access="Accessing SSI -- Unimplemented!") 1013814SN/A 1025478Snate@binkert.org hterm = Terminal() 1033814SN/A hvuart = Uart8250(pio_addr=0xfff0c2c000) 1043914SN/A htod = DumbTOD() 1053914SN/A 1065478Snate@binkert.org pterm = Terminal() 1073814SN/A puart0 = Uart8250(pio_addr=0x1f10000000) 1083630SN/A 1094104SN/A iob = Iob() 1104104SN/A # Attach I/O devices that are on chip 1114104SN/A def attachOnChipIO(self, bus): 1128847Sandreas.hansson@arm.com self.iob.pio = bus.master 1138847Sandreas.hansson@arm.com self.htod.pio = bus.master 1144104SN/A 1154104SN/A 1163630SN/A # Attach I/O devices to specified bus object. Can't do this 1173630SN/A # earlier, since the bus object itself is typically defined at the 1183630SN/A # System level. 1193630SN/A def attachIO(self, bus): 1205478Snate@binkert.org self.hvuart.terminal = self.hterm 1215478Snate@binkert.org self.puart0.terminal = self.pterm 1228847Sandreas.hansson@arm.com self.fake_clk.pio = bus.master 1238847Sandreas.hansson@arm.com self.fake_membnks.pio = bus.master 1248847Sandreas.hansson@arm.com self.fake_l2_1.pio = bus.master 1258847Sandreas.hansson@arm.com self.fake_l2_2.pio = bus.master 1268847Sandreas.hansson@arm.com self.fake_l2_3.pio = bus.master 1278847Sandreas.hansson@arm.com self.fake_l2_4.pio = bus.master 1288847Sandreas.hansson@arm.com self.fake_l2esr_1.pio = bus.master 1298847Sandreas.hansson@arm.com self.fake_l2esr_2.pio = bus.master 1308847Sandreas.hansson@arm.com self.fake_l2esr_3.pio = bus.master 1318847Sandreas.hansson@arm.com self.fake_l2esr_4.pio = bus.master 1328847Sandreas.hansson@arm.com self.fake_ssi.pio = bus.master 1338847Sandreas.hansson@arm.com self.fake_jbi.pio = bus.master 1348847Sandreas.hansson@arm.com self.puart0.pio = bus.master 1358847Sandreas.hansson@arm.com self.hvuart.pio = bus.master 136