44#ifndef __SIM_CLOCKED_OBJECT_HH__
45#define __SIM_CLOCKED_OBJECT_HH__
48#include "params/ClockedObject.hh"
100 cycle += elapsedCycles;
140 cycle = elapsedCycles;
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain.
Tick clockPeriod() const
Get the clock period.
void registerWithClockDomain(Clocked *c)
Register a Clocked object with this ClockDomain.
double voltage() const
Get the current voltage this clock domain operates at.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
ClockedObject(const ClockedObjectParams &p)
void serialize(CheckpointOut &cp) const override
Serialize an object.
ClockedObjectParams Params
Parameters of ClockedObject.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Helper class for objects that need to be clocked.
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
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...
void updateClockPeriod()
Update the tick to the current tick.
uint64_t frequency() const
Clocked & operator=(Clocked &)=delete
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
ClockDomain & clockDomain
The clock domain this clocked object belongs to.
Tick cyclesToTicks(Cycles c) const
virtual ~Clocked()
Virtual destructor due to inheritance.
void resetClock() const
Reset the object's clock using the current global tick value.
Clocked(ClockDomain &clk_domain)
Create a clocked object and set the clock domain based on the parameters.
void update() const
Align cycle and tick to the next clock edge if not already done.
Cycles ticksToCycles(Tick t) const
virtual void clockPeriodUpdated()
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is ch...
Clocked(Clocked &)=delete
Cycles is a wrapper class for representing cycle counts, i.e.
Helper class for objects that have power states.
Abstract superclass for simulation objects.
ClockDomain declarations.
static constexpr T divCeil(const T &a, const U &b)
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
PowerState declaration and implementation.