summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r--src/mem/ruby/common/Consumer.cc8
-rw-r--r--src/mem/ruby/common/Consumer.hh6
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mem/ruby/common/Consumer.cc b/src/mem/ruby/common/Consumer.cc
index de6a8f448..a829f4d99 100644
--- a/src/mem/ruby/common/Consumer.cc
+++ b/src/mem/ruby/common/Consumer.cc
@@ -27,23 +27,21 @@
*/
#include "mem/ruby/common/Consumer.hh"
-#include "mem/ruby/common/Global.hh"
-#include "mem/ruby/system/System.hh"
void
Consumer::scheduleEvent(Time timeDelta)
{
- scheduleEventAbsolute(timeDelta + g_system_ptr->getTime());
+ scheduleEventAbsolute(timeDelta + em->curCycle());
}
void
Consumer::scheduleEventAbsolute(Time timeAbs)
{
- Tick evt_time = g_system_ptr->clockPeriod() * timeAbs;
+ Tick evt_time = em->clockPeriod() * timeAbs;
if (!alreadyScheduled(evt_time)) {
// This wakeup is not redundant
ConsumerEvent *evt = new ConsumerEvent(this);
- assert(timeAbs > g_system_ptr->getTime());
+ assert(timeAbs > em->curCycle());
em->schedule(evt, evt_time);
insertScheduledWakeupTime(evt_time);
diff --git a/src/mem/ruby/common/Consumer.hh b/src/mem/ruby/common/Consumer.hh
index a10abf362..9e089e992 100644
--- a/src/mem/ruby/common/Consumer.hh
+++ b/src/mem/ruby/common/Consumer.hh
@@ -39,12 +39,12 @@
#include <set>
#include "mem/ruby/common/TypeDefines.hh"
-#include "sim/eventq.hh"
+#include "sim/clocked_object.hh"
class Consumer
{
public:
- Consumer(EventManager *_em)
+ Consumer(ClockedObject *_em)
: m_last_scheduled_wakeup(0), m_last_wakeup(0), em(_em)
{
}
@@ -95,7 +95,7 @@ class Consumer
Tick m_last_scheduled_wakeup;
std::set<Tick> m_scheduled_wakeups;
Tick m_last_wakeup;
- EventManager *em;
+ ClockedObject *em;
class ConsumerEvent : public Event
{