summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-01-19 16:22:23 -0800
committerGabe Black <gblack@eecs.umich.edu>2011-01-19 16:22:23 -0800
commitddeaf1252f1c237c286950ccf7bbf80bafacf4cd (patch)
treea911640d507fb7cc67be5546aab479d82face41e /src/sim
parent23bab6783b8fb4401543941983c36c41cd24b4ef (diff)
downloadgem5-ddeaf1252f1c237c286950ccf7bbf80bafacf4cd.tar.xz
TimeSync: Use the new setTick and getTick functions.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/root.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/sim/root.cc b/src/sim/root.cc
index d44c72f4d..1dc9b6058 100644
--- a/src/sim/root.cc
+++ b/src/sim/root.cc
@@ -32,7 +32,6 @@
*/
#include "base/misc.hh"
-#include "sim/core.hh"
#include "sim/root.hh"
Root *Root::_root = NULL;
@@ -87,8 +86,7 @@ Root::timeSyncPeriod(Time newPeriod)
{
bool en = timeSyncEnabled();
_period = newPeriod;
- _periodTick = _period.nsec() * SimClock::Int::ns +
- _period.sec() * SimClock::Int::s;
+ _periodTick = _period.getTick();
timeSyncEnable(en);
}
@@ -104,11 +102,8 @@ Root::timeSyncSpinThreshold(Time newThreshold)
Root::Root(RootParams *p) : SimObject(p), _enabled(false),
_periodTick(p->time_sync_period), syncEvent(this)
{
- uint64_t nsecs = p->time_sync_period / SimClock::Int::ns;
- _period.set(nsecs / Time::NSEC_PER_SEC, nsecs % Time::NSEC_PER_SEC);
- nsecs = p->time_sync_spin_threshold / SimClock::Int::ns;
- _spinThreshold.set(nsecs / Time::NSEC_PER_SEC,
- nsecs % Time::NSEC_PER_SEC);
+ _period.setTick(p->time_sync_period);
+ _spinThreshold.setTick(p->time_sync_spin_threshold);
assert(_root == NULL);
_root = this;