cpu: Add Units to cpu stats

Change-Id: I387b2e9f6ecf62757242056f732bd443c457ebea
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39095
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Hoa Nguyen
2021-01-14 04:10:48 -08:00
parent c5c0dd9a24
commit 65bbd5fa2a
25 changed files with 506 additions and 387 deletions

View File

@@ -191,8 +191,8 @@ MemTest::completeRequest(PacketPtr pkt, bool functional)
}
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")
ADD_STAT(numReads, UNIT_COUNT, "number of read accesses completed"),
ADD_STAT(numWrites, UNIT_COUNT, "number of write accesses completed")
{
}

View File

@@ -331,25 +331,31 @@ BaseTrafficGen::noProgress()
BaseTrafficGen::StatGroup::StatGroup(Stats::Group *parent)
: Stats::Group(parent),
ADD_STAT(numSuppressed,
ADD_STAT(numSuppressed, UNIT_COUNT,
"Number of suppressed packets to non-memory space"),
ADD_STAT(numPackets, "Number of packets generated"),
ADD_STAT(numRetries, "Number of retries"),
ADD_STAT(retryTicks, "Time spent waiting due to back-pressure (ticks)"),
ADD_STAT(bytesRead, "Number of bytes read"),
ADD_STAT(bytesWritten, "Number of bytes written"),
ADD_STAT(totalReadLatency, "Total latency of read requests"),
ADD_STAT(totalWriteLatency, "Total latency of write requests"),
ADD_STAT(totalReads, "Total num of reads"),
ADD_STAT(totalWrites, "Total num of writes"),
ADD_STAT(avgReadLatency, "Avg latency of read requests",
totalReadLatency / totalReads),
ADD_STAT(avgWriteLatency, "Avg latency of write requests",
ADD_STAT(numPackets, UNIT_COUNT, "Number of packets generated"),
ADD_STAT(numRetries, UNIT_COUNT, "Number of retries"),
ADD_STAT(retryTicks, UNIT_TICK,
"Time spent waiting due to back-pressure"),
ADD_STAT(bytesRead, UNIT_BYTE, "Number of bytes read"),
ADD_STAT(bytesWritten, UNIT_BYTE, "Number of bytes written"),
ADD_STAT(totalReadLatency, UNIT_TICK,
"Total latency of read requests"),
ADD_STAT(totalWriteLatency, UNIT_TICK,
"Total latency of write requests"),
ADD_STAT(totalReads, UNIT_COUNT, "Total num of reads"),
ADD_STAT(totalWrites, UNIT_COUNT, "Total num of writes"),
ADD_STAT(avgReadLatency,
UNIT_RATE(Stats::Units::Tick, Stats::Units::Count),
"Avg latency of read requests", totalReadLatency / totalReads),
ADD_STAT(avgWriteLatency,
UNIT_RATE(Stats::Units::Tick, Stats::Units::Count),
"Avg latency of write requests",
totalWriteLatency / totalWrites),
ADD_STAT(readBW, "Read bandwidth in bytes/s",
bytesRead / simSeconds),
ADD_STAT(writeBW, "Write bandwidth in bytes/s",
bytesWritten / simSeconds)
ADD_STAT(readBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second),
"Read bandwidth in bytes/s", bytesRead / simSeconds),
ADD_STAT(writeBW, UNIT_RATE(Stats::Units::Byte, Stats::Units::Second),
"Write bandwidth in bytes/s", bytesWritten / simSeconds)
{
}