Go to the documentation of this file.
42 #include "debug/PciHost.hh"
45 #include "params/GenericPciHost.hh"
46 #include "params/PciHost.hh"
60 auto map_entry =
devices.emplace(bus_addr, device);
66 "%02x:%02x.%i: PCI bus ID collision\n",
76 return device !=
devices.end() ? device->second :
nullptr;
83 return device !=
devices.end() ? device->second :
nullptr;
90 busAddr(bus_addr), interruptPin(interrupt_pin)
97 return csprintf(
"%s.interface[%02x:%02x.%i]",
98 host.name(), busAddr.bus, busAddr.dev, busAddr.func);
106 host.postInt(busAddr, interruptPin);
114 host.clearInt(busAddr, interruptPin);
120 platform(*
p->platform),
121 confBase(
p->conf_base), confSize(
p->conf_size),
122 confDeviceBits(
p->conf_device_bits),
123 pciPioBase(
p->pci_pio_base), pciMemBase(
p->pci_mem_base),
124 pciDmaBase(
p->pci_dma_base)
140 dev_addr.first.bus, dev_addr.first.dev, dev_addr.first.func,
150 uint8_t *pkt_data(pkt->
getPtr<uint8_t>());
151 std::fill(pkt_data, pkt_data + size, 0xFF);
163 dev_addr.first.bus, dev_addr.first.dev, dev_addr.first.func,
169 "%02x:%02x.%i: Write to config space on non-existent PCI device\n",
170 dev_addr.first.bus, dev_addr.first.dev, dev_addr.first.func);
190 return std::make_pair(
192 bits(bus_addr, 7, 3),
193 bits(bus_addr, 2, 0)),
222 GenericPciHostParams::create()
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
GenericPciHost(const GenericPciHostParams *p)
void postInt(const PciBusAddr &addr, PciIntPin pin) override
Post an interrupt to the CPU.
PciDevice * getDevice(const PciBusAddr &addr)
Retrieve a PCI device from its bus address.
void makeAtomicResponse()
void postInt()
Post a PCI interrupt to the CPU.
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
Callback interface from PCI devices to the host.
uint8_t interruptLine() const
uint64_t Tick
Tick count type.
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
void clearInt(const PciBusAddr &addr, PciIntPin pin) override
Post an interrupt to the CPU.
std::map< PciBusAddr, PciDevice * > devices
Currently registered PCI devices.
This device is the base class which all devices senstive to an address range inherit from.
void clearInt()
Clear a posted PCI interrupt.
PciHost(const PciHostParams *p)
std::list< AddrRange > AddrRangeList
Convenience typedef for a collection of address ranges.
AddrRange RangeSize(Addr start, Addr size)
Configurable generic PCI host interface.
const std::string name() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual DeviceInterface registerDevice(PciDevice *device, PciBusAddr bus_addr, PciIntPin pin)
Register a PCI device with the host.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual ~GenericPciHost()
const uint8_t confDeviceBits
T * getPtr()
get a pointer to the data ptr.
virtual std::pair< PciBusAddr, Addr > decodeAddress(Addr address)
Decode a configuration space address.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
The PCI host describes the interface between PCI devices and a simulated system.
std::string csprintf(const char *format, const Args &...args)
virtual uint32_t mapPciInterrupt(const PciBusAddr &bus_addr, PciIntPin pin) const
PCI device, base implementation is only config space.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17