Ide.py revision 4486
112027Sjungma@eit.uni-kl.de# Copyright (c) 2005-2007 The Regents of The University of Michigan 212027Sjungma@eit.uni-kl.de# All rights reserved. 312027Sjungma@eit.uni-kl.de# 412027Sjungma@eit.uni-kl.de# Redistribution and use in source and binary forms, with or without 512027Sjungma@eit.uni-kl.de# modification, are permitted provided that the following conditions are 612027Sjungma@eit.uni-kl.de# met: redistributions of source code must retain the above copyright 712027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer; 812027Sjungma@eit.uni-kl.de# redistributions in binary form must reproduce the above copyright 912027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer in the 1012027Sjungma@eit.uni-kl.de# documentation and/or other materials provided with the distribution; 1112027Sjungma@eit.uni-kl.de# neither the name of the copyright holders nor the names of its 1212027Sjungma@eit.uni-kl.de# contributors may be used to endorse or promote products derived from 1312027Sjungma@eit.uni-kl.de# this software without specific prior written permission. 1412027Sjungma@eit.uni-kl.de# 1512027Sjungma@eit.uni-kl.de# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1612027Sjungma@eit.uni-kl.de# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1712027Sjungma@eit.uni-kl.de# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1812027Sjungma@eit.uni-kl.de# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1912027Sjungma@eit.uni-kl.de# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2012027Sjungma@eit.uni-kl.de# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2112027Sjungma@eit.uni-kl.de# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2212027Sjungma@eit.uni-kl.de# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2312027Sjungma@eit.uni-kl.de# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2412027Sjungma@eit.uni-kl.de# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2512027Sjungma@eit.uni-kl.de# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2612027Sjungma@eit.uni-kl.de# 2712027Sjungma@eit.uni-kl.de# Authors: Nathan Binkert 2812027Sjungma@eit.uni-kl.de 2912027Sjungma@eit.uni-kl.defrom m5.SimObject import SimObject 3012027Sjungma@eit.uni-kl.defrom m5.params import * 3112027Sjungma@eit.uni-kl.defrom Pci import PciDevice, PciConfigData 3212027Sjungma@eit.uni-kl.de 3312027Sjungma@eit.uni-kl.declass IdeID(Enum): vals = ['master', 'slave'] 3412027Sjungma@eit.uni-kl.de 3512027Sjungma@eit.uni-kl.declass IdeControllerPciData(PciConfigData): 3612027Sjungma@eit.uni-kl.de VendorID = 0x8086 3712027Sjungma@eit.uni-kl.de DeviceID = 0x7111 3812027Sjungma@eit.uni-kl.de Command = 0x0 3912027Sjungma@eit.uni-kl.de Status = 0x280 4012027Sjungma@eit.uni-kl.de Revision = 0x0 4112027Sjungma@eit.uni-kl.de ClassCode = 0x01 4212027Sjungma@eit.uni-kl.de SubClassCode = 0x01 4312027Sjungma@eit.uni-kl.de ProgIF = 0x85 4412027Sjungma@eit.uni-kl.de BAR0 = 0x00000001 4512027Sjungma@eit.uni-kl.de BAR1 = 0x00000001 4612027Sjungma@eit.uni-kl.de BAR2 = 0x00000001 4712027Sjungma@eit.uni-kl.de BAR3 = 0x00000001 4812027Sjungma@eit.uni-kl.de BAR4 = 0x00000001 4912027Sjungma@eit.uni-kl.de BAR5 = 0x00000001 5012027Sjungma@eit.uni-kl.de InterruptLine = 0x1f 5112027Sjungma@eit.uni-kl.de InterruptPin = 0x01 5212027Sjungma@eit.uni-kl.de BAR0Size = '8B' 5312027Sjungma@eit.uni-kl.de BAR1Size = '4B' 5412027Sjungma@eit.uni-kl.de BAR2Size = '8B' 5512027Sjungma@eit.uni-kl.de BAR3Size = '4B' 5612027Sjungma@eit.uni-kl.de BAR4Size = '16B' 5712027Sjungma@eit.uni-kl.de 5812027Sjungma@eit.uni-kl.declass IdeDisk(SimObject): 5912027Sjungma@eit.uni-kl.de type = 'IdeDisk' 6012027Sjungma@eit.uni-kl.de delay = Param.Latency('1us', "Fixed disk delay in microseconds") 6112027Sjungma@eit.uni-kl.de driveID = Param.IdeID('master', "Drive ID") 6212027Sjungma@eit.uni-kl.de image = Param.DiskImage("Disk image") 6312027Sjungma@eit.uni-kl.de 6412027Sjungma@eit.uni-kl.declass IdeController(PciDevice): 6512027Sjungma@eit.uni-kl.de type = 'IdeController' 6612027Sjungma@eit.uni-kl.de disks = VectorParam.IdeDisk("IDE disks attached to this controller") 6712027Sjungma@eit.uni-kl.de 6812027Sjungma@eit.uni-kl.de configdata =IdeControllerPciData() 6912027Sjungma@eit.uni-kl.de