changeset 156f74caf0d4 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=156f74caf0d4
description:
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:
tests/SConscript
| 9 +-
tests/configs/alpha_generic.py
| 7 +
tests/configs/arm_generic.py
| 8 +
tests/configs/base_config.py
| 24 +-
tests/configs/realview-switcheroo-atomic.py
| 48 +
tests/configs/realview-switcheroo-full.py
| 48 +
tests/configs/realview-switcheroo-o3.py
| 48 +
tests/configs/realview-switcheroo-timing.py
| 48 +
tests/configs/switcheroo.py
| 138 +
tests/configs/tsunami-switcheroo-full.py
| 48 +
tests/long/fs/10.linux-boot/ref/alpha/linux/tsunami-switcheroo-full/config.ini
| 1265 +
tests/long/fs/10.linux-boot/ref/alpha/linux/tsunami-switcheroo-full/simerr
| 9 +
tests/long/fs/10.linux-boot/ref/alpha/linux/tsunami-switcheroo-full/simout
| 6245 +++++
tests/long/fs/10.linux-boot/ref/alpha/linux/tsunami-switcheroo-full/stats.txt
| 1554 +
tests/long/fs/10.linux-boot/ref/alpha/linux/tsunami-switcheroo-full/system.terminal
| 108 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-full/config.ini
| 1204 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-full/simerr
| 28 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-full/simout
| 4106 +++
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-full/stats.txt
| 1572 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-full/system.terminal
| 0
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-o3/config.ini
| 1457 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-o3/simerr
| 18 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-o3/simout
| 2620 ++
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-o3/stats.txt
| 1684 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-o3/system.terminal
| 0
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-timing/config.ini
| 795 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-timing/simerr
| 40 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-timing/simout
| 10763 ++++++++++
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-timing/stats.txt
| 1067 +
tests/long/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-timing/system.terminal
| 0
tests/quick/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-atomic/config.ini
| 803 +
tests/quick/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-atomic/simerr
| 22 +
tests/quick/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-atomic/simout
| 9344 ++++++++
tests/quick/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-atomic/stats.txt
| 689 +
tests/quick/fs/10.linux-boot/ref/arm/linux/realview-switcheroo-atomic/system.terminal
| 0
tests/run.py
| 18 +-
36 files changed, 45824 insertions(+), 13 deletions(-)
diffs (truncated from 46118 to 300 lines):
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/SConscript
--- a/tests/SConscript Mon Jan 07 13:05:48 2013 -0500
+++ b/tests/SConscript Mon Jan 07 13:05:52 2013 -0500
@@ -301,7 +301,8 @@
'tsunami-simple-timing-dual',
'twosys-tsunami-simple-atomic',
'tsunami-o3', 'tsunami-o3-dual',
- 'tsunami-inorder']
+ 'tsunami-inorder',
+ 'tsunami-switcheroo-full']
if env['TARGET_ISA'] == 'sparc':
configs += ['t1000-simple-atomic',
't1000-simple-timing']
@@ -314,7 +315,11 @@
'realview-simple-timing-dual',
'realview-o3',
'realview-o3-checker',
- 'realview-o3-dual']
+ 'realview-o3-dual',
+ 'realview-switcheroo-atomic',
+ 'realview-switcheroo-timing',
+ 'realview-switcheroo-o3',
+ 'realview-switcheroo-full']
if env['TARGET_ISA'] == 'x86':
configs += ['pc-simple-atomic',
'pc-simple-timing',
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/alpha_generic.py
--- a/tests/configs/alpha_generic.py Mon Jan 07 13:05:48 2013 -0500
+++ b/tests/configs/alpha_generic.py Mon Jan 07 13:05:52 2013 -0500
@@ -91,3 +91,10 @@
def __init__(self, **kwargs):
BaseFSSystemUniprocessor.__init__(self, **kwargs)
LinuxAlphaSystemBuilder.__init__(self)
+
+class LinuxAlphaFSSwitcheroo(LinuxAlphaSystemBuilder, BaseFSSwitcheroo):
+ """Uniprocessor Alpha system prepared for CPU switching"""
+
+ def __init__(self, **kwargs):
+ BaseFSSwitcheroo.__init__(self, **kwargs)
+ LinuxAlphaSystemBuilder.__init__(self)
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/arm_generic.py
--- a/tests/configs/arm_generic.py Mon Jan 07 13:05:48 2013 -0500
+++ b/tests/configs/arm_generic.py Mon Jan 07 13:05:52 2013 -0500
@@ -93,3 +93,11 @@
def __init__(self, machine_type='RealView_PBX', **kwargs):
BaseFSSystemUniprocessor.__init__(self, **kwargs)
LinuxArmSystemBuilder.__init__(self, machine_type)
+
+
+class LinuxArmFSSwitcheroo(LinuxArmSystemBuilder, BaseFSSwitcheroo):
+ """Uniprocessor ARM system prepared for CPU switching"""
+
+ def __init__(self, machine_type='RealView_PBX', **kwargs):
+ BaseFSSwitcheroo.__init__(self, **kwargs)
+ LinuxArmSystemBuilder.__init__(self, machine_type)
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/base_config.py
--- a/tests/configs/base_config.py Mon Jan 07 13:05:48 2013 -0500
+++ b/tests/configs/base_config.py Mon Jan 07 13:05:52 2013 -0500
@@ -121,10 +121,13 @@
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 @@
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
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/realview-switcheroo-atomic.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/configs/realview-switcheroo-atomic.py Mon Jan 07 13:05:52
2013 -0500
@@ -0,0 +1,48 @@
+# Copyright (c) 2012 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder. You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Andreas Sandberg
+
+from m5.objects import *
+from arm_generic import *
+import switcheroo
+
+root = LinuxArmFSSwitcheroo(
+ cpu_classes=(AtomicSimpleCPU, AtomicSimpleCPU)
+ ).create_root()
+
+# Setup a custom test method that uses the switcheroo tester that
+# switches between CPU models.
+run_test = switcheroo.run_test
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/realview-switcheroo-full.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/configs/realview-switcheroo-full.py Mon Jan 07 13:05:52 2013 -0500
@@ -0,0 +1,48 @@
+# Copyright (c) 2012 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder. You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Andreas Sandberg
+
+from m5.objects import *
+from arm_generic import *
+import switcheroo
+
+root = LinuxArmFSSwitcheroo(
+ cpu_classes=(AtomicSimpleCPU, TimingSimpleCPU, DerivO3CPU)
+ ).create_root()
+
+# Setup a custom test method that uses the switcheroo tester that
+# switches between CPU models.
+run_test = switcheroo.run_test
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/realview-switcheroo-o3.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/configs/realview-switcheroo-o3.py Mon Jan 07 13:05:52 2013 -0500
@@ -0,0 +1,48 @@
+# Copyright (c) 2012 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder. You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Andreas Sandberg
+
+from m5.objects import *
+from arm_generic import *
+import switcheroo
+
+root = LinuxArmFSSwitcheroo(
+ cpu_classes=(DerivO3CPU, DerivO3CPU)
+ ).create_root()
+
+# Setup a custom test method that uses the switcheroo tester that
+# switches between CPU models.
+run_test = switcheroo.run_test
diff -r 644f2a2c9bfc -r 156f74caf0d4 tests/configs/realview-switcheroo-timing.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/configs/realview-switcheroo-timing.py Mon Jan 07 13:05:52
2013 -0500
@@ -0,0 +1,48 @@
+# Copyright (c) 2012 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder. You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Andreas Sandberg
+
+from m5.objects import *
+from arm_generic import *
+import switcheroo
+
+root = LinuxArmFSSwitcheroo(
+ cpu_classes=(TimingSimpleCPU, TimingSimpleCPU)
+ ).create_root()
+
+# Setup a custom test method that uses the switcheroo tester that
+# switches between CPU models.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev