34#include "debug/AMDGPUSystemHub.hh"
66 Event *callback = deferredReq.second;
78 pkt->
getPtr<uint8_t>(), 0, 0, delay);
86 pkt->
getPtr<uint8_t>(), 0, 0, delay);
95 pkt->
getPtr<uint8_t>(), 0, 0, delay);
111 assert(frontPkt.first == donePkt);
126 " %#lx size %d\n", nextPkt.first->getAddr(),
127 nextPkt.first->getSize());
140 : systemHub(_hub), callback(_callback), pkt(_pkt)
150 pkt->getAddr(), pkt->getSize());
152 systemHub.sendNextRequest(pkt->getAddr(), pkt);
159 : systemHub(_hub), callback(_callback), pkt(_pkt)
174 std::make_shared<Request>(pkt->getAddr(), pkt->getSize(), 0,
178 uint8_t *write_data =
new uint8_t[pkt->getSize()];
179 std::memcpy(write_data, pkt->getPtr<uint8_t>(), pkt->getSize());
184 assert(pkt->isAtomicOp());
185 (*pkt->getAtomicOp())(write_pkt->
getPtr<uint8_t>());
190 dmaRespEvent, write_pkt->
getPtr<uint8_t>(), 0, 0, delay);
194 [[maybe_unused]] uint64_t req_data = 0x12345678;
195 if (write_pkt->
getSize() == 8) {
196 req_data = write_pkt->
getLE<uint64_t>();
197 }
else if (pkt->getSize() == 4) {
198 req_data = write_pkt->
getLE<uint32_t>();
AtomicResponseEvent(AMDGPUSystemHub &_hub, Event *_callback, PacketPtr _pkt)
ResponseEvent(AMDGPUSystemHub &_hub, Event *_callback, PacketPtr _pkt)
This class handles reads from the system/host memory space from the shader.
void sendRequest(PacketPtr pkt, Event *callback)
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
void sendDeferredRequest(DeferredReq &deferredReq)
void dmaResponse(PacketPtr pkt)
void sendNextRequest(Addr addr, const PacketPtr donePkt)
std::unordered_map< Addr, DeferredReqList > outstandingReqs
void dmaWrite(Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
void dmaRead(Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
static const FlagsType AutoDelete
void setFlags(Flags _flags)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
static PacketPtr createWrite(const RequestPtr &req)
T * getPtr()
get a pointer to the data ptr.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< Request > RequestPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.