46#ifndef __SIM_TICKED_OBJECT_HH__
47#define __SIM_TICKED_OBJECT_HH__
54struct TickedObjectParams;
109 if (!
event.scheduled())
110 object.schedule(
event,
object.clockEdge(
Cycles(1)));
136 if (
event.scheduled())
137 object.deschedule(
event);
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.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Cycles is a wrapper class for representing cycle counts, i.e.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
TickedObject(const TickedObjectParams ¶ms, Event::Priority priority=Event::CPU_Tick_Pri)
void serialize(CheckpointOut &cp) const override
Serialize an object.
void regStats() override
Pass on regStats, serialize etc.
virtual void evaluate()=0
Action to call on the clock tick.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Ticked(ClockedObject &object_, statistics::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri)
void processClockEvent()
Evaluate and reschedule.
bool running
Have I been started?
void resetLastStopped()
Reset stopped time to current time.
statistics::Scalar tickCycles
Number of cycles ticked.
void regStats()
Register {num,ticks}Cycles if necessary.
statistics::Formula idleCycles
Number of cycles stopped.
void start()
Start ticking.
Cycles lastStopped
Time of last stop event to calculate run time.
statistics::Scalar * numCyclesLocal
Locally allocated stats.
ClockedObject & object
ClockedObject who is responsible for this Ticked's actions/stats.
void serialize(CheckpointOut &cp) const override
Checkpoint lastStopped.
virtual void countCycles(Cycles delta)
Callback to handle cycle statistics and probes.
statistics::Scalar & numCycles
Total number of cycles either ticked or spend stopped.
void stop()
Cancel the next tick event and issue no more.
EventFunctionWrapper event
The wrapper for processClockEvent.
Cycles cyclesSinceLastStopped() const
How long have we been stopped for?
This is a simple scalar statistic, like a counter.
ClockedObject declaration and implementation.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
const Params & params() const
virtual void regStats()
Callback to set stat parameters.
Bitfield< 3, 0 > priority
Copyright (c) 2024 Arm Limited All rights reserved.
std::ostream CheckpointOut