Fix caches plus sampling switch over.
authorKevin Lim <ktlim@umich.edu>
Mon, 9 Oct 2006 23:13:06 +0000 (19:13 -0400)
committerKevin Lim <ktlim@umich.edu>
Mon, 9 Oct 2006 23:13:06 +0000 (19:13 -0400)
src/cpu/o3/cpu.cc:
    Fix up caches plus sampling switch over.

--HG--
extra : convert_revision : 49d0c16d4c5e8d5ba83749d568a4efe3b42e3a97

src/cpu/o3/cpu.cc
src/cpu/simple/timing.cc

index fc65c5d99dfa2ce03304742a4d88550ccb980834..d1d25dd7feb43ae5ce9cc62dfa1090133d9e67e0 100644 (file)
@@ -960,7 +960,7 @@ FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
     Port *peer;
     Port *icachePort = fetch.getIcachePort();
     if (icachePort->getPeer() == NULL) {
-        peer = oldCPU->getPort("icachePort")->getPeer();
+        peer = oldCPU->getPort("icache_port")->getPeer();
         icachePort->setPeer(peer);
     } else {
         peer = icachePort->getPeer();
@@ -969,7 +969,7 @@ FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU)
 
     Port *dcachePort = iew.getDcachePort();
     if (dcachePort->getPeer() == NULL) {
-        Port *peer = oldCPU->getPort("dcachePort")->getPeer();
+        peer = oldCPU->getPort("dcache_port")->getPeer();
         dcachePort->setPeer(peer);
     } else {
         peer = dcachePort->getPeer();
index 015fdf8bcb760cd3d6aa71debeea44868f4dd64d..9bed5dab12b73a37fe0575d59a301aa4d4efd595 100644 (file)
@@ -191,9 +191,13 @@ TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
         }
     }
 
+    if (_status != Running) {
+        _status = Idle;
+    }
+
     Port *peer;
     if (icachePort.getPeer() == NULL) {
-        peer = oldCPU->getPort("icachePort")->getPeer();
+        peer = oldCPU->getPort("icache_port")->getPeer();
         icachePort.setPeer(peer);
     } else {
         peer = icachePort.getPeer();
@@ -201,7 +205,7 @@ TimingSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
     peer->setPeer(&icachePort);
 
     if (dcachePort.getPeer() == NULL) {
-        peer = oldCPU->getPort("dcachePort")->getPeer();
+        peer = oldCPU->getPort("dcache_port")->getPeer();
         dcachePort.setPeer(peer);
     } else {
         peer = dcachePort.getPeer();
@@ -545,21 +549,20 @@ TimingSimpleCPU::completeDataAccess(Packet *pkt)
     numCycles += curTick - previousTick;
     previousTick = curTick;
 
-    if (getState() == SimObject::Draining) {
-        completeDrain();
-
-        delete pkt->req;
-        delete pkt;
-
-        return;
-    }
-
     Fault fault = curStaticInst->completeAcc(pkt, this, traceData);
 
     delete pkt->req;
     delete pkt;
 
     postExecute();
+
+    if (getState() == SimObject::Draining) {
+        advancePC(fault);
+        completeDrain();
+
+        return;
+    }
+
     advanceInst(fault);
 }