29#ifndef __CPU_ACTIVITY_HH__
30#define __CPU_ACTIVITY_HH__
57 int longest_latency,
int count);
ActivityRecorder helper class that informs the CPU if it can switch over to being idle or not.
int activityCount
Tracks how many stages and cycles of time buffer have activity.
int numStages
Number of stages that can be marked as active or inactive.
void dump()
Debug function to dump the contents of the time buffer.
int longestLatency
Longest latency time buffer in the CPU.
int getActivityCount() const
Returns how many things are active within the recorder.
void advance()
Advances the activity buffer, decrementing the activityCount if active communication just left the ti...
bool getStageActive(const int idx) const
Returns the activity status of a stage.
void validate()
Debug function to ensure that the activity count matches the contents of the time buffer.
void reset()
Clears the time buffer and the activity count.
void activity()
Records that there is activity this cycle.
int getNumStages() const
Returns the number of stages.
bool * stageActive
Records which stages are active/inactive.
ActivityRecorder(const std::string &name, int num_stages, int longest_latency, int count)
void deactivateStage(const int idx)
Deactivates a stage.
bool active()
Returns if the CPU should be active.
TimeBuffer< bool > activityBuffer
Time buffer that tracks if any cycles has active communication in them.
void activateStage(const int idx)
Marks a stage as active.
const std::string & name() const
void setActivityCount(int count)
Sets the count to a starting value.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.