From ddeaf1252f1c237c286950ccf7bbf80bafacf4cd Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 19 Jan 2011 16:22:23 -0800 Subject: [PATCH] TimeSync: Use the new setTick and getTick functions. --- src/sim/root.cc | 11 +++-------- 1 file 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; -- 2.30.2