PciDevice.py revision 5834
1955SN/A# Copyright (c) 2005-2007 The Regents of The University of Michigan
2955SN/A# All rights reserved.
31762SN/A#
4955SN/A# Redistribution and use in source and binary forms, with or without
5955SN/A# modification, are permitted provided that the following conditions are
6955SN/A# met: redistributions of source code must retain the above copyright
7955SN/A# notice, this list of conditions and the following disclaimer;
8955SN/A# redistributions in binary form must reproduce the above copyright
9955SN/A# notice, this list of conditions and the following disclaimer in the
10955SN/A# documentation and/or other materials provided with the distribution;
11955SN/A# neither the name of the copyright holders nor the names of its
12955SN/A# contributors may be used to endorse or promote products derived from
13955SN/A# this software without specific prior written permission.
14955SN/A#
15955SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16955SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17955SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18955SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19955SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20955SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21955SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22955SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23955SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24955SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25955SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26955SN/A#
27955SN/A# Authors: Nathan Binkert
282665Ssaidi@eecs.umich.edu
294762Snate@binkert.orgfrom m5.SimObject import SimObject
30955SN/Afrom m5.params import *
315522Snate@binkert.orgfrom m5.proxy import *
324762Snate@binkert.orgfrom Device import BasicPioDevice, DmaDevice, PioDevice
335522Snate@binkert.org
34955SN/Aclass PciConfigAll(PioDevice):
355522Snate@binkert.org    type = 'PciConfigAll'
36955SN/A    pio_latency = Param.Tick(1, "Programmed IO latency in simticks")
375522Snate@binkert.org    bus = Param.UInt8(0x00, "PCI bus to act as config space for")
384202Sbinkertn@umich.edu    size = Param.MemorySize32('16MB', "Size of config space")
395342Sstever@gmail.com
40955SN/A
414381Sbinkertn@umich.educlass PciDevice(DmaDevice):
424381Sbinkertn@umich.edu    type = 'PciDevice'
43955SN/A    abstract = True
44955SN/A    config = Port(Self.pio.peerObj.port, "PCI configuration space port")
45955SN/A    pci_bus = Param.Int("PCI bus")
464202Sbinkertn@umich.edu    pci_dev = Param.Int("PCI device number")
47955SN/A    pci_func = Param.Int("PCI function code")
484382Sbinkertn@umich.edu    pio_latency = Param.Latency('1ns', "Programmed IO latency in simticks")
494382Sbinkertn@umich.edu    config_latency = Param.Latency('20ns', "Config read or write latency")
504382Sbinkertn@umich.edu
515517Snate@binkert.org    VendorID = Param.UInt16("Vendor ID")
525517Snate@binkert.org    DeviceID = Param.UInt16("Device ID")
534762Snate@binkert.org    Command = Param.UInt16(0, "Command")
544762Snate@binkert.org    Status = Param.UInt16(0, "Status")
554762Snate@binkert.org    Revision = Param.UInt8(0, "Device")
564762Snate@binkert.org    ProgIF = Param.UInt8(0, "Programming Interface")
574762Snate@binkert.org    SubClassCode = Param.UInt8(0, "Sub-Class Code")
584762Snate@binkert.org    ClassCode = Param.UInt8(0, "Class Code")
594762Snate@binkert.org    CacheLineSize = Param.UInt8(0, "System Cacheline Size")
604762Snate@binkert.org    LatencyTimer = Param.UInt8(0, "PCI Latency Timer")
614762Snate@binkert.org    HeaderType = Param.UInt8(0, "PCI Header Type")
624762Snate@binkert.org    BIST = Param.UInt8(0, "Built In Self Test")
635522Snate@binkert.org
644762Snate@binkert.org    BAR0 = Param.UInt32(0x00, "Base Address Register 0")
654762Snate@binkert.org    BAR1 = Param.UInt32(0x00, "Base Address Register 1")
664762Snate@binkert.org    BAR2 = Param.UInt32(0x00, "Base Address Register 2")
674762Snate@binkert.org    BAR3 = Param.UInt32(0x00, "Base Address Register 3")
684762Snate@binkert.org    BAR4 = Param.UInt32(0x00, "Base Address Register 4")
695522Snate@binkert.org    BAR5 = Param.UInt32(0x00, "Base Address Register 5")
705522Snate@binkert.org    BAR0Size = Param.MemorySize32('0B', "Base Address Register 0 Size")
715522Snate@binkert.org    BAR1Size = Param.MemorySize32('0B', "Base Address Register 1 Size")
725522Snate@binkert.org    BAR2Size = Param.MemorySize32('0B', "Base Address Register 2 Size")
734762Snate@binkert.org    BAR3Size = Param.MemorySize32('0B', "Base Address Register 3 Size")
744762Snate@binkert.org    BAR4Size = Param.MemorySize32('0B', "Base Address Register 4 Size")
754762Snate@binkert.org    BAR5Size = Param.MemorySize32('0B', "Base Address Register 5 Size")
764762Snate@binkert.org    BAR0LegacyIO = Param.Bool(False, "Whether BAR0 is hardwired legacy IO")
774762Snate@binkert.org    BAR1LegacyIO = Param.Bool(False, "Whether BAR1 is hardwired legacy IO")
785522Snate@binkert.org    BAR2LegacyIO = Param.Bool(False, "Whether BAR2 is hardwired legacy IO")
794762Snate@binkert.org    BAR3LegacyIO = Param.Bool(False, "Whether BAR3 is hardwired legacy IO")
804762Snate@binkert.org    BAR4LegacyIO = Param.Bool(False, "Whether BAR4 is hardwired legacy IO")
815522Snate@binkert.org    BAR5LegacyIO = Param.Bool(False, "Whether BAR5 is hardwired legacy IO")
825522Snate@binkert.org
834762Snate@binkert.org    CardbusCIS = Param.UInt32(0x00, "Cardbus Card Information Structure")
844762Snate@binkert.org    SubsystemID = Param.UInt16(0x00, "Subsystem ID")
854762Snate@binkert.org    SubsystemVendorID = Param.UInt16(0x00, "Subsystem Vendor ID")
864762Snate@binkert.org    ExpansionROM = Param.UInt32(0x00, "Expansion ROM Base Address")
874762Snate@binkert.org    InterruptLine = Param.UInt8(0x00, "Interrupt Line")
884762Snate@binkert.org    InterruptPin = Param.UInt8(0x00, "Interrupt Pin")
895522Snate@binkert.org    MaximumLatency = Param.UInt8(0x00, "Maximum Latency")
905522Snate@binkert.org    MinimumGrant = Param.UInt8(0x00, "Minimum Grant")
915522Snate@binkert.org
924762Snate@binkert.org
934382Sbinkertn@umich.edu