summaryrefslogtreecommitdiff
path: root/src/mem/bus.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-01 19:00:49 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-01 19:00:49 -0500
commit8dbab9f701150cf93d33f2a21d6b556507f3d617 (patch)
treeaec7f6fc83fdac1a2de1cd034f7fb4c384a100ba /src/mem/bus.cc
parent6f78d494101e0ebd542d8fe836df21d104374c33 (diff)
downloadgem5-8dbab9f701150cf93d33f2a21d6b556507f3d617.tar.xz
Added code to handle draining.
--HG-- extra : convert_revision : 3861f553bde5865cd21a8a58a4c410896726f0a3
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r--src/mem/bus.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 86a148f87..41dc9acbf 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -239,6 +239,9 @@ Bus::recvRetry(int id)
busIdle.reschedule(tickNextIdle);
}
}
+ //If we weren't able to drain before, we might be able to now.
+ if (drainEvent && retryList.size() == 0 && curTick >= tickNextIdle)
+ drainEvent->process();
}
}
@@ -498,6 +501,20 @@ Bus::addressRanges(AddrRangeList &resp, AddrRangeList &snoop, int id)
}
}
+unsigned int
+Bus::drain(Event * de)
+{
+ //We should check that we're not "doing" anything, and that noone is
+ //waiting. We might be idle but have someone waiting if the device we
+ //contacted for a retry didn't actually retry.
+ if (curTick >= tickNextIdle && retryList.size() == 0) {
+ drainEvent = de;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bus)
Param<int> bus_id;