Checkpointing: Fix a bug in the simulation script when restoring without standard...
authorAli Saidi <saidi@eecs.umich.edu>
Tue, 18 Dec 2007 06:52:57 +0000 (01:52 -0500)
committerAli Saidi <saidi@eecs.umich.edu>
Tue, 18 Dec 2007 06:52:57 +0000 (01:52 -0500)
--HG--
extra : convert_revision : 72507cf13e58465291b0dce6322e853bee5a2b89

configs/common/Simulation.py
src/cpu/base.cc

index 84628b3474844c5b3004905330790b111a27bc91..1ff36c5d0d4529291028c605d3b44bd0c2d64065 100644 (file)
@@ -91,7 +91,7 @@ def run(options, root, testsys, cpu_class):
                 switch_cpus[i].workload = testsys.cpu[i].workload
             switch_cpus[i].clock = testsys.cpu[0].clock
 
-        root.switch_cpus = switch_cpus
+        testsys.switch_cpus = switch_cpus
         switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]
 
     if options.standard_switch:
index 7b04f5a9036bf4559f8f4c22ee1249350cc36f68..677152ce8701c65291990e284bf3e87f1878d3eb 100644 (file)
@@ -352,7 +352,7 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU, Port *ic, Port *dc)
     // connected to anything.  Also connect old CPU's memory to new
     // CPU.
     Port *peer;
-    if (ic->getPeer() == NULL) {
+    if (ic->getPeer() == NULL || ic->getPeer()->isDefaultPort()) {
         peer = oldCPU->getPort("icache_port")->getPeer();
         ic->setPeer(peer);
     } else {
@@ -360,7 +360,7 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU, Port *ic, Port *dc)
     }
     peer->setPeer(ic);
 
-    if (dc->getPeer() == NULL) {
+    if (dc->getPeer() == NULL || dc->getPeer()->isDefaultPort()) {
         peer = oldCPU->getPort("dcache_port")->getPeer();
         dc->setPeer(peer);
     } else {