summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2013-11-14 15:03:42 -0800
committerSteve Reinhardt <steve.reinhardt@amd.com>2013-11-14 15:03:42 -0800
commita2c21d47a8cd6a1a633491fb58b9d3b1c45c965d (patch)
tree733ee7207bef8cd7277ebd04a275b7a3e5253224
parent99d6c3b7e004477dae9b3f7c59c24056362affd8 (diff)
downloadgem5-a2c21d47a8cd6a1a633491fb58b9d3b1c45c965d.tar.xz
tests: suppress output on switcheroo tests
The output from the switcheroo tests is voluminous and (because it includes timestamps) highly sensitive to minor changes, leading to extremely large updates to the reference outputs. This patch addresses this problem by suppressing output from the tests. An internal parameter can be set to enable the output. Wiring that up to a command-line flag (perhaps even the rudimantary -v/-q options in m5/main.py) is left for future work.
-rw-r--r--src/python/m5/simulate.py7
-rw-r--r--tests/configs/switcheroo.py15
2 files changed, 16 insertions, 6 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index a3ca77af1..322257139 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -218,7 +218,7 @@ def _changeMemoryMode(system, mode):
else:
print "System already in target mode. Memory mode unchanged."
-def switchCpus(system, cpuList, do_drain=True):
+def switchCpus(system, cpuList, do_drain=True, verbose=True):
"""Switch CPUs in a system.
By default, this method drains and resumes the system. This
@@ -238,7 +238,10 @@ def switchCpus(system, cpuList, do_drain=True):
Keyword Arguments:
do_drain -- Perform a drain/resume of the system when switching.
"""
- print "switching cpus"
+
+ if verbose:
+ print "switching cpus"
+
if not isinstance(cpuList, list):
raise RuntimeError, "Must pass a list to this function"
for item in cpuList:
diff --git a/tests/configs/switcheroo.py b/tests/configs/switcheroo.py
index 4b2dd9a69..05d3af2da 100644
--- a/tests/configs/switcheroo.py
+++ b/tests/configs/switcheroo.py
@@ -70,7 +70,7 @@ class Sequential:
def first(self):
return self.cpus[self.first_cpu]
-def run_test(root, switcher=None, freq=1000):
+def run_test(root, switcher=None, freq=1000, verbose=False):
"""Test runner for CPU switcheroo tests.
The switcheroo test runner is used to switch CPUs in a system that
@@ -91,6 +91,7 @@ def run_test(root, switcher=None, freq=1000):
switcher -- CPU switcher implementation. See Sequential for
an example implementation.
period -- Switching frequency in Hz.
+ verbose -- Enable output at each switch (suppressed by default).
"""
if switcher == None:
@@ -100,6 +101,11 @@ def run_test(root, switcher=None, freq=1000):
system = root.system
system.mem_mode = type(current_cpu).memory_mode()
+ # Suppress "Entering event queue" messages since we get tons of them.
+ # Worse yet, they include the timestamp, which makes them highly
+ # variable and unsuitable for comparing as test outputs.
+ m5.internal.core.cvar.want_info = verbose
+
# instantiate configuration
m5.instantiate()
@@ -113,12 +119,13 @@ def run_test(root, switcher=None, freq=1000):
if exit_cause == "simulate() limit reached":
next_cpu = switcher.next()
- print "Switching CPUs..."
- print "Next CPU: %s" % type(next_cpu)
+ if verbose:
+ print "Switching CPUs..."
+ print "Next CPU: %s" % type(next_cpu)
m5.drain(system)
if current_cpu != next_cpu:
m5.switchCpus(system, [ (current_cpu, next_cpu) ],
- do_drain=False)
+ do_drain=False, verbose=verbose)
else:
print "Source CPU and destination CPU are the same, skipping..."
m5.resume(system)