Hi all:
I am a newer to GEM5 simulator. I want to get the exact memory data stored in the simulated system. I have noted that there is a function AbstractMemory::access(PacketPtr pkt) in abstract_mem.cc. if (pkt->isRead()) { assert(!pkt->isWrite()); if (pkt->isLLSC()) { trackLoadLocked(pkt); } if (pmemAddr) memcpy(pkt->getPtr<uint8_t>(), hostAddr, pkt->getSize()); TRACE_PACKET(pkt->req->isInstFetch() ? "IFetch" : "Read"); numReads[pkt->req->masterId()]++; bytesRead[pkt->req->masterId()] += pkt->getSize(); if (pkt->req->isInstFetch()) bytesInstRead[pkt->req->masterId()] += pkt->getSize(); } else if (pkt->isWrite()) { if (writeOK(pkt)) { if (pmemAddr) memcpy(hostAddr, pkt->getPtr<uint8_t>(), pkt->getSize()); I guess that, the exact operation of memcpy() is to read (write) data from (into) the memory in case of read (write) operations (indicated by pkt->isWrite()). Am I right here? Regards, Shuchang
_______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users