PciDevice.py revision 1990
1from m5 import *
2from Device import FooPioDevice, DmaDevice
3
4class PciConfigData(SimObject):
5    type = 'PciConfigData'
6    VendorID = Param.UInt16("Vendor ID")
7    DeviceID = Param.UInt16("Device ID")
8    Command = Param.UInt16(0, "Command")
9    Status = Param.UInt16(0, "Status")
10    Revision = Param.UInt8(0, "Device")
11    ProgIF = Param.UInt8(0, "Programming Interface")
12    SubClassCode = Param.UInt8(0, "Sub-Class Code")
13    ClassCode = Param.UInt8(0, "Class Code")
14    CacheLineSize = Param.UInt8(0, "System Cacheline Size")
15    LatencyTimer = Param.UInt8(0, "PCI Latency Timer")
16    HeaderType = Param.UInt8(0, "PCI Header Type")
17    BIST = Param.UInt8(0, "Built In Self Test")
18
19    BAR0 = Param.UInt32(0x00, "Base Address Register 0")
20    BAR1 = Param.UInt32(0x00, "Base Address Register 1")
21    BAR2 = Param.UInt32(0x00, "Base Address Register 2")
22    BAR3 = Param.UInt32(0x00, "Base Address Register 3")
23    BAR4 = Param.UInt32(0x00, "Base Address Register 4")
24    BAR5 = Param.UInt32(0x00, "Base Address Register 5")
25    BAR0Size = Param.MemorySize32('0B', "Base Address Register 0 Size")
26    BAR1Size = Param.MemorySize32('0B', "Base Address Register 1 Size")
27    BAR2Size = Param.MemorySize32('0B', "Base Address Register 2 Size")
28    BAR3Size = Param.MemorySize32('0B', "Base Address Register 3 Size")
29    BAR4Size = Param.MemorySize32('0B', "Base Address Register 4 Size")
30    BAR5Size = Param.MemorySize32('0B', "Base Address Register 5 Size")
31
32    CardbusCIS = Param.UInt32(0x00, "Cardbus Card Information Structure")
33    SubsystemID = Param.UInt16(0x00, "Subsystem ID")
34    SubsystemVendorID = Param.UInt16(0x00, "Subsystem Vendor ID")
35    ExpansionROM = Param.UInt32(0x00, "Expansion ROM Base Address")
36    InterruptLine = Param.UInt8(0x00, "Interrupt Line")
37    InterruptPin = Param.UInt8(0x00, "Interrupt Pin")
38    MaximumLatency = Param.UInt8(0x00, "Maximum Latency")
39    MinimumGrant = Param.UInt8(0x00, "Minimum Grant")
40
41class PciConfigAll(FooPioDevice):
42    type = 'PciConfigAll'
43
44class PciDevice(DmaDevice):
45    type = 'PciDevice'
46    abstract = True
47    addr = 0xffffffffL
48    pci_bus = Param.Int("PCI bus")
49    pci_dev = Param.Int("PCI device number")
50    pci_func = Param.Int("PCI function code")
51    configdata = Param.PciConfigData(Parent.any, "PCI Config data")
52    configspace = Param.PciConfigAll(Parent.any, "PCI Configspace")
53
54class PciFake(PciDevice):
55    type = 'PciFake'
56