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);
79 virtual bool isMem()
const {
return false; }
80 virtual bool isIo()
const {
return false; }
126 "Illegal size %d for bar %s.",
_size,
name());
130 bool isIo()
const override {
return true; }
193 "Illegal size %d for bar %s.",
_size,
name());
196 bool isMem()
const override {
return true; }
204 bar.type.wide =
wide() ? 1 : 0;
205 bar.type.reserved = 0;
218 bool wide()
const {
return _wide; }
308 std::array<PciBar *, 6>
BARs{};
322 for (
int i = 0;
i <
BARs.size();
i++) {
324 if (!bar || !bar->range().contains(
addr))
327 offs =
addr - bar->addr();
401 #endif // __DEV_PCI_DEVICE_HH__
PciMemUpperBar(const PciMemUpperBarParams &p)
const int PMCAP_PMCS_OFFSET
virtual bool isMem() const
const PciBusAddr & busAddr() const
PCIConfig config
The current config space.
Addr dmaAddr(Addr addr) const
Calculate the physical address of a prefetchable memory location in the PCI address space.
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Addr memAddr(Addr addr) const
Calculate the physical address of a non-prefetchable memory location in the PCI address space.
const int PMCAP_BASE
The capability list structures and base addresses.
std::vector< MSIXPbaEntry > msix_pba
PciBarNone(const PciBarNoneParams &p)
uint8_t interruptLine() const
const int MSIXCAP_MXC_OFFSET
bool isIo() const override
const int MSIXCAP_ID_OFFSET
static constexpr bool isPowerOf2(const T &n)
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
void lower(PciMemBar *val)
PciLegacyIoBar(const PciLegacyIoBarParams &p)
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
Addr pioAddr(Addr addr) const
Calculate the physical address of an IO location on the PCI bus.
virtual bool isIo() const
EndSubBitUnion(type) Bitfield< 0 > io
virtual std::string name() const
const Params & params() const
SubBitUnion(type, 2, 1) Bitfield< 2 > wide
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void clearInt()
Clear a posted PCI interrupt.
virtual uint32_t write(const PciHost::DeviceInterface &host, uint32_t val)=0
uint64_t Tick
Tick count type.
std::array< PciBar *, 6 > BARs
Callback interface from PCI devices to the host.
const int PMCAP_PC_OFFSET
PCI device, base implementation is only config space.
void postInt()
Post a PCI interrupt to the CPU.
bool getBAR(Addr addr, int &num, Addr &offs)
Which base address register (if any) maps the given address?
BitUnion32(Bar) Bitfield< 31
PciHost::DeviceInterface hostInterface
Abstract superclass for simulation objects.
PciBar(const PciBarParams &p)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const int PMCAP_ID_OFFSET
const int MSIXCAP_MTAB_OFFSET
void upper(const PciHost::DeviceInterface &host, uint32_t val)
const PciBusAddr _busAddr
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
BitUnion32(Bar) Bitfield< 31
bool isMem() const override
std::ostream CheckpointOut
EndBitUnion(Bar) bool _wide
const int MSIXCAP_MPBA_OFFSET
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Addr pciToDma(Addr pci_addr) const
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint32_t write(const PciHost::DeviceInterface &host, uint32_t val) override
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
std::vector< MSIXTable > msix_table
MSIX Table and PBA Structures.
PciDevice(const PciDeviceParams ¶ms)
Constructor for PCI Dev.
Generated on Sun Jul 30 2023 01:56:52 for gem5 by doxygen 1.8.17