Go to the documentation of this file.
45 #ifndef __DEV_PCI_DEVICE_HH__
46 #define __DEV_PCI_DEVICE_HH__
55 #include "params/PciBar.hh"
56 #include "params/PciBarNone.hh"
57 #include "params/PciDevice.hh"
58 #include "params/PciIoBar.hh"
59 #include "params/PciLegacyIoBar.hh"
60 #include "params/PciMemBar.hh"
61 #include "params/PciMemUpperBar.hh"
64 #define BAR_NUMBER(x) (((x) - PCI0_BASE_ADDR0) >> 0x2);
76 virtual bool isMem()
const {
return false; }
77 virtual bool isIo()
const {
return false; }
123 "Illegal size %d for bar %s.",
_size,
name());
127 bool isIo()
const override {
return true; }
190 "Illegal size %d for bar %s.",
_size,
name());
193 bool isMem()
const override {
return true; }
201 bar.type.wide =
wide() ? 1 : 0;
202 bar.type.reserved = 0;
215 bool wide()
const {
return _wide; }
305 std::array<PciBar *, 6>
BARs{};
319 for (
int i = 0;
i <
BARs.size();
i++) {
321 if (!bar || !bar->range().contains(
addr))
324 offs =
addr - bar->addr();
395 #endif // __DEV_PCI_DEVICE_HH__
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
void postInt()
Post a PCI interrupt to the CPU.
std::array< PciBar *, 6 > BARs
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
bool isIo() const override
EndSubBitUnion(type) Bitfield< 0 > io
const int PMCAP_PC_OFFSET
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
Callback interface from PCI devices to the host.
BitUnion32(Bar) Bitfield< 31
uint8_t interruptLine() const
uint64_t Tick
Tick count type.
PciMemUpperBar(const PciMemUpperBarParams &p)
PCIConfig config
The current config space.
const PciBusAddr _busAddr
PciLegacyIoBar(const PciLegacyIoBarParams &p)
SubBitUnion(type, 2, 1) Bitfield< 2 > wide
std::vector< MSIXPbaEntry > msix_pba
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
const int MSIXCAP_MTAB_OFFSET
const int PMCAP_PMCS_OFFSET
PciHost::DeviceInterface hostInterface
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
void clearInt()
Clear a posted PCI interrupt.
const PciBusAddr & busAddr() const
Addr memAddr(Addr addr) const
Calculate the physical address of a non-prefetchable memory location in the PCI address space.
Addr pioAddr(Addr addr) const
Calculate the physical address of an IO location on the PCI bus.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
EndBitUnion(Bar) bool _wide
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
const int PMCAP_BASE
The capability list structures and base addresses.
virtual bool isIo() const
bool isMem() const override
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const int MSIXCAP_MXC_OFFSET
PciDevice(const PciDeviceParams ¶ms)
Constructor for PCI Dev.
void upper(const PciHost::DeviceInterface &host, uint32_t val)
virtual const std::string name() const
PciBarNone(const PciBarNoneParams &p)
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
std::vector< MSIXTable > msix_table
MSIX Table and PBA Structures.
PciBar(const PciBarParams &p)
virtual uint32_t write(const PciHost::DeviceInterface &host, uint32_t val)=0
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
BitUnion32(Bar) Bitfield< 31
virtual bool isMem() const
std::ostream CheckpointOut
const int MSIXCAP_MPBA_OFFSET
const Params & params() const
const int PMCAP_ID_OFFSET
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
const int MSIXCAP_ID_OFFSET
bool isPowerOf2(const T &n)
Addr dmaAddr(Addr addr) const
Calculate the physical address of a prefetchable memory location in the PCI address space.
PCI device, base implementation is only config space.
Addr pciToDma(Addr pci_addr) const
void lower(PciMemBar *val)
bool getBAR(Addr addr, int &num, Addr &offs)
Which base address register (if any) maps the given address?
Abstract superclass for simulation objects.
Generated on Tue Mar 23 2021 19:41:24 for gem5 by doxygen 1.8.17