36 #include "config/the_isa.hh"
37 #include "debug/TimeSync.hh"
58 Time remainder = period - diff;
60 DPRINTF(TimeSync,
"Sleeping to sync with real time.\n");
66 }
while (diff < period);
108 _periodTick(p->time_sync_period), syncEvent(this)
113 assert(
_root == NULL);
137 std::string isa = THE_ISA_STR;
152 static bool created =
false;
154 panic(
"only one root object allowed!");
161 return new Root(
this);
const Time timeSyncSpinThreshold() const
Retrieve the threshold for time remaining to spin wait.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
EventWrapper< Root,&Root::timeSync > syncEvent
void deschedule(Event &event)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Tick curTick()
The current simulated tick.
uint64_t Tick
Tick count type.
const Params * params() const
const Time timeSyncPeriod() const
Retrieve the period for the sync event.
void loadState(CheckpointIn &cp) override
Schedule the timesync event at loadState() so that curTick is correct.
bool timeSyncEnabled() const
Check whether time syncing is enabled.
#define SERIALIZE_SCALAR(scalar)
void timeSyncEnable(bool en)
Enable or disable time syncing.
std::ostream CheckpointOut
void initState() override
Schedule the timesync event at initState() when not unserializing.
void schedule(Event &event, Tick when)
Tick getTick() const
Get the current time from a value measured in Ticks.
void setTick(Tick ticks)
Set the current time from a value measured in Ticks.
void setTimer()
Use this to set time for the purposes of time measurement (use a monotonic clock if it is available...
unsigned int FullSystemInt
In addition to the boolean flag we make use of an unsigned int since the CPU instruction decoder make...
Abstract superclass for simulation objects.
void sleep(const Time &time)
virtual void loadState(CheckpointIn &cp)
loadState() is called on each SimObject when restoring from a checkpoint.
Tick simQuantum
Simulation Quantum for multiple eventq simulation.