/*
* Copyright (c) 2002-2005 The Regents of The University of Michigan
- * Copyright (c) 2011 Advanced Micro Devices
+ * Copyright (c) 2011 Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Gabe Black
*/
-#include "base/misc.hh"
+#include "base/logging.hh"
+#include "base/trace.hh"
+#include "config/the_isa.hh"
+#include "debug/TimeSync.hh"
+#include "sim/eventq_impl.hh"
+#include "sim/full_system.hh"
#include "sim/root.hh"
Root *Root::_root = NULL;
timeSyncEnable(en);
}
-Root::Root(RootParams *p) : SimObject(p), _enabled(false),
- _periodTick(p->time_sync_period), syncEvent(this)
+Root::Root(RootParams *p)
+ : SimObject(p), _enabled(false), _periodTick(p->time_sync_period),
+ syncEvent([this]{ timeSync(); }, name())
{
_period.setTick(p->time_sync_period);
_spinThreshold.setTick(p->time_sync_spin_threshold);
assert(_root == NULL);
_root = this;
lastTime.setTimer();
+
+ simQuantum = p->sim_quantum;
}
void
-Root::initState()
+Root::startup()
{
timeSyncEnable(params()->time_sync_enable);
}
void
-Root::loadState(Checkpoint *cp)
+Root::serialize(CheckpointOut &cp) const
{
- timeSyncEnable(params()->time_sync_enable);
+ SERIALIZE_SCALAR(FullSystem);
+ std::string isa = THE_ISA_STR;
+ SERIALIZE_SCALAR(isa);
}
+
+bool FullSystem;
+unsigned int FullSystemInt;
+
Root *
RootParams::create()
{
created = true;
+ FullSystem = full_system;
+ FullSystemInt = full_system ? 1 : 0;
+
return new Root(this);
}