diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2016-10-14 10:37:38 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2016-10-14 10:37:38 -0400 |
commit | 2f5262eb67f0539ab6c07d56eeae1b72f6b6b509 (patch) | |
tree | 1261b4decbb504ce2836b77207466c98d6a327a4 /tests/configs | |
parent | 824c87634d2d0606f9f62e8a3383c9a056069125 (diff) | |
download | gem5-2f5262eb67f0539ab6c07d56eeae1b72f6b6b509.tar.xz |
config: Make configs/common a Python package
Continue along the same line as the recent patch that made the
Ruby-related config scripts Python packages and make also the
configs/common directory a package.
All affected config scripts are updated (hopefully).
Note that this change makes it apparent that the current organisation
and naming of the config directory and its subdirectories is rather
chaotic. We mix scripts that are directly invoked with scripts that
merely contain convenience functions. While it is not addressed in
this patch we should follow up with a re-organisation of the
config structure, and renaming of some of the packages.
Diffstat (limited to 'tests/configs')
28 files changed, 45 insertions, 57 deletions
diff --git a/tests/configs/alpha_generic.py b/tests/configs/alpha_generic.py index a4ebba54d..a5be4f205 100644 --- a/tests/configs/alpha_generic.py +++ b/tests/configs/alpha_generic.py @@ -39,9 +39,9 @@ from abc import ABCMeta, abstractmethod import m5 from m5.objects import * from m5.proxy import * -m5.util.addToPath('../configs/common') -import FSConfig -from Caches import * +m5.util.addToPath('../configs/') +from common import FSConfig +from common.Caches import * from base_config import * class LinuxAlphaSystemBuilder(object): diff --git a/tests/configs/arm_generic.py b/tests/configs/arm_generic.py index 04823973d..12a876a48 100644 --- a/tests/configs/arm_generic.py +++ b/tests/configs/arm_generic.py @@ -39,12 +39,12 @@ from abc import ABCMeta, abstractmethod import m5 from m5.objects import * from m5.proxy import * -m5.util.addToPath('../configs/common') -import FSConfig -from Caches import * +m5.util.addToPath('../configs/') +from common import FSConfig +from common.Caches import * from base_config import * -from O3_ARM_v7a import * -from Benchmarks import SysConfig +from common.O3_ARM_v7a import * +from common.Benchmarks import SysConfig class ArmSESystemUniprocessor(BaseSESystemUniprocessor): """Syscall-emulation builder for ARM uniprocessor systems. diff --git a/tests/configs/base_config.py b/tests/configs/base_config.py index 860b84fa4..6af6408fe 100644 --- a/tests/configs/base_config.py +++ b/tests/configs/base_config.py @@ -40,9 +40,9 @@ from abc import ABCMeta, abstractmethod import m5 from m5.objects import * from m5.proxy import * -m5.util.addToPath('../configs/common') -import FSConfig -from Caches import * +m5.util.addToPath('../configs/') +from common import FSConfig +from common.Caches import * _have_kvm_support = 'BaseKvmCPU' in globals() diff --git a/tests/configs/checkpoint.py b/tests/configs/checkpoint.py index 5ca3d07b7..bea481be5 100644 --- a/tests/configs/checkpoint.py +++ b/tests/configs/checkpoint.py @@ -40,7 +40,6 @@ import sys import os import m5 -m5.util.addToPath('../configs/common') _exit_normal = ( "target called exit()", diff --git a/tests/configs/gpu-randomtest-ruby.py b/tests/configs/gpu-randomtest-ruby.py index 0bc386973..d0a891880 100644 --- a/tests/configs/gpu-randomtest-ruby.py +++ b/tests/configs/gpu-randomtest-ruby.py @@ -39,11 +39,10 @@ from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys -m5.util.addToPath('../configs/common') m5.util.addToPath('../configs/') from ruby import Ruby -import Options +from common import Options parser = optparse.OptionParser() Options.addCommonOptions(parser) diff --git a/tests/configs/gpu-ruby.py b/tests/configs/gpu-ruby.py index b01914780..6b20c31e8 100644 --- a/tests/configs/gpu-ruby.py +++ b/tests/configs/gpu-ruby.py @@ -39,12 +39,11 @@ from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys, math, glob -m5.util.addToPath('../configs/common') m5.util.addToPath('../configs/') from ruby import Ruby -import Options -import GPUTLBOptions, GPUTLBConfig +from common import Options +from common import GPUTLBOptions, GPUTLBConfig ########################## Script Options ######################## def setOption(parser, opt_str, value = 1): diff --git a/tests/configs/learning-gem5-p1-two-level.py b/tests/configs/learning-gem5-p1-two-level.py index 8101de318..c0a1e4662 100644 --- a/tests/configs/learning-gem5-p1-two-level.py +++ b/tests/configs/learning-gem5-p1-two-level.py @@ -45,7 +45,7 @@ def run_test(root): # Add paths that we need m5.util.addToPath('../configs/learning_gem5/part1') - m5.util.addToPath('../configs/common') + m5.util.addToPath('../configs/') # The path to this script is the only parameter. Delete it so we can # execute the script that we want to execute. diff --git a/tests/configs/memtest-filter.py b/tests/configs/memtest-filter.py index 34ac75f00..90ad0421c 100644 --- a/tests/configs/memtest-filter.py +++ b/tests/configs/memtest-filter.py @@ -28,8 +28,8 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') -from Caches import * +m5.util.addToPath('../configs/') +from common.Caches import * #MAX CORES IS 8 with the fals sharing method nb_cores = 8 diff --git a/tests/configs/memtest-ruby.py b/tests/configs/memtest-ruby.py index 1fac02a14..8b92af45c 100644 --- a/tests/configs/memtest-ruby.py +++ b/tests/configs/memtest-ruby.py @@ -33,11 +33,10 @@ from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys -m5.util.addToPath('../configs/common') m5.util.addToPath('../configs/') from ruby import Ruby -import Options +from common import Options parser = optparse.OptionParser() Options.addCommonOptions(parser) diff --git a/tests/configs/memtest.py b/tests/configs/memtest.py index 5bbfeb774..db7a5ef22 100644 --- a/tests/configs/memtest.py +++ b/tests/configs/memtest.py @@ -28,8 +28,8 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') -from Caches import * +m5.util.addToPath('../configs/') +from common.Caches import * #MAX CORES IS 8 with the fals sharing method nb_cores = 8 diff --git a/tests/configs/o3-timing-mp-ruby.py b/tests/configs/o3-timing-mp-ruby.py index 74b207b3e..9248b08fb 100644 --- a/tests/configs/o3-timing-mp-ruby.py +++ b/tests/configs/o3-timing-mp-ruby.py @@ -28,7 +28,6 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') nb_cores = 4 cpus = [ DerivO3CPU(cpu_id=i) for i in xrange(nb_cores) ] diff --git a/tests/configs/o3-timing-mt.py b/tests/configs/o3-timing-mt.py index 5c6ca4800..3802941ab 100644 --- a/tests/configs/o3-timing-mt.py +++ b/tests/configs/o3-timing-mt.py @@ -42,7 +42,7 @@ from m5.objects import * from m5.defines import buildEnv from base_config import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 # If we are running ARM regressions, use a more sensible CPU # configuration. This makes the results more meaningful, and also diff --git a/tests/configs/o3-timing-ruby.py b/tests/configs/o3-timing-ruby.py index 787ae0bad..81914957b 100644 --- a/tests/configs/o3-timing-ruby.py +++ b/tests/configs/o3-timing-ruby.py @@ -28,8 +28,6 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') - import ruby_config ruby_memory = ruby_config.generate("TwoLevel_SplitL1UnifiedL2.rb", 1) diff --git a/tests/configs/o3-timing.py b/tests/configs/o3-timing.py index 7aa4793ac..c573277d1 100644 --- a/tests/configs/o3-timing.py +++ b/tests/configs/o3-timing.py @@ -42,7 +42,7 @@ from m5.objects import * from m5.defines import buildEnv from base_config import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 # If we are running ARM regressions, use a more sensible CPU # configuration. This makes the results more meaningful, and also diff --git a/tests/configs/pc-simple-timing-ruby.py b/tests/configs/pc-simple-timing-ruby.py index 32964a875..19c38dc32 100644 --- a/tests/configs/pc-simple-timing-ruby.py +++ b/tests/configs/pc-simple-timing-ruby.py @@ -28,13 +28,11 @@ import m5, os, optparse, sys from m5.objects import * -m5.util.addToPath('../configs/common') -from Benchmarks import SysConfig -import FSConfig - m5.util.addToPath('../configs/') +from common.Benchmarks import SysConfig +from common import FSConfig from ruby import Ruby -import Options +from common import Options # Add the ruby specific and protocol specific options parser = optparse.OptionParser() diff --git a/tests/configs/realview-o3-checker.py b/tests/configs/realview-o3-checker.py index aa9f53dd1..a2f1c7134 100644 --- a/tests/configs/realview-o3-checker.py +++ b/tests/configs/realview-o3-checker.py @@ -37,7 +37,7 @@ from m5.objects import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 root = LinuxArmFSSystemUniprocessor(mem_mode='timing', mem_class=DDR3_1600_x64, diff --git a/tests/configs/realview-o3-dual.py b/tests/configs/realview-o3-dual.py index 1df536f89..9dff95ac7 100644 --- a/tests/configs/realview-o3-dual.py +++ b/tests/configs/realview-o3-dual.py @@ -37,7 +37,7 @@ from m5.objects import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 root = LinuxArmFSSystem(mem_mode='timing', mem_class=DDR3_1600_x64, diff --git a/tests/configs/realview-o3.py b/tests/configs/realview-o3.py index 81b52d97c..ba4ddde52 100644 --- a/tests/configs/realview-o3.py +++ b/tests/configs/realview-o3.py @@ -37,7 +37,7 @@ from m5.objects import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 root = LinuxArmFSSystemUniprocessor(mem_mode='timing', mem_class=DDR3_1600_x64, diff --git a/tests/configs/realview64-o3-checker.py b/tests/configs/realview64-o3-checker.py index 0cd323b8a..904f0b718 100644 --- a/tests/configs/realview64-o3-checker.py +++ b/tests/configs/realview64-o3-checker.py @@ -37,7 +37,7 @@ from m5.objects import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 root = LinuxArmFSSystemUniprocessor(machine_type='VExpress_EMM64', mem_mode='timing', diff --git a/tests/configs/realview64-o3-dual.py b/tests/configs/realview64-o3-dual.py index 55f923e96..bdfaac0dc 100644 --- a/tests/configs/realview64-o3-dual.py +++ b/tests/configs/realview64-o3-dual.py @@ -37,7 +37,7 @@ from m5.objects import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 root = LinuxArmFSSystem(machine_type='VExpress_EMM64', mem_mode='timing', diff --git a/tests/configs/realview64-o3.py b/tests/configs/realview64-o3.py index 97f97dd65..b54defa73 100644 --- a/tests/configs/realview64-o3.py +++ b/tests/configs/realview64-o3.py @@ -37,7 +37,7 @@ from m5.objects import * from arm_generic import * -from O3_ARM_v7a import O3_ARM_v7a_3 +from common.O3_ARM_v7a import O3_ARM_v7a_3 root = LinuxArmFSSystemUniprocessor(machine_type='VExpress_EMM64', mem_mode='timing', diff --git a/tests/configs/rubytest-ruby.py b/tests/configs/rubytest-ruby.py index 6e64785da..5445e8181 100644 --- a/tests/configs/rubytest-ruby.py +++ b/tests/configs/rubytest-ruby.py @@ -34,11 +34,10 @@ from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys -m5.util.addToPath('../configs/common') m5.util.addToPath('../configs/') from ruby import Ruby -import Options +from common import Options parser = optparse.OptionParser() Options.addCommonOptions(parser) diff --git a/tests/configs/simple-timing-mp-ruby.py b/tests/configs/simple-timing-mp-ruby.py index c7dd6cd87..897e05383 100644 --- a/tests/configs/simple-timing-mp-ruby.py +++ b/tests/configs/simple-timing-mp-ruby.py @@ -32,10 +32,9 @@ from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys -m5.util.addToPath('../configs/common') m5.util.addToPath('../configs/') -import Options +from common import Options from ruby import Ruby parser = optparse.OptionParser() diff --git a/tests/configs/simple-timing-ruby.py b/tests/configs/simple-timing-ruby.py index 2d2a9e4df..e76cd3963 100644 --- a/tests/configs/simple-timing-ruby.py +++ b/tests/configs/simple-timing-ruby.py @@ -32,11 +32,10 @@ from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys -m5.util.addToPath('../configs/common') m5.util.addToPath('../configs/') from ruby import Ruby -import Options +from common import Options parser = optparse.OptionParser() Options.addCommonOptions(parser) diff --git a/tests/configs/switcheroo.py b/tests/configs/switcheroo.py index 61145bbf6..56eafa613 100644 --- a/tests/configs/switcheroo.py +++ b/tests/configs/switcheroo.py @@ -37,8 +37,8 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') -from Caches import * +m5.util.addToPath('../configs/') +from common.Caches import * class Sequential: """Sequential CPU switcher. diff --git a/tests/configs/t1000-simple-atomic.py b/tests/configs/t1000-simple-atomic.py index 209cb2813..0d971a054 100644 --- a/tests/configs/t1000-simple-atomic.py +++ b/tests/configs/t1000-simple-atomic.py @@ -28,8 +28,8 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') -import FSConfig +m5.util.addToPath('../configs/') +from common import FSConfig try: system = FSConfig.makeSparcSystem('atomic') diff --git a/tests/configs/twosys-tsunami-simple-atomic.py b/tests/configs/twosys-tsunami-simple-atomic.py index e84a06aaf..7d0768e53 100644 --- a/tests/configs/twosys-tsunami-simple-atomic.py +++ b/tests/configs/twosys-tsunami-simple-atomic.py @@ -28,9 +28,9 @@ import m5 from m5.objects import * -m5.util.addToPath('../configs/common') -from FSConfig import * -from Benchmarks import * +m5.util.addToPath('../configs/') +from common.FSConfig import * +from common.Benchmarks import * test_sys = makeLinuxAlphaSystem('atomic', SysConfig('netperf-stream-client.rcS')) diff --git a/tests/configs/x86_generic.py b/tests/configs/x86_generic.py index ad3ea31bf..53c046a58 100644 --- a/tests/configs/x86_generic.py +++ b/tests/configs/x86_generic.py @@ -39,10 +39,10 @@ from abc import ABCMeta, abstractmethod import m5 from m5.objects import * from m5.proxy import * -m5.util.addToPath('../configs/common') -from Benchmarks import SysConfig -import FSConfig -from Caches import * +m5.util.addToPath('../configs/') +from common.Benchmarks import SysConfig +from common import FSConfig +from common.Caches import * from base_config import * class LinuxX86SystemBuilder(object): |