44 #ifndef __SIM_CLOCKED_OBJECT_HH__ 45 #define __SIM_CLOCKED_OBJECT_HH__ 48 #include "params/ClockedObject.hh" 97 cycle += elapsedCycles;
113 : tick(0), cycle(0), clockDomain(clk_domain)
137 cycle = elapsedCycles;
241 return reinterpret_cast<const Params*
>(_params);
250 #endif //__SIM_CLOCKED_OBJECT_HH__ Cycles is a wrapper class for representing cycle counts, i.e.
ClockedObjectParams Params
Parameters of ClockedObject.
virtual ~Clocked()
Virtual destructor due to inheritance.
Helper class for objects that have power states.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
const Params * params() const
Clocked(ClockDomain &clk_domain)
Create a clocked object and set the clock domain based on the parameters.
Tick cyclesToTicks(Cycles c) const
void resetClock() const
Reset the object's clock using the current global tick value.
Tick curTick()
The current simulated tick.
uint64_t frequency() const
uint64_t Tick
Tick count type.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
ClockDomain declarations.
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
Helper class for objects that need to be clocked.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
ClockDomain & clockDomain
The clock domain this clocked object belongs to.
virtual void clockPeriodUpdated()
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is ch...
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
Cycles ticksToCycles(Tick t) const
std::ostream CheckpointOut
void updateClockPeriod()
Update the tick to the current tick.
T divCeil(const T &a, const U &b)
void registerWithClockDomain(Clocked *c)
Register a Clocked object with this ClockDomain.
void unserialize(ThreadContext &tc, CheckpointIn &cp)
Clocked & operator=(Clocked &)=delete
PowerState declaration and implementation.
void update() const
Align cycle and tick to the next clock edge if not already done.
double voltage() const
Get the current voltage this clock domain operates at.
Abstract superclass for simulation objects.
Tick clockPeriod() const
Get the clock period.