diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-01-29 20:29:19 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-01-29 20:29:19 -0800 |
commit | 12daaed84a44920968adb6b16bd558561bd18801 (patch) | |
tree | 0f72b27373669de9b7c060b080ac4a4093b8cccc /src/mem/ruby/eventqueue | |
parent | ed814899541d65783e93a37ab320650c5075c72d (diff) | |
download | gem5-12daaed84a44920968adb6b16bd558561bd18801.tar.xz |
ruby: Added clock to ruby system
As a first step to migrate ruby to the M5 eventqueue, added a clock
variable to the ruby system.
Diffstat (limited to 'src/mem/ruby/eventqueue')
-rw-r--r-- | src/mem/ruby/eventqueue/RubyEventQueue.cc | 5 | ||||
-rw-r--r-- | src/mem/ruby/eventqueue/RubyEventQueue.hh | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mem/ruby/eventqueue/RubyEventQueue.cc b/src/mem/ruby/eventqueue/RubyEventQueue.cc index 271f8f137..8e9b7b18d 100644 --- a/src/mem/ruby/eventqueue/RubyEventQueue.cc +++ b/src/mem/ruby/eventqueue/RubyEventQueue.cc @@ -40,9 +40,8 @@ // Class public method definitions -RubyEventQueue theEventQueue; - -RubyEventQueue::RubyEventQueue() +RubyEventQueue::RubyEventQueue(Tick _clock) + : m_clock(_clock) { m_prio_heap_ptr = NULL; init(); diff --git a/src/mem/ruby/eventqueue/RubyEventQueue.hh b/src/mem/ruby/eventqueue/RubyEventQueue.hh index fe7bc2833..8bd74a36e 100644 --- a/src/mem/ruby/eventqueue/RubyEventQueue.hh +++ b/src/mem/ruby/eventqueue/RubyEventQueue.hh @@ -70,14 +70,14 @@ class RubyEventQueueNode; class RubyEventQueue { public: // Constructors - RubyEventQueue(); + RubyEventQueue(Tick clock); // Destructor ~RubyEventQueue(); // Public Methods - Time getTime() const { return m_globalTime; } + Time getTime() const { return curTick/m_clock; } void scheduleEvent(Consumer* consumer, Time timeDelta) { scheduleEventAbsolute(consumer, timeDelta + m_globalTime); } void scheduleEventAbsolute(Consumer* consumer, Time timeAbs); void triggerEvents(Time t); // called to handle all events <= time t @@ -96,6 +96,7 @@ private: RubyEventQueue& operator=(const RubyEventQueue& obj); // Data Members (m_ prefix) + Tick m_clock; PrioHeap<RubyEventQueueNode>* m_prio_heap_ptr; Time m_globalTime; Time m_timeOfLastRecovery; |