Hello Curtis Dunham,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/9021
to review the following change.
Change subject: mem-cache: Allow clean operations when block allocation
fails
......................................................................
mem-cache: Allow clean operations when block allocation fails
Block allocation can fail when there is an in-service MSHR that
operates on the victim block. This can happed due to:
* an upgrade operation: a request that needs a writable copy of the
block finds a shared (non-writable) copy of the block in the cache
and has allocates an MSHR for the pending upgrade operation, or
* a clean operation: a clean request finds a dirty copy of the block
and allocates an MSHR for the pending clean operation.
This changes relaxes an assertion to allow for the 2nd case (cache
clean operations).
Change-Id: Ib51482160b5f2b3702ed744b0eac2029d34bc9d4
Reviewed-by: Curtis Dunham <curtis.dun...@arm.com>
---
M src/mem/cache/cache.cc
M src/mem/cache/mshr.hh
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index 85c9677..9ee9359 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1826,10 +1826,10 @@
Addr repl_addr = tags->regenerateBlkAddr(blk);
MSHR *repl_mshr = mshrQueue.findMatch(repl_addr, blk->isSecure());
if (repl_mshr) {
- // must be an outstanding upgrade request
+ // must be an outstanding upgrade or clean request
// on a block we're about to replace...
- assert(!blk->isWritable() || blk->isDirty());
- assert(repl_mshr->needsWritable());
+ assert((!blk->isWritable() && repl_mshr->needsWritable()) ||
+ repl_mshr->isCleaning());
// too hard to replace block with transient state
// allocation failed, block not inserted
return nullptr;
diff --git a/src/mem/cache/mshr.hh b/src/mem/cache/mshr.hh
index 1f59607..9f6374d 100644
--- a/src/mem/cache/mshr.hh
+++ b/src/mem/cache/mshr.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2013, 2015-2016 ARM Limited
+ * Copyright (c) 2012-2013, 2015-2016, 2018 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
@@ -247,6 +247,12 @@
assert(inService); return postDowngrade;
}
+ bool isCleaning() const {
+ assert(inService);
+ PacketPtr pkt = targets.front().pkt;
+ return pkt->isClean();
+ }
+
bool sendPacket(Cache &cache);
bool allocOnFill() const {
--
To view, visit https://gem5-review.googlesource.com/9021
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib51482160b5f2b3702ed744b0eac2029d34bc9d4
Gerrit-Change-Number: 9021
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-Reviewer: Curtis Dunham <curtis.dun...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev