summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/TimerTable.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-01-14 10:04:21 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2013-01-14 10:04:21 -0600
commitcf232de4615f0fe9435d6e92a1d6319c972a8c88 (patch)
tree539c365baf0b078b2fdbf820feeb89c1afee8726 /src/mem/ruby/system/TimerTable.cc
parentcbbc4c7f6b4cb718cc3907b955f7ae527d2d0274 (diff)
downloadgem5-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.cc')
-rw-r--r--src/mem/ruby/system/TimerTable.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mem/ruby/system/TimerTable.cc b/src/mem/ruby/system/TimerTable.cc
index 6702411a5..992401c50 100644
--- a/src/mem/ruby/system/TimerTable.cc
+++ b/src/mem/ruby/system/TimerTable.cc
@@ -33,6 +33,8 @@
TimerTable::TimerTable()
{
m_consumer_ptr = NULL;
+ m_clockobj_ptr = NULL;
+
m_next_valid = false;
m_next_address = Address(0);
m_next_time = 0;
@@ -48,7 +50,7 @@ TimerTable::isReady() const
updateNext();
}
assert(m_next_valid);
- return (g_system_ptr->getTime() >= m_next_time);
+ return (m_clockobj_ptr->curCycle() >= m_next_time);
}
const Address&
@@ -69,7 +71,7 @@ TimerTable::set(const Address& address, Time relative_latency)
assert(address == line_address(address));
assert(relative_latency > 0);
assert(!m_map.count(address));
- Time ready_time = g_system_ptr->getTime() + relative_latency;
+ Time ready_time = m_clockobj_ptr->curCycle() + relative_latency;
m_map[address] = ready_time;
assert(m_consumer_ptr != NULL);
m_consumer_ptr->scheduleEventAbsolute(ready_time);