summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-05-31 13:45:37 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-05-31 13:45:37 -0400
commit0193c3fe7d8512124ef6bd7cca4794e58f762f4c (patch)
tree889fee2b20ef7c9681cdcd28eb779ed193d27d27
parentaa11330ddbb1e579aa241d01d24875cc9d86d5f8 (diff)
downloadgem5-0193c3fe7d8512124ef6bd7cca4794e58f762f4c.tar.xz
make io device be a little nicer about scheduling retries on the bus
--HG-- extra : convert_revision : 19a1f0c7bf79d6d8ef235aae60cdbbbcb7de2b79
-rw-r--r--src/dev/io_device.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc
index 563fdb759..adf41799c 100644
--- a/src/dev/io_device.cc
+++ b/src/dev/io_device.cc
@@ -143,15 +143,19 @@ void
DmaPort::recvRetry()
{
Packet* pkt = transmitList.front();
- DPRINTF(DMA, "Retry on Packet %#x with senderState: %#x\n",
- pkt, pkt->senderState);
- if (sendTiming(pkt)) {
- DPRINTF(DMA, "-- Done\n");
- transmitList.pop_front();
- pendingCount--;
- assert(pendingCount >= 0);
- } else {
- DPRINTF(DMA, "-- Failed, queued\n");
+ bool result = true;
+ while (result && transmitList.size()) {
+ DPRINTF(DMA, "Retry on Packet %#x with senderState: %#x\n",
+ pkt, pkt->senderState);
+ result = sendTiming(pkt);
+ if (result) {
+ DPRINTF(DMA, "-- Done\n");
+ transmitList.pop_front();
+ pendingCount--;
+ assert(pendingCount >= 0);
+ } else {
+ DPRINTF(DMA, "-- Failed, queued\n");
+ }
}
}
@@ -201,7 +205,7 @@ DmaPort::sendDma(Packet *pkt)
if (state == Timing) { */
DPRINTF(DMA, "Attempting to send Packet %#x with senderState: %#x\n",
pkt, pkt->senderState);
- if (!sendTiming(pkt)) {
+ if (transmitList.size() || !sendTiming(pkt)) {
transmitList.push_back(pkt);
DPRINTF(DMA, "-- Failed: queued\n");
} else {