diff options
author | Lisa Hsu <Lisa.Hsu@amd.com> | 2010-01-12 10:53:02 -0800 |
---|---|---|
committer | Lisa Hsu <Lisa.Hsu@amd.com> | 2010-01-12 10:53:02 -0800 |
commit | 8b4e8690b73f61ae0bb2cb052ec56f58d1d531e2 (patch) | |
tree | 34001c05d1ff8c1a6d30a0356ff2623c49e16a0b /src/mem/cache/cache_impl.hh | |
parent | 9f635484784a9a523fc356df9e55922660d13d8f (diff) | |
download | gem5-8b4e8690b73f61ae0bb2cb052ec56f58d1d531e2.tar.xz |
cache: make tags->insertBlock() and tags->accessBlock() context aware so that the cache can make context-specific decisions within their various tag policy implementations.
Diffstat (limited to 'src/mem/cache/cache_impl.hh')
-rw-r--r-- | src/mem/cache/cache_impl.hh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index 429928c79..2397a17c5 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -266,7 +266,8 @@ Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk, return false; } - blk = tags->accessBlock(pkt->getAddr(), lat); + int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1; + blk = tags->accessBlock(pkt->getAddr(), lat, id); DPRINTF(Cache, "%s%s %x %s\n", pkt->cmdString(), pkt->req->isInstFetch() ? " (ifetch)" : "", @@ -299,7 +300,8 @@ Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk, incMissCount(pkt); return false; } - tags->insertBlock(pkt->getAddr(), blk); + int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1; + tags->insertBlock(pkt->getAddr(), blk, id); blk->status = BlkValid | BlkReadable; } std::memcpy(blk->data, pkt->getPtr<uint8_t>(), blkSize); @@ -976,7 +978,8 @@ Cache<TagStore>::handleFill(PacketPtr pkt, BlkType *blk, tempBlock->tag = tags->extractTag(addr); DPRINTF(Cache, "using temp block for %x\n", addr); } else { - tags->insertBlock(addr, blk); + int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1; + tags->insertBlock(pkt->getAddr(), blk, id); } } else { // existing block... probably an upgrade |