From ee0b52404c99cfed91a8d3fbebe3f42b0ac133df Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 11 Feb 2015 10:48:50 -0800 Subject: mem: restructure Packet cmd initialization a bit more Refactor the way that specific MemCmd values are generated for packets. The new approach is a little more elegant in that we assign the right value up front, and it's also more amenable to non-heap-allocated Packet objects. Also replaced the code in the Minor model that was still doing it the ad-hoc way. This is basically a refinement of http://repo.gem5.org/gem5/rev/711eb0e64249. --- src/cpu/simple/atomic.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/cpu/simple') diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index b564521ba..007621feb 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -341,8 +341,7 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, // Now do the access. if (fault == NoFault && !req->getFlags().isSet(Request::NO_ACCESS)) { - Packet pkt(req, MemCmd::ReadReq); - pkt.refineCommand(); + Packet pkt(req, Packet::makeReadCmd(req)); pkt.dataStatic(data); if (req->isMmappedIpr()) -- cgit v1.2.3