Hi Zheng,
On 07/18/2013 06:37 PM, Zheng Wu wrote:
I have a system with no last level SHARED cache but each cpu has a PRIVATE last
level cache. For each cpu, i want to monitor the number of cache misses in the
last level (i.e. number of request to main memory). I want to do this on each
cycle/tick of the simulation.
It's probably going to be a bit tricky to do this from the CPU class
since it doesn't know about the structure of the simulated system. It
only knows about the System class itself and the ports it's hooked up
to. Depending on what you need to do, you might want to query the cache
state from Python instead. However, it's probably a bad idea to query
the state on from Python on each CPU cycle.
Basically, I want to implement a way to query this information from
"AtomicSimpleCPU::tick()" function since i am using atomic cpu for simulation.
Any ideas how I can get this information? Any help or comments is much appreciated it!
I needed something similar some time ago. I have a patch [1] on my fixes
branch [2] on GitHub that might help. It exposes the current cache
occupancy to the rest of the world (including Python) by adding the
BaseCache::getOccupancy() method. I have used it to do some clever cache
warming but you could probably use it as a start for what you need to
do. Since I haven't merged it into mainline gem5 yet, you'll have to
merge the changeset from my repository manually.
There should be some support in the cache model for warming caches to a
specific occupancy level already if that's what you really want to do.
Keep in mind that it only works reliably if your application has a data
set that is larger than the cache.
//Andreas
[1]
<https://github.com/andysan/gem5/commits/fixes>https://github.com/andysan/gem5/commit/d1de354f1196c1d4f60656b5c54c3e142578fa9e
[2] https://github.com/andysan/gem5/commits/fixes
<https://github.com/andysan/gem5/commits/fixes>
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users