changeset 7f4059e4f2d5 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=7f4059e4f2d5
description:
mem: Packet queue clean up
No change in functionality, just a bit of tidying up.
diffstat:
src/mem/packet_queue.cc | 20 +++++++-------------
src/mem/packet_queue.hh | 5 ++---
2 files changed, 9 insertions(+), 16 deletions(-)
diffs (84 lines):
diff -r 72890a571a7b -r 7f4059e4f2d5 src/mem/packet_queue.cc
--- a/src/mem/packet_queue.cc Wed Sep 03 07:42:27 2014 -0400
+++ b/src/mem/packet_queue.cc Wed Sep 03 07:42:28 2014 -0400
@@ -71,11 +71,10 @@
{
pkt->pushLabel(label);
- DeferredPacketIterator i = transmitList.begin();
- DeferredPacketIterator end = transmitList.end();
+ auto i = transmitList.begin();
bool found = false;
- while (!found && i != end) {
+ while (!found && i != transmitList.end()) {
// If the buffered packet contains data, and it overlaps the
// current packet, then update data
found = pkt->checkFunctional(i->pkt);
@@ -140,7 +139,7 @@
}
// this belongs in the middle somewhere, insertion sort
- DeferredPacketIterator i = transmitList.begin();
+ auto i = transmitList.begin();
++i; // already checked for insertion at front
while (i != transmitList.end() && when >= i->tick)
++i;
@@ -151,21 +150,16 @@
{
assert(deferredPacketReady());
- // take the next packet off the list here, as we might return to
- // ourselves through the sendTiming call below
DeferredPacket dp = transmitList.front();
- transmitList.pop_front();
// use the appropriate implementation of sendTiming based on the
// type of port associated with the queue, and whether the packet
// is to be sent as a snoop or not
waitingOnRetry = !sendTiming(dp.pkt, dp.sendAsSnoop);
- if (waitingOnRetry) {
- // put the packet back at the front of the list (packet should
- // not have changed since it wasn't accepted)
- assert(!sendEvent.scheduled());
- transmitList.push_front(dp);
+ if (!waitingOnRetry) {
+ // take the packet off the list
+ transmitList.pop_front();
}
}
@@ -216,7 +210,7 @@
unsigned int
PacketQueue::drain(DrainManager *dm)
{
- if (transmitList.empty() && !sendEvent.scheduled())
+ if (transmitList.empty())
return 0;
DPRINTF(Drain, "PacketQueue not drained\n");
drainManager = dm;
diff -r 72890a571a7b -r 7f4059e4f2d5 src/mem/packet_queue.hh
--- a/src/mem/packet_queue.hh Wed Sep 03 07:42:27 2014 -0400
+++ b/src/mem/packet_queue.hh Wed Sep 03 07:42:28 2014 -0400
@@ -78,7 +78,6 @@
};
typedef std::list<DeferredPacket> DeferredPacketList;
- typedef std::list<DeferredPacket>::iterator DeferredPacketIterator;
/** A list of outgoing timing response packets that haven't been
* serviced yet. */
@@ -109,10 +108,10 @@
bool waitingOnRetry;
/** Check whether we have a packet ready to go on the transmit list. */
- bool deferredPacketReady()
+ bool deferredPacketReady() const
{ return !transmitList.empty() && transmitList.front().tick <= curTick(); }
- Tick deferredPacketReadyTime()
+ Tick deferredPacketReadyTime() const
{ return transmitList.empty() ? MaxTick : transmitList.front().tick; }
/**
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev