Hello Victor,
Ive never used functor(), cant compile right now, and there are very few
examples in gem5 of how to use it (check src/sim/stat_control.cc and
src/unittest/stattest.cc); however, if you are just interested in calculating
the number of zero bytes to extract the percentage, as in Figure 1 of "A robust
main-memory compression scheme", by Ekman et al., a simple Formula should
suffice. Something around the lines of:
// in .hh
Stats::Scalar numZeroBytes;
Stats::Scalar numByteSamples;
Stats::Formula zeroBytePercentage;
// in regStats
zeroBytePercentage = numZeroBytes / numByteSamples;
// on writes
numZeroBytes is increased on every zero byte seen, and numByteSamples for every
byte.
This would save you the space of using that huge vector, and give you the base
values, which will make it easier for you to apply geometric mean to the
results.
Regards,
Daniel
Em quarta-feira, 12 de fevereiro de 2020 03:52:43 GMT+1, Victor Kariofillis
<[email protected]> escreveu:
Hi,
I have created a stat of type Value called zeroBytesPercentage. It is the
percentage of zero bytes of all the lines that are written in the LLC. I want
it to get a value from a function (calcZeroBytesPercentage), so I'm using
functor.
zeroBytesPercentage
.functor(calcZeroBytesPercentage)
.flags(total)
.precision(3)
;
Throughout the program execution I'm populating a vector called totalLines,
which I've declared as public in BaseCache. This vector stores all the cache
lines that are written to the LLC during the execution of the program.
My problem is that the function is not static and that it uses non-static
variables (the totalLines vector). I've tried having the function as a member
of either BaseCache or BaseCache::CacheStats, but either way I'm getting errors
about the use of non-static data members.
How can I do this calculation at the end of the execution and be able to access
variables that are non-static?
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users _______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users