Go to the documentation of this file.
38 #include "debug/AMDGPUMem.hh"
39 #include "params/AMDGPUMemoryManager.hh"
47 cacheLineSize(
p.
system->cacheLineSize()),
48 _requestorId(
p.
system->getRequestorId(this))
62 std::forward_as_tuple(
requestId), std::tuple<>{});
72 uint8_t *dataPtr =
new uint8_t[gen.
size()];
73 std::memcpy(dataPtr,
data + (gen.
complete()/
sizeof(uint8_t)),
85 DPRINTF(AMDGPUMem,
"Request to %#lx needs retry\n", gen.
addr());
88 DPRINTF(AMDGPUMem,
"Write request to %#lx sent\n", gen.
addr());
100 uint8_t *dataPtr =
data;
106 std::forward_as_tuple(
requestId), std::tuple<>{});
117 dataPtr += gen.
size();
127 DPRINTF(AMDGPUMem,
"Request to %#lx needs retry\n", gen.
addr());
130 DPRINTF(AMDGPUMem,
"Read request to %#lx sent\n", gen.
addr());
149 assert(
status.outstandingChunks != 0);
150 status.outstandingChunks--;
151 DPRINTF(AMDGPUMem,
"Received Response for %#x. %d chunks remain, sent "
152 "last = %d, requestId = %ld\n", sender_state->
_addr,
156 if (!
status.outstandingChunks &&
status.sentLastChunk) {
159 DPRINTF(AMDGPUMem,
"Calling callback for request %ld\n",
164 DPRINTF(AMDGPUMem,
"Deleting status for request %ld\n",
177 for (
const auto &pkt : retries) {
178 if (!sendTimingReq(pkt)) {
181 DPRINTF(AMDGPUMem,
"Retry for %#lx sent\n", pkt->getAddr());
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
bool next()
Advance generator to next chunk.
Addr complete() const
Number of bytes we have already chunked up.
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
void readRequest(Addr addr, uint8_t *data, int size, Request::Flags flag, Event *callback)
Read size amount of data from device memory at addr using flags and callback.
void writeRequest(Addr addr, uint8_t *data, int size, Request::Flags flag, Event *callback)
Write size amount of data to device memory at addr using flags and callback.
static PacketPtr createWrite(const RequestPtr &req)
AMDGPUMemoryManager(const AMDGPUMemoryManagerParams &p)
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
std::string csprintf(const char *format, const Args &...args)
bool last() const
Is this the last chunk?
Addr size() const
Return size in bytes of current chunk.
This class takes an arbitrary memory region (address/length pair) and generates a series of appropria...
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
bool done() const
Are we done? That is, did the last call to next() advance past the end of the region?
const RequestorID _requestorId
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::deque< PacketPtr > retries
AMDGPUMemoryManager & gpu_mem
std::shared_ptr< Request > RequestPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
SenderState * senderState
This packet's sender state.
const std::string & name()
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
std::unordered_map< uint64_t, RequestStatus > requestStatus
Addr addr() const
Return starting address of current chunk.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
Generated on Sun Jul 30 2023 01:56:54 for gem5 by doxygen 1.8.17