diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-20 09:14:14 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-03-20 09:14:14 -0500 |
commit | 52a83c1d0ea2e0806ce3934aab5c566d6c9e3451 (patch) | |
tree | 83613de08d59415a1d681d4c0b780c81165ccec9 /src/mem/ruby/common/Consumer.cc | |
parent | 4b67ada89e2e47b26ad07562774ff65beb5633a5 (diff) | |
download | gem5-52a83c1d0ea2e0806ce3934aab5c566d6c9e3451.tar.xz |
ruby: consumer: avoid accessing wakeup times when waking up
Each consumer object maintains a set of tick values when the object is supposed
to wakeup and do some processing. As of now, the object accesses this set both
when scheduling a wakeup event and when the object actually wakes up. The set
is accessed during wakeup to remove the current tick value from the set. This
functionality is now being moved to the scheduling function where ticks are
removed at a later time.
Diffstat (limited to 'src/mem/ruby/common/Consumer.cc')
-rw-r--r-- | src/mem/ruby/common/Consumer.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mem/ruby/common/Consumer.cc b/src/mem/ruby/common/Consumer.cc index 9f3735709..59605d51b 100644 --- a/src/mem/ruby/common/Consumer.cc +++ b/src/mem/ruby/common/Consumer.cc @@ -28,6 +28,8 @@ #include "mem/ruby/common/Consumer.hh" +using namespace std; + void Consumer::scheduleEvent(Cycles timeDelta) { @@ -43,4 +45,9 @@ Consumer::scheduleEventAbsolute(Tick evt_time) em->schedule(evt, evt_time); insertScheduledWakeupTime(evt_time); } + + Tick t = em->clockEdge(); + set<Tick>::iterator bit = m_scheduled_wakeups.begin(); + set<Tick>::iterator eit = m_scheduled_wakeups.lower_bound(t); + m_scheduled_wakeups.erase(bit,eit); } |