From c7bb14ac7995f550104a92cfa535cc29e0c46371 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 16 Aug 2006 23:39:31 -0400 Subject: [PATCH] DRAM Memory doesn't crash the simulator now.. still untested. --HG-- extra : convert_revision : fa2d2c5ec4073383f1b2b2f466d0245f2d6a6c35 --- src/mem/physical.cc | 10 ++++++---- src/mem/physical.hh | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mem/physical.cc b/src/mem/physical.cc index 5eb89e126..f4fbd2fb1 100644 --- a/src/mem/physical.cc +++ b/src/mem/physical.cc @@ -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 diff --git a/src/mem/physical.hh b/src/mem/physical.hh index c0a5523ba..1489e6700 100644 --- a/src/mem/physical.hh +++ b/src/mem/physical.hh @@ -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); -- 2.30.2