summaryrefslogtreecommitdiff
path: root/src/mem/tport.cc
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-10-11 19:25:48 -0400
committerRon Dreslinski <rdreslin@umich.edu>2006-10-11 19:25:48 -0400
commit3c7e0ec752c1d2c61b9e8c1233bb904d836b4e4e (patch)
tree2895dd28d365f8fa0452e673467c6c198ff3bf58 /src/mem/tport.cc
parent567afbf6ce5b2d6fe573878c39679e56a1bf5d15 (diff)
downloadgem5-3c7e0ec752c1d2c61b9e8c1233bb904d836b4e4e.tar.xz
Fix bus in FS mode.
src/mem/bus.cc: Add debugging statement src/mem/bus.hh: Fix implementation of bus for subsequent recvTimings while handling a retry request. src/mem/tport.cc: Rework timing port to retry properly --HG-- extra : convert_revision : fbfb5e8b4a625e49c6cd764da1df46a4f336b1b2
Diffstat (limited to 'src/mem/tport.cc')
-rw-r--r--src/mem/tport.cc38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/mem/tport.cc b/src/mem/tport.cc
index 528067170..456878d0a 100644
--- a/src/mem/tport.cc
+++ b/src/mem/tport.cc
@@ -58,15 +58,17 @@ SimpleTimingPort::recvTiming(Packet *pkt)
void
SimpleTimingPort::recvRetry()
{
- bool result = true;
-
- assert(transmitList.size());
- while (result && transmitList.size()) {
- result = sendTiming(transmitList.front());
- if (result)
- transmitList.pop_front();
+ assert(outTiming > 0);
+ assert(!transmitList.empty());
+ if (sendTiming(transmitList.front())) {
+ transmitList.pop_front();
+ outTiming--;
+ DPRINTF(Bus, "No Longer waiting on retry\n");
+ if (!transmitList.empty())
+ sendTimingLater(transmitList.front(), 1);
}
- if (transmitList.size() == 0 && drainEvent) {
+
+ if (transmitList.empty() && drainEvent) {
drainEvent->process();
drainEvent = NULL;
}
@@ -75,20 +77,28 @@ SimpleTimingPort::recvRetry()
void
SimpleTimingPort::SendEvent::process()
{
- port->outTiming--;
- assert(port->outTiming >= 0);
- if (port->transmitList.size()) {
+ assert(port->outTiming > 0);
+ if (!port->transmitList.empty() && port->transmitList.front() != packet) {
+ //We are not the head of the list
port->transmitList.push_back(packet);
} else if (port->sendTiming(packet)) {
// send successful
- if (port->transmitList.size() == 0 && port->drainEvent) {
+ if (port->transmitList.size()) {
+ port->transmitList.pop_front();
+ port->outTiming--;
+ if (!port->transmitList.empty())
+ port->sendTimingLater(port->transmitList.front(), 1);
+ }
+ if (port->transmitList.empty() && port->drainEvent) {
port->drainEvent->process();
port->drainEvent = NULL;
}
} else {
// send unsuccessful (due to flow control). Will get retry
- // callback later; save for then.
- port->transmitList.push_back(packet);
+ // callback later; save for then if not already
+ DPRINTF(Bus, "Waiting on retry\n");
+ if (!(port->transmitList.front() == packet))
+ port->transmitList.push_back(packet);
}
}