*/
size_t countInsts(ThreadID tid);
- /** Registers statistics. */
- void regStats();
-
private:
/** Reset the ROB state */
void resetState();
/** Number of active threads. */
ThreadID numThreads;
- // The number of rob_reads
- Stats::Scalar robReads;
- // The number of rob_writes
- Stats::Scalar robWrites;
+
+ struct ROBStats : public Stats::Group {
+ ROBStats(Stats::Group *parent);
+
+ // The number of rob_reads
+ Stats::Scalar reads;
+ // The number of rob_writes
+ Stats::Scalar writes;
+ } stats;
};
#endif //__CPU_O3_ROB_HH__
numEntries(params->numROBEntries),
squashWidth(params->squashWidth),
numInstsInROB(0),
- numThreads(params->numThreads)
+ numThreads(params->numThreads),
+ stats(_cpu)
{
//Figure out rob policy
if (robPolicy == SMTQueuePolicy::Dynamic) {
{
assert(inst);
- robWrites++;
+ stats.writes++;
DPRINTF(ROB, "Adding inst PC %s to the ROB.\n", inst->pcState());
void
ROB<Impl>::retireHead(ThreadID tid)
{
- robWrites++;
+ stats.writes++;
assert(numInstsInROB > 0);
bool
ROB<Impl>::isHeadReady(ThreadID tid)
{
- robReads++;
+ stats.reads++;
if (threadEntries[tid] != 0) {
return instList[tid].front()->readyToCommit();
}
void
ROB<Impl>::doSquash(ThreadID tid)
{
- robWrites++;
+ stats.writes++;
DPRINTF(ROB, "[tid:%i] Squashing instructions until [sn:%llu].\n",
tid, squashedSeqNum[tid]);
}
template <class Impl>
-void
-ROB<Impl>::regStats()
+ROB<Impl>::ROBStats::ROBStats(Stats::Group *parent)
+ : Stats::Group(parent, "rob"),
+ ADD_STAT(reads, "The number of ROB reads"),
+ ADD_STAT(writes, "The number of ROB writes")
{
- using namespace Stats;
- robReads
- .name(name() + ".rob_reads")
- .desc("The number of ROB reads");
-
- robWrites
- .name(name() + ".rob_writes")
- .desc("The number of ROB writes");
}
template <class Impl>