// if isLoad == 0 it's a store, if isLoad == 1 it's a load VOID dCacheCount(Cache &c, const MSI_STATE &s, ADDRINT iaddr, ADDRINT op, UINT32 opSize, UINT32 idx, UINT32 isLoad, UINT32 isSecondOp) { UINT32 numBytes = opSize; if (! isSecondOp) dCachePC[idx].refs++; for (unsigned int i = 0; i < numBytes; i++) { bool hit = dCache.doCacheStuff(op+i); if (!hit) { dCachePC[idx].miss++; dCacheMiss++; } } }
VOID iCacheCount(ADDRINT iaddr, UINT32 idx) { counter++; //TODO: memory vs. instruction //add data structure to assign blame int numBytes = 16; iCachePC[idx].refs++; for (int i = 0; i < numBytes; i++) { bool hit = iCache.doCacheStuff(iaddr+i); if (!hit) { iCachePC[idx].miss++; iCacheMiss++; } } }