summaryrefslogtreecommitdiff
path: root/src/mem/cache/cache_impl.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/cache/cache_impl.hh')
-rw-r--r--src/mem/cache/cache_impl.hh40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh
index fc01e2c06..a1d945103 100644
--- a/src/mem/cache/cache_impl.hh
+++ b/src/mem/cache/cache_impl.hh
@@ -279,16 +279,7 @@ Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk,
Cycles &lat, PacketList &writebacks)
{
if (pkt->req->isUncacheable()) {
- if (pkt->req->isClearLL()) {
- tags->clearLocks();
- } else if (pkt->isWrite()) {
- blk = tags->findBlock(pkt->getAddr());
- if (blk != NULL) {
- tags->invalidate(blk);
- blk->invalidate();
- }
- }
-
+ uncacheableFlush(pkt);
blk = NULL;
lat = hitLatency;
return false;
@@ -444,15 +435,7 @@ Cache<TagStore>::timingAccess(PacketPtr pkt)
}
if (pkt->req->isUncacheable()) {
- if (pkt->req->isClearLL()) {
- tags->clearLocks();
- } else if (pkt->isWrite()) {
- BlkType *blk = tags->findBlock(pkt->getAddr());
- if (blk != NULL) {
- tags->invalidate(blk);
- blk->invalidate();
- }
- }
+ uncacheableFlush(pkt);
// writes go in write buffer, reads use MSHR
if (pkt->isWrite() && !pkt->isRead()) {
@@ -1104,6 +1087,25 @@ Cache<TagStore>::invalidateVisitor(BlkType &blk)
}
template<class TagStore>
+void
+Cache<TagStore>::uncacheableFlush(PacketPtr pkt)
+{
+ DPRINTF(Cache, "%s%s %x uncacheable\n", pkt->cmdString(),
+ pkt->req->isInstFetch() ? " (ifetch)" : "",
+ pkt->getAddr());
+
+ if (pkt->req->isClearLL())
+ tags->clearLocks();
+
+ BlkType *blk(tags->findBlock(pkt->getAddr()));
+ if (blk) {
+ writebackVisitor(*blk);
+ invalidateVisitor(*blk);
+ }
+}
+
+
+template<class TagStore>
typename Cache<TagStore>::BlkType*
Cache<TagStore>::allocateBlock(Addr addr, PacketList &writebacks)
{