From 427ceb57a9e1c7e226a549fda4556211bf206066 Mon Sep 17 00:00:00 2001 From: "Timothy M. Jones" Date: Fri, 24 Jan 2014 15:29:30 -0600 Subject: Cache: Collect very basic stats on tag and data accesses Adds very basic statistics on the number of tag and data accesses within the cache, which is important for power modelling. For the tags, simply count the associativity of the cache each time. For the data, this depends on whether tags and data are accessed sequentially, which is given by a new parameter. In the parallel case, all data blocks are accessed each time, but with sequential accesses, a single data block is accessed only on a hit. --- src/mem/cache/tags/base.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mem/cache/tags/base.cc') diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc index b669a5b06..446c1ea49 100644 --- a/src/mem/cache/tags/base.cc +++ b/src/mem/cache/tags/base.cc @@ -147,6 +147,16 @@ BaseTags::regStats() percentOccsTaskId = occupanciesTaskId / Stats::constant(numBlocks); + tagAccesses + .name(name() + ".tag_accesses") + .desc("Number of tag accesses") + ; + + dataAccesses + .name(name() + ".data_accesses") + .desc("Number of data accesses") + ; + registerDumpCallback(new BaseTagsDumpCallback(this)); registerExitCallback(new BaseTagsCallback(this)); } -- cgit v1.2.3