46#ifndef __SIM_TICKED_OBJECT_HH__
47#define __SIM_TICKED_OBJECT_HH__
54struct TickedObjectParams;
110 object.schedule(
event,
object.clockEdge(
Cycles(1)));
137 object.deschedule(
event);
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
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.
Basic support for object serialization.
TickedObject attaches Ticked to ClockedObject and can be used as a base class where ticked operation.
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.
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to...
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? and am not stopped.
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.
bool scheduled() const
Determine if the current event is scheduled.
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 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut