Posted (April 22, 2011, 11:51 a.m.)
-
src/mem/cache/base.hh (Diff revision 1) -
This can pretty easily be done with a template: template <class STAT> void incThreadVectorStat(PacketPtr pkt, STAT &stat) { } I'm pretty sure that you could even do this: template <class STAT> STAT::Proxy & getThreadVectorStat(PacketPtr pkt, STAT &stat[]) { if (pkt->req->hasContextId()) { return stat[pkt->cmdToIndex()][pkt->req->contextId() % _numSharingContexts]; } else { assert(pkt->req->contextId() == -1); assert(FULL_SYSTEM); return stat[pkt->cmdToIndex()][_numSharingContexts]; } And do this: getThreadVectorStat(pkt, misses)++; getThreadVectorStat(pkt, misses) += 1; Actually, it may just be cleaner to have a function that returns the index. Then you don't need all of the template mubmo jumbo. -
src/mem/cache/base.hh (Diff revision 1) -
_numSharingContexts has the + 1 in it for devices. Is that a problem? Seems like you need a parameter to know that.
-
src/mem/cache/base.hh (Diff revision 1) -
Maybe you can use a constant to indicate the -1 is a device. Also, let's make sure that you initialize to something other than -1.
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
This makes me think that some sort of index function is the right way to go.
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
Is it not possible to figure out which thread caused the wb?
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
I think we should force context IDs to be set even by devices.
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
Index function.
