From adde4c91f99fa99abbdd23cf97c45de020429d2d Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Mon, 15 Oct 2018 11:48:32 +0200 Subject: mem: Use Packet writing functions instead of memcpy Classes were using memcpy instead of the Packet functions created for writing to/from the packet. This allows these writes to be better checked and tracked. This also fixes a bug in MemCheckerMonitor, which was using the incorrect type for the packet pointer. Change-Id: I5bbc8a24e59464e8219bb6d54af8209e6d4ee1af Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/13695 Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris --- src/mem/cache/base.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mem/cache') diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc index 6f3914ccd..a7c210697 100644 --- a/src/mem/cache/base.cc +++ b/src/mem/cache/base.cc @@ -861,10 +861,9 @@ BaseCache::satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool, bool) if (pkt->isAtomicOp()) { // extract data from cache and save it into the data field in // the packet as a return value from this atomic op - int offset = tags->extractBlkOffset(pkt->getAddr()); uint8_t *blk_data = blk->data + offset; - std::memcpy(pkt->getPtr(), blk_data, pkt->getSize()); + pkt->setData(blk_data); // execute AMO operation (*(pkt->getAtomicOp()))(blk_data); -- cgit v1.2.3