diff options
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r-- | src/mem/bus.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc index 7ae41e11e..28ee3476b 100644 --- a/src/mem/bus.cc +++ b/src/mem/bus.cc @@ -240,6 +240,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(); } } @@ -511,6 +514,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; |