Go to the documentation of this file.
36 #include "debug/AMDGPUDevice.hh"
39 #include "params/AMDGPUDevice.hh"
47 :
PciDevice(
p), checkpoint_before_mmios(
p.checkpoint_before_mmios),
48 init_interrupt_count(0)
52 romBin.open(
p.rom_binary, std::ios::binary);
62 if (
p.trace_file !=
"") {
71 uint64_t rom_data = 0;
73 memcpy(&rom_data,
rom.data() + rom_offset, pkt->
getSize());
74 pkt->
setUintX(rom_data, ByteOrder::little);
77 pkt->
getAddr(), rom_offset, rom_data);
90 for (
auto &
r : ranges) {
92 ret_ranges.push_back(
r);
224 panic(
"Request with address out of mapped range!");
250 panic(
"Request with address out of mapped range!");
Tick curTick()
The universal simulation clock.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
std::unordered_map< uint32_t, uint64_t > regs
Device registers - Maps register address to register value.
bool isROM(Addr addr) const
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
PCIConfig config
The current config space.
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
AddrRange RangeSize(Addr start, Addr size)
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
constexpr int DOORBELL_BAR
void writeFromTrace(PacketPtr pkt, int barnum, Addr offset)
Get the next MMIO write from the trace file to an offset in a BAR and compare the value with the data...
constexpr int FRAMEBUFFER_BAR
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void readMMIOTrace(std::string trace_file)
Read an MMIO trace gathered from a real system and place the MMIO values read and written into the MM...
void makeAtomicResponse()
Tick readConfig(PacketPtr pkt) override
Read from the PCI config space data that is stored locally.
void writeMMIO(PacketPtr pkt, Addr offset)
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
AMDGPUDevice(const AMDGPUDeviceParams &p)
Tick writeConfig(PacketPtr pkt) override
Write to the PCI config space data that is stored locally.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t Tick
Tick count type.
AMDMMIOReader mmioReader
MMIO reader to populate device registers map.
PCI device, base implementation is only config space.
bool checkpoint_before_mmios
void readROM(PacketPtr pkt)
bool getBAR(Addr addr, int &num, Addr &offs)
Which base address register (if any) maps the given address?
Device model for an AMD GPU.
void serialize(CheckpointOut &cp) const override
Checkpoint support.
void dispatchAccess(PacketPtr pkt, bool read)
Convert a PCI packet into a response.
void readFrame(PacketPtr pkt, Addr offset)
Helper methods to handle specific BAR read/writes.
void readDoorbell(PacketPtr pkt, Addr offset)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
constexpr uint32_t ROM_SIZE
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
constexpr uint32_t VGA_ROM_DEFAULT
void readFromTrace(PacketPtr pkt, int barnum, Addr offset)
Get the next MMIO read from the trace file to an offset in a BAR and write the value to the packet pr...
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
void readMMIO(PacketPtr pkt, Addr offset)
AddrRange romRange
VGA ROM methods.
virtual Tick read(PacketPtr pkt)=0
Pure virtual function that the device must implement.
std::array< uint8_t, ROM_SIZE > rom
std::ostream CheckpointOut
void writeFrame(PacketPtr pkt, Addr offset)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
#define panic(...)
This implements a cprintf based panic() function.
#define PCI0_INTERRUPT_PIN
void writeDoorbell(PacketPtr pkt, Addr offset)
Generated on Tue Feb 8 2022 11:47:05 for gem5 by doxygen 1.8.17