summaryrefslogtreecommitdiff
path: root/tests/configs/base_config.py
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2013-01-07 13:05:52 -0500
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2013-01-07 13:05:52 -0500
commit5fb00e1df6b2b7d9db472d0c25765263ed1b839f (patch)
tree2f94ca554d9f92d1fe737ed98931856e43b52f6a /tests/configs/base_config.py
parente09e9fa279dec86b171b5e3efeb7057fa0d21cc9 (diff)
downloadgem5-5fb00e1df6b2b7d9db472d0c25765263ed1b839f.tar.xz
tests: Add CPU switching tests
This changeset adds a set of tests that stress the CPU switching code. It adds the following test configurations: * tsunami-switcheroo-full -- Alpha system (atomic, timing, O3) * realview-switcheroo-atomic -- ARM system (atomic<->atomic) * realview-switcheroo-timing -- ARM system (timing<->timing) * realview-switcheroo-o3 -- ARM system (O3<->O3) * realview-switcheroo-full -- ARM system (atomic, timing, O3) Reference data is provided for the 10.linux-boot test case. All of the tests trigger a CPU switch once per millisecond during the boot process. The in-order CPU model was not included in any of the tests as it does not support CPU handover.
Diffstat (limited to 'tests/configs/base_config.py')
-rw-r--r--tests/configs/base_config.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/configs/base_config.py b/tests/configs/base_config.py
index 945bcb495..370b76c46 100644
--- a/tests/configs/base_config.py
+++ b/tests/configs/base_config.py
@@ -121,10 +121,13 @@ class BaseSystem(object):
sha_bus = self.create_caches_shared(system)
for cpu in system.cpu:
- self.create_caches_private(cpu)
- self.init_cpu(system, cpu)
- cpu.connectAllPorts(sha_bus if sha_bus != None else system.membus,
- system.membus)
+ 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)
@abstractmethod
def create_system(self):
@@ -173,3 +176,16 @@ class BaseFSSystemUniprocessor(BaseFSSystem):
def create_caches_shared(self, system):
return None
+
+class BaseFSSwitcheroo(BaseFSSystem):
+ """Uniprocessor system prepared for CPU switching"""
+
+ def __init__(self, cpu_classes, **kwargs):
+ BaseFSSystem.__init__(self, **kwargs)
+ self.cpu_classes = tuple(cpu_classes)
+
+ def create_cpus(self):
+ cpus = [ cclass(cpu_id=0, clock='2GHz', switched_out=True)
+ for cclass in self.cpu_classes ]
+ cpus[0].switched_out = False
+ return cpus