*/
#include <algorithm>
+#include <cmath>
#include <string>
#include <vector>
-#include <math.h>
-
-#include "mem/cache/base.hh"
-#include "mem/cache/tags/iic.hh"
#include "base/intmath.hh"
-#include "sim/core.hh" // for curTick
-
-#include "base/trace.hh" // for DPRINTF
-
+#include "base/trace.hh"
+#include "debug/Cache.hh"
+#include "debug/IIC.hh"
+#include "debug/IICMore.hh"
+#include "mem/cache/tags/iic.hh"
+#include "mem/cache/base.hh"
+#include "sim/core.hh"
using namespace std;
tagShift(floorLog2(blkSize)), blkMask(blkSize - 1),
subShift(floorLog2(subSize)), subMask(numSub - 1),
hashDelay(params.hashDelay),
- numBlocks(params.size/subSize),
numTags(hashSets * assoc + params.size/blkSize -1),
numSecondary(params.size/blkSize),
tagNull(numTags),
warmedUp = false;
warmupBound = params.size/blkSize;
+ numBlocks = params.size/subSize;
// Replacement Policy Initialization
repl = params.rp;
.flags(pdf)
;
- repl->regStats(name);
+ repl->regStatsWithSuffix(name);
if (PROFILE_IIC)
setAccess
IICTag*
-IIC::accessBlock(Addr addr, int &lat)
+IIC::accessBlock(Addr addr, int &lat, int context_src)
{
Addr tag = extractTag(addr);
unsigned set = hash(addr);
hitDepthTotal += sets[set].depth;
tag_ptr->status |= BlkReferenced;
lat = set_lat;
- if (tag_ptr->whenReady > curTick && tag_ptr->whenReady - curTick > set_lat) {
- lat = tag_ptr->whenReady - curTick;
+ if (tag_ptr->whenReady > curTick() && tag_ptr->whenReady - curTick() > set_lat) {
+ lat = tag_ptr->whenReady - curTick();
}
tag_ptr->refCount += 1;
}
void
-IIC::insertBlock(Addr addr, BlkType* blk)
+IIC::insertBlock(Addr addr, BlkType* blk, int context_src)
{
}
tag_ptr->size);
*/
Request *writebackReq = new Request(regenerateBlkAddr(tag_ptr->tag, 0),
- blkSize, 0);
- PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback,
- -1);
+ blkSize, 0, Request::wbMasterId);
+ PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback);
writeback->allocate();
memcpy(writeback->getPtr<uint8_t>(), tag_ptr->data, blkSize);
unsigned long
IIC::getFreeDataBlock(PacketList & writebacks)
{
- struct IICTag *tag_ptr;
unsigned long data_ptr;
- tag_ptr = NULL;
/* find data block */
while (blkFreelist.empty()) {
freeReplacementBlock(writebacks);
tagsInUse++;
if (!warmedUp && tagsInUse.value() >= warmupBound) {
warmedUp = true;
- warmupCycle = curTick;
+ warmupCycle = curTick();
}
return tag_ptr;
}
}
+void
+IIC::clearLocks()
+{
+ for (int i = 0; i < numTags; i++){
+ tagStore[i].clearLoadLocks();
+ }
+}
+
void
IIC::cleanupRefs()
{