changeset f84bfd45d607 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=f84bfd45d607
description:
TimeSync: Use the new setTick and getTick functions.
diffstat:
src/sim/root.cc | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diffs (35 lines):
diff -r 23758c97c227 -r f84bfd45d607 src/sim/root.cc
--- a/src/sim/root.cc Wed Jan 19 16:22:15 2011 -0800
+++ b/src/sim/root.cc Wed Jan 19 16:22:23 2011 -0800
@@ -32,7 +32,6 @@
*/
#include "base/misc.hh"
-#include "sim/core.hh"
#include "sim/root.hh"
Root *Root::_root = NULL;
@@ -87,8 +86,7 @@
{
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::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;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev