nextProgressMessage(p->progress_interval),
maxLoads(p->max_loads),
atomic(p->system->isAtomicMode()),
- suppressFuncErrors(p->suppress_func_errors)
+ suppressFuncErrors(p->suppress_func_errors), stats(this)
{
id = TESTER_ALLOCATOR++;
fatal_if(id >= blockSize, "Too many testers, only %d allowed\n",
}
numReads++;
- numReadsStat++;
+ stats.numReads++;
if (numReads == (uint64_t)nextProgressMessage) {
ccprintf(cerr, "%s: completed %d read, %d write accesses @%d\n",
// update the reference data
referenceData[req->getPaddr()] = pkt_data[0];
numWrites++;
- numWritesStat++;
+ stats.numWrites++;
}
}
else if (noResponseEvent.scheduled())
deschedule(noResponseEvent);
}
-
-void
-MemTest::regStats()
+MemTest::MemTestStats::MemTestStats(Stats::Group *parent)
+ : Stats::Group(parent),
+ ADD_STAT(numReads, "number of read accesses completed"),
+ ADD_STAT(numWrites, "number of write accesses completed")
{
- ClockedObject::regStats();
-
- using namespace Stats;
-
- numReadsStat
- .name(name() + ".num_reads")
- .desc("number of read accesses completed")
- ;
- numWritesStat
- .name(name() + ".num_writes")
- .desc("number of write accesses completed")
- ;
}
void
typedef MemTestParams Params;
MemTest(const Params *p);
- void regStats() override;
Port &getPort(const std::string &if_name,
PortID idx=InvalidPortID) override;
const bool atomic;
const bool suppressFuncErrors;
-
- Stats::Scalar numReadsStat;
- Stats::Scalar numWritesStat;
+ protected:
+ struct MemTestStats : public Stats::Group
+ {
+ MemTestStats(Stats::Group *parent);
+ Stats::Scalar numReads;
+ Stats::Scalar numWrites;
+ } stats;
/**
* Complete a request by checking the response.