summaryrefslogtreecommitdiff
path: root/src/mem/packet_queue.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-09-03 07:42:28 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-09-03 07:42:28 -0400
commit77c28cc3956d32282f71d8eadbd5fff0fec836e8 (patch)
treede4b2ea9bc2b85ddd143b09b6d3cb14f79cb1b27 /src/mem/packet_queue.cc
parent71769d2d7b094580b7a4437bf8d8e1401c418c4d (diff)
downloadgem5-77c28cc3956d32282f71d8eadbd5fff0fec836e8.tar.xz
mem: Packet queue clean up
No change in functionality, just a bit of tidying up.
Diffstat (limited to 'src/mem/packet_queue.cc')
-rw-r--r--src/mem/packet_queue.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/mem/packet_queue.cc b/src/mem/packet_queue.cc
index a6f31c6eb..428f8c13f 100644
--- a/src/mem/packet_queue.cc
+++ b/src/mem/packet_queue.cc
@@ -71,11 +71,10 @@ PacketQueue::checkFunctional(PacketPtr pkt)
{
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 @@ PacketQueue::schedSendTiming(PacketPtr pkt, Tick when, bool send_as_snoop)
}
// 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 @@ void PacketQueue::trySendTiming()
{
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 @@ PacketQueue::processSendEvent()
unsigned int
PacketQueue::drain(DrainManager *dm)
{
- if (transmitList.empty() && !sendEvent.scheduled())
+ if (transmitList.empty())
return 0;
DPRINTF(Drain, "PacketQueue not drained\n");
drainManager = dm;