changeset 926802ed1536 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=926802ed1536
description:
        mem: Add checks and explanation for assertMemInhibit usage

diffstat:

 src/mem/cache/cache_impl.hh |  7 ++++++-
 src/mem/packet.hh           |  7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r c99c8d2a7c31 -r 926802ed1536 src/mem/cache/cache_impl.hh
--- a/src/mem/cache/cache_impl.hh       Tue Dec 02 06:07:43 2014 -0500
+++ b/src/mem/cache/cache_impl.hh       Tue Dec 02 06:07:46 2014 -0500
@@ -1693,7 +1693,12 @@
     }
 
     if (respond) {
-        assert(!pkt->memInhibitAsserted());
+        // prevent anyone else from responding, cache as well as
+        // memory, and also prevent any memory from even seeing the
+        // request (with current inhibited semantics), note that this
+        // applies both to reads and writes and that for writes it
+        // works thanks to the fact that we still have dirty data and
+        // will write it back at a later point
         pkt->assertMemInhibit();
         if (have_exclusive) {
             pkt->setSupplyExclusive();
diff -r c99c8d2a7c31 -r 926802ed1536 src/mem/packet.hh
--- a/src/mem/packet.hh Tue Dec 02 06:07:43 2014 -0500
+++ b/src/mem/packet.hh Tue Dec 02 06:07:46 2014 -0500
@@ -504,7 +504,12 @@
     bool isFlush() const        { return cmd.isFlush(); }
 
     // Snoop flags
-    void assertMemInhibit()         { flags.set(MEM_INHIBIT); }
+    void assertMemInhibit()
+    {
+        assert(isRequest());
+        assert(!flags.isSet(MEM_INHIBIT));
+        flags.set(MEM_INHIBIT);
+    }
     bool memInhibitAsserted() const { return flags.isSet(MEM_INHIBIT); }
     void assertShared()             { flags.set(SHARED); }
     bool sharedAsserted() const     { return flags.isSet(SHARED); }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to