summaryrefslogtreecommitdiff
path: root/tests/configs/base_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/configs/base_config.py')
-rw-r--r--tests/configs/base_config.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/configs/base_config.py b/tests/configs/base_config.py
index b4c400a45..29aec35e7 100644
--- a/tests/configs/base_config.py
+++ b/tests/configs/base_config.py
@@ -104,14 +104,18 @@ class BaseSystem(object):
system.l2c.mem_side = system.membus.slave
return system.toL2Bus
- def init_cpu(self, system, cpu):
+ def init_cpu(self, system, cpu, sha_bus):
"""Initialize a CPU.
Arguments:
system -- System to work on.
cpu -- CPU to initialize.
"""
- cpu.createInterruptController()
+ if not cpu.switched_out:
+ self.create_caches_private(cpu)
+ cpu.createInterruptController()
+ cpu.connectAllPorts(sha_bus if sha_bus != None else system.membus,
+ system.membus)
def init_kvm(self, system):
"""Do KVM-specific system initialization.
@@ -135,13 +139,7 @@ class BaseSystem(object):
sha_bus = self.create_caches_shared(system)
for cpu in system.cpu:
- if not cpu.switched_out:
- self.create_caches_private(cpu)
- self.init_cpu(system, cpu)
- cpu.connectAllPorts(sha_bus if sha_bus != None else system.membus,
- system.membus)
- else:
- self.init_cpu(system, cpu)
+ self.init_cpu(system, cpu, sha_bus)
@abstractmethod
def create_system(self):