diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-01-14 10:04:21 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-01-14 10:04:21 -0600 |
commit | cf232de4615f0fe9435d6e92a1d6319c972a8c88 (patch) | |
tree | 539c365baf0b078b2fdbf820feeb89c1afee8726 /src/mem/ruby/system/TimerTable.hh | |
parent | cbbc4c7f6b4cb718cc3907b955f7ae527d2d0274 (diff) | |
download | gem5-cf232de4615f0fe9435d6e92a1d6319c972a8c88.tar.xz |
Ruby: use ClockedObject in Consumer class
Many Ruby structures inherit from the Consumer, which is used for scheduling
events. The Consumer used to relay on an Event Manager for scheduling events
and on g_system_ptr for time. With this patch, the Consumer will now use a
ClockedObject to schedule events and to query for current time. This resulted
in several structures being converted from SimObjects to ClockedObjects. Also,
the MessageBuffer class now requires a pointer to a ClockedObject so as to
query for time.
Diffstat (limited to 'src/mem/ruby/system/TimerTable.hh')
-rw-r--r-- | src/mem/ruby/system/TimerTable.hh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mem/ruby/system/TimerTable.hh b/src/mem/ruby/system/TimerTable.hh index 4335b6605..ecd95ee19 100644 --- a/src/mem/ruby/system/TimerTable.hh +++ b/src/mem/ruby/system/TimerTable.hh @@ -49,6 +49,12 @@ class TimerTable m_consumer_ptr = consumer_ptr; } + void setClockObj(ClockedObject* obj) + { + assert(m_clockobj_ptr == NULL); + m_clockobj_ptr = obj; + } + void setDescription(const std::string& name) { @@ -78,7 +84,12 @@ class TimerTable mutable bool m_next_valid; mutable Time m_next_time; // Only valid if m_next_valid is true mutable Address m_next_address; // Only valid if m_next_valid is true - Consumer* m_consumer_ptr; // Consumer to signal a wakeup() + + //! Object used for querying time. + ClockedObject* m_clockobj_ptr; + //! Consumer to signal a wakeup() + Consumer* m_consumer_ptr; + std::string m_name; }; |