X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmem%2Ftport.cc;h=4de495e22f6d376ea65b547437ebc95384d70a0a;hb=abd33d6fd26bb69d3bf53ceb6c2dc8f90d893e34;hp=db2c72bbc64016fe5e037d0160b60163550a331d;hpb=f9d403a7b95c50a8b75f8442101eb87ca465f967;p=gem5.git diff --git a/src/mem/tport.cc b/src/mem/tport.cc index db2c72bbc..4de495e22 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -41,37 +41,33 @@ * Andreas Hansson */ -#include "mem/mem_object.hh" #include "mem/tport.hh" +#include "sim/sim_object.hh" SimpleTimingPort::SimpleTimingPort(const std::string& _name, - MemObject* _owner) : - QueuedSlavePort(_name, _owner, queue), queue(*_owner, *this) + SimObject* _owner) : + QueuedSlavePort(_name, _owner, queueImpl), queueImpl(*_owner, *this) { } void SimpleTimingPort::recvFunctional(PacketPtr pkt) { - assert(pkt->isRequest()); - if (!queue.checkFunctional(pkt)) { + if (!respQueue.trySatisfyFunctional(pkt)) { // do an atomic access and throw away the returned latency recvAtomic(pkt); } } bool -SimpleTimingPort::recvTiming(PacketPtr pkt) +SimpleTimingPort::recvTimingReq(PacketPtr pkt) { - // the port is a slave and should hence only get timing requests - assert(pkt->isRequest()); - - if (pkt->memInhibitAsserted()) { - // snooper will supply based on copy of packet - // still target's responsibility to delete packet - delete pkt; - return true; - } + // the SimpleTimingPort should not be used anywhere where there is + // a need to deal with snoop responses and their flow control + // requirements + if (pkt->cacheResponding()) + panic("SimpleTimingPort should never see packets with the " + "cacheResponding flag set\n"); bool needsResponse = pkt->needsResponse(); Tick latency = recvAtomic(pkt); @@ -80,9 +76,10 @@ SimpleTimingPort::recvTiming(PacketPtr pkt) // recvAtomic() should already have turned packet into // atomic response assert(pkt->isResponse()); - queue.schedSendTiming(pkt, curTick() + latency); + schedTimingResp(pkt, curTick() + latency); } else { - delete pkt; + // queue the packet for deletion + pendingDelete.reset(pkt); } return true;