DRAM Memory doesn't crash the simulator now.. still untested.
authorAli Saidi <saidi@eecs.umich.edu>
Thu, 17 Aug 2006 03:39:31 +0000 (23:39 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Thu, 17 Aug 2006 03:39:31 +0000 (23:39 -0400)
--HG--
extra : convert_revision : fa2d2c5ec4073383f1b2b2f466d0245f2d6a6c35

src/mem/physical.cc
src/mem/physical.hh

index 5eb89e1265f12858af2b739555a327eb8c4470ae..f4fbd2fb19cadea83f597fa8fdb65350cc717e35 100644 (file)
@@ -110,7 +110,7 @@ PhysicalMemory::calculateLatency(Packet *pkt)
     return lat;
 }
 
-Tick
+void
 PhysicalMemory::doFunctionalAccess(Packet *pkt)
 {
     assert(pkt->getAddr() + pkt->getSize() < params()->addrRange.size());
@@ -136,7 +136,6 @@ PhysicalMemory::doFunctionalAccess(Packet *pkt)
     }
 
     pkt->result = Packet::Success;
-    return calculateLatency(pkt);
 }
 
 Port *
@@ -197,7 +196,9 @@ PhysicalMemory::MemoryPort::recvTiming(Packet *pkt)
 {
     assert(pkt->result != Packet::Nacked);
 
-    Tick latency = memory->doFunctionalAccess(pkt);
+    Tick latency = memory->calculateLatency(pkt);
+
+    memory->doFunctionalAccess(pkt);
 
     pkt->makeTimingResponse();
     sendTiming(pkt, latency);
@@ -208,7 +209,8 @@ PhysicalMemory::MemoryPort::recvTiming(Packet *pkt)
 Tick
 PhysicalMemory::MemoryPort::recvAtomic(Packet *pkt)
 {
-    return memory->doFunctionalAccess(pkt);
+    memory->doFunctionalAccess(pkt);
+    return memory->calculateLatency(pkt);
 }
 
 void
index c0a5523ba6c3518b77974ed956b52798dae37694..1489e67002ae6684a89c9ba4f6cc512d4edd122e 100644 (file)
@@ -112,7 +112,7 @@ class PhysicalMemory : public MemObject
     unsigned int drain(Event *de);
 
   protected:
-    Tick doFunctionalAccess(Packet *pkt);
+    void doFunctionalAccess(Packet *pkt);
     virtual Tick calculateLatency(Packet *pkt);
     void recvStatusChange(Port::Status status);