diff options
author | Gene Wu <Gene.Wu@arm.com> | 2010-08-23 11:18:41 -0500 |
---|---|---|
committer | Gene Wu <Gene.Wu@arm.com> | 2010-08-23 11:18:41 -0500 |
commit | d6736384b2bb280ec12d472cac6eb25a70b4af60 (patch) | |
tree | 4ab72a9724a1f349a6c9ddc3088e73d7cebd7f90 /src/mem/cache/cache_impl.hh | |
parent | 23626d99af9469b5a86f510e0542846f5af65cbd (diff) | |
download | gem5-d6736384b2bb280ec12d472cac6eb25a70b4af60.tar.xz |
MEM: Make CLREX a first class request operation and clear locks in caches when it in received
Diffstat (limited to 'src/mem/cache/cache_impl.hh')
-rw-r--r-- | src/mem/cache/cache_impl.hh | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index e472b2601..d471b293a 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -273,12 +273,14 @@ bool Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk, int &lat, PacketList &writebacks) { - int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1; - blk = tags->accessBlock(pkt->getAddr(), lat, id); - - if (pkt->req->isUncacheable()) { - if (blk != NULL) { - tags->invalidateBlk(blk); + if (pkt->req->isUncacheable()) { + if (pkt->req->isClrex()) { + tags->clearLocks(); + } else { + blk = tags->findBlock(pkt->getAddr()); + if (blk != NULL) { + tags->invalidateBlk(blk); + } } blk = NULL; @@ -286,6 +288,8 @@ Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk, return false; } + 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)" : "", @@ -410,11 +414,13 @@ Cache<TagStore>::timingAccess(PacketPtr pkt) } if (pkt->req->isUncacheable()) { - int lat = hitLatency; - int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1; - BlkType *blk = tags->accessBlock(pkt->getAddr(), lat, id); - if (blk != NULL) { - tags->invalidateBlk(blk); + if (pkt->req->isClrex()) { + tags->clearLocks(); + } else { + BlkType *blk = tags->findBlock(pkt->getAddr()); + if (blk != NULL) { + tags->invalidateBlk(blk); + } } // writes go in write buffer, reads use MSHR |