40#include "params/TickedObject.hh"
55 numCyclesLocal((imported_num_cycles ? NULL : new statistics::
Scalar)),
56 numCycles((imported_num_cycles ? *imported_num_cycles :
67 object.schedule(
event,
object.clockEdge(
Cycles(1)));
75 .
name(
object.
name() +
".totalTickCycles")
76 .
desc(
"Number of cycles that the object ticked or was stopped");
81 .
desc(
"Number of cycles that the object actually ticked");
85 .
desc(
"Total number of cycles that the object has spent stopped");
94 paramOut(cp,
"lastStopped", lastStoppedUint);
100 uint64_t lastStoppedUint = 0;
108 optParamIn(cp,
"lastStopped", lastStoppedUint);
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.
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.
statistics::Scalar tickCycles
Number of cycles ticked.
void regStats()
Register {num,ticks}Cycles if necessary.
statistics::Formula idleCycles
Number of cycles stopped.
Cycles lastStopped
Time of last stop event to calculate run time.
statistics::Scalar * numCyclesLocal
Locally allocated 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.
EventFunctionWrapper event
The wrapper for processClockEvent.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
This is a simple scalar statistic, like a counter.
ClockedObject declaration and implementation.
bool optParamIn(CheckpointIn &cp, const std::string &name, T ¶m, bool do_warn=true)
This function is used for restoring optional parameters from the checkpoint.
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
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
Base classes for ClockedObjects which have evaluate functions to look like clock ticking operations.
const std::string & name()