summaryrefslogtreecommitdiff
path: root/src/mem/bus.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-05-30 18:57:53 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-05-30 18:57:53 -0400
commitaa11330ddbb1e579aa241d01d24875cc9d86d5f8 (patch)
tree48438922bfd18e53e39c039b6141db417081016c /src/mem/bus.cc
parentd308055afc1ace1f321b76e8a85a9a45165da2ce (diff)
parent09d8a1e1252eba582fd8450ee31e784b54910f7d (diff)
downloadgem5-aa11330ddbb1e579aa241d01d24875cc9d86d5f8.tar.xz
Merge zizzer:/bk/newmem
into zeep.pool:/z/saidi/work/m5.newmem --HG-- extra : convert_revision : 4b7ba74eebe9b8370a12f8eb9905f83e2f380585
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r--src/mem/bus.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index cfc99a64f..aec3ef2f6 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -72,9 +72,35 @@ Bus::recvTiming(Packet *pkt)
assert(dest != pkt->getSrc()); // catch infinite loops
port = interfaces[dest];
}
- return port->sendTiming(pkt);
+ if (port->sendTiming(pkt)) {
+ // packet was successfully sent, just return true.
+ return true;
+ }
+
+ // packet not successfully sent
+ retryList.push_back(interfaces[pkt->getSrc()]);
+ return false;
+}
+
+void
+Bus::recvRetry(int id)
+{
+ // Go through all the elements on the list calling sendRetry on each
+ // This is not very efficient at all but it works. Ultimately we should end
+ // up with something that is more intelligent.
+ int initialSize = retryList.size();
+ int i;
+ Port *p;
+
+ for (i = 0; i < initialSize; i++) {
+ assert(retryList.size() > 0);
+ p = retryList.front();
+ retryList.pop_front();
+ p->sendRetry();
+ }
}
+
Port *
Bus::findPort(Addr addr, int id)
{