Couple more minor bug fixes for FS timing mode.
authorSteve Reinhardt <stever@eecs.umich.edu>
Mon, 2 Jul 2007 20:57:45 +0000 (13:57 -0700)
committerSteve Reinhardt <stever@eecs.umich.edu>
Mon, 2 Jul 2007 20:57:45 +0000 (13:57 -0700)
src/cpu/simple/timing.cc:
    Fix another SC problem.
src/mem/cache/cache_impl.hh:
    Forgot to call makeTimingResponse() on uncached timing responses.

--HG--
extra : convert_revision : 5a5a58ca2053e4e8de2133205bfd37de15eb4209

src/cpu/simple/timing.cc
src/mem/cache/cache_impl.hh

index 492a669b89304079e3ac066d486b6eea871de4ff..0c03815b532760aac29d3b18d65f792ac2fb80f6 100644 (file)
@@ -356,8 +356,6 @@ TimingSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
         MemCmd cmd = MemCmd::WriteReq; // default
         bool do_access = true;  // flag to suppress cache access
 
-        assert(dcache_pkt == NULL);
-
         if (req->isLocked()) {
             cmd = MemCmd::StoreCondReq;
             do_access = TheISA::handleLockedWrite(thread, req);
@@ -369,11 +367,14 @@ TimingSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
             }
         }
 
-        if (do_access) {
-            dcache_pkt = new Packet(req, cmd, Packet::Broadcast);
-            dcache_pkt->allocate();
-            dcache_pkt->set(data);
+        // Note: need to allocate dcache_pkt even if do_access is
+        // false, as it's used unconditionally to call completeAcc().
+        assert(dcache_pkt == NULL);
+        dcache_pkt = new Packet(req, cmd, Packet::Broadcast);
+        dcache_pkt->allocate();
+        dcache_pkt->set(data);
 
+        if (do_access) {
             if (!dcachePort.sendTiming(dcache_pkt)) {
                 _status = DcacheRetry;
             } else {
index b4c3c6359027409ed470a8b0581b9fd5d4cee090..0d76b6bec4caf5b7704022664c951b959ebc0ca5 100644 (file)
@@ -698,6 +698,7 @@ Cache<TagStore>::handleResponse(PacketPtr pkt)
             if (pkt->isRead()) {
                 target->pkt->setData(pkt->getPtr<uint8_t>());
             }
+            target->pkt->makeTimingResponse();
             cpuSidePort->respond(target->pkt, time);
         }
         assert(!mshr->hasTargets());