changeset 612f75cf36a0 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=612f75cf36a0
description:
        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:

 configs/common/__init__.py                    |  36 +++++++++++++++++++++++++++
 configs/dist/sw.py                            |   6 ++--
 configs/dram/lat_mem_rd.py                    |   6 ++--
 configs/dram/sweep.py                         |   4 +-
 configs/example/apu_se.py                     |   7 ++---
 configs/example/arm/devices.py                |   6 ++--
 configs/example/arm/fs_bigLITTLE.py           |   7 +++--
 configs/example/etrace_replay.py              |  12 ++++----
 configs/example/fs.py                         |  17 ++++++------
 configs/example/garnet_synth_traffic.py       |   4 +-
 configs/example/hmctest.py                    |   7 +++--
 configs/example/ruby_direct_test.py           |   4 +-
 configs/example/ruby_gpu_random_test.py       |   4 +-
 configs/example/ruby_mem_test.py              |   4 +-
 configs/example/ruby_random_test.py           |   4 +-
 configs/example/se.py                         |  15 +++++------
 configs/learning_gem5/part1/caches.py         |   2 +-
 configs/learning_gem5/part1/two_level.py      |   4 +-
 configs/ruby/Ruby.py                          |   2 +-
 configs/splash2/cluster.py                    |   2 -
 configs/splash2/run.py                        |   2 -
 tests/configs/alpha_generic.py                |   6 ++--
 tests/configs/arm_generic.py                  |  10 +++---
 tests/configs/base_config.py                  |   6 ++--
 tests/configs/checkpoint.py                   |   1 -
 tests/configs/gpu-randomtest-ruby.py          |   3 +-
 tests/configs/gpu-ruby.py                     |   5 +--
 tests/configs/learning-gem5-p1-two-level.py   |   2 +-
 tests/configs/memtest-filter.py               |   4 +-
 tests/configs/memtest-ruby.py                 |   3 +-
 tests/configs/memtest.py                      |   4 +-
 tests/configs/o3-timing-mp-ruby.py            |   1 -
 tests/configs/o3-timing-mt.py                 |   2 +-
 tests/configs/o3-timing-ruby.py               |   2 -
 tests/configs/o3-timing.py                    |   2 +-
 tests/configs/pc-simple-timing-ruby.py        |   8 ++---
 tests/configs/realview-o3-checker.py          |   2 +-
 tests/configs/realview-o3-dual.py             |   2 +-
 tests/configs/realview-o3.py                  |   2 +-
 tests/configs/realview64-o3-checker.py        |   2 +-
 tests/configs/realview64-o3-dual.py           |   2 +-
 tests/configs/realview64-o3.py                |   2 +-
 tests/configs/rubytest-ruby.py                |   3 +-
 tests/configs/simple-timing-mp-ruby.py        |   3 +-
 tests/configs/simple-timing-ruby.py           |   3 +-
 tests/configs/switcheroo.py                   |   4 +-
 tests/configs/t1000-simple-atomic.py          |   4 +-
 tests/configs/twosys-tsunami-simple-atomic.py |   6 ++--
 tests/configs/x86_generic.py                  |   8 +++---
 49 files changed, 138 insertions(+), 119 deletions(-)

diffs (truncated from 795 to 300 lines):

diff -r 074694750c5d -r 612f75cf36a0 configs/common/__init__.py
--- a/configs/common/__init__.py        Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/common/__init__.py        Fri Oct 14 10:37:38 2016 -0400
@@ -0,0 +1,36 @@
+# Copyright (c) 2016 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 Hansson
diff -r 074694750c5d -r 612f75cf36a0 configs/dist/sw.py
--- a/configs/dist/sw.py        Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/dist/sw.py        Fri Oct 14 10:37:38 2016 -0400
@@ -37,10 +37,10 @@
 from m5.objects import *
 from m5.util import addToPath, fatal
 
-addToPath('../common')
+addToPath('../')
 
-import Simulation
-import Options
+from common import Simulation
+from common import Options
 
 def build_switch(options):
     # instantiate an EtherSwitch
diff -r 074694750c5d -r 612f75cf36a0 configs/dram/lat_mem_rd.py
--- a/configs/dram/lat_mem_rd.py        Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/dram/lat_mem_rd.py        Fri Oct 14 10:37:38 2016 -0400
@@ -44,8 +44,8 @@
 from m5.util import addToPath
 from m5.internal.stats import periodicStatDump
 
-addToPath('../common')
-import MemConfig
+addToPath('../')
+from common import MemConfig
 
 addToPath('../../util')
 import protolib
@@ -258,7 +258,7 @@
 
 # create the actual cache hierarchy, for now just go with something
 # basic to explore some of the options
-from Caches import *
+from common.Caches import *
 
 # a starting point for an L3 cache
 class L3Cache(Cache):
diff -r 074694750c5d -r 612f75cf36a0 configs/dram/sweep.py
--- a/configs/dram/sweep.py     Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/dram/sweep.py     Fri Oct 14 10:37:38 2016 -0400
@@ -42,9 +42,9 @@
 from m5.util import addToPath
 from m5.internal.stats import periodicStatDump
 
-addToPath('../common')
+addToPath('../')
 
-import MemConfig
+from common import MemConfig
 
 # this script is helpful to sweep the efficiency of a specific memory
 # controller configuration, by varying the number of banks accessed,
diff -r 074694750c5d -r 612f75cf36a0 configs/example/apu_se.py
--- a/configs/example/apu_se.py Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/apu_se.py Fri Oct 14 10:37:38 2016 -0400
@@ -43,13 +43,12 @@
 from m5.util import addToPath
 
 addToPath('../')
-addToPath('../common')
 
 from ruby import Ruby
 
-import Options
-import Simulation
-import GPUTLBOptions, GPUTLBConfig
+from common import Options
+from common import Simulation
+from common import GPUTLBOptions, GPUTLBConfig
 
 ########################## Script Options ########################
 def setOption(parser, opt_str, value = 1):
diff -r 074694750c5d -r 612f75cf36a0 configs/example/arm/devices.py
--- a/configs/example/arm/devices.py    Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/arm/devices.py    Fri Oct 14 10:37:38 2016 -0400
@@ -40,9 +40,9 @@
 
 import m5
 from m5.objects import *
-m5.util.addToPath('../../common')
-from Caches import *
-import CpuConfig
+m5.util.addToPath('../../')
+from common.Caches import *
+from common import CpuConfig
 
 class L1I(L1_ICache):
     hit_latency = 1
diff -r 074694750c5d -r 612f75cf36a0 configs/example/arm/fs_bigLITTLE.py
--- a/configs/example/arm/fs_bigLITTLE.py       Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/arm/fs_bigLITTLE.py       Fri Oct 14 10:37:38 2016 -0400
@@ -46,9 +46,10 @@
 import m5
 from m5.objects import *
 
-m5.util.addToPath("../../common")
-import SysPaths
-import CpuConfig
+m5.util.addToPath("../../")
+
+from common import SysPaths
+from common import CpuConfig
 
 import devices
 
diff -r 074694750c5d -r 612f75cf36a0 configs/example/etrace_replay.py
--- a/configs/example/etrace_replay.py  Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/etrace_replay.py  Fri Oct 14 10:37:38 2016 -0400
@@ -41,13 +41,13 @@
 
 from m5.util import addToPath, fatal
 
-addToPath('../common')
+addToPath('../')
 
-import Options
-import Simulation
-import CacheConfig
-import MemConfig
-from Caches import *
+from common import Options
+from common import Simulation
+from common import CacheConfig
+from common import MemConfig
+from common.Caches import *
 
 parser = optparse.OptionParser()
 Options.addCommonOptions(parser)
diff -r 074694750c5d -r 612f75cf36a0 configs/example/fs.py
--- a/configs/example/fs.py     Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/fs.py     Fri Oct 14 10:37:38 2016 -0400
@@ -50,18 +50,17 @@
 from m5.util import addToPath, fatal
 
 addToPath('../')
-addToPath('../common')
 
 from ruby import Ruby
 
-from FSConfig import *
-from SysPaths import *
-from Benchmarks import *
-import Simulation
-import CacheConfig
-import MemConfig
-from Caches import *
-import Options
+from common.FSConfig import *
+from common.SysPaths import *
+from common.Benchmarks import *
+from common import Simulation
+from common import CacheConfig
+from common import MemConfig
+from common.Caches import *
+from common import Options
 
 
 # Check if KVM support has been enabled, we might need to do VM
diff -r 074694750c5d -r 612f75cf36a0 configs/example/garnet_synth_traffic.py
--- a/configs/example/garnet_synth_traffic.py   Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/garnet_synth_traffic.py   Fri Oct 14 10:37:38 2016 -0400
@@ -31,10 +31,10 @@
 from m5.defines import buildEnv
 from m5.util import addToPath
 import os, optparse, sys
-addToPath('../common')
+
 addToPath('../')
 
-import Options
+from common import Options
 from ruby import Ruby
 
 # Get paths we might need.  It's expected this file is in m5/configs/example.
diff -r 074694750c5d -r 612f75cf36a0 configs/example/hmctest.py
--- a/configs/example/hmctest.py        Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/hmctest.py        Fri Oct 14 10:37:38 2016 -0400
@@ -6,9 +6,10 @@
 from m5.objects import *
 from m5.util import addToPath
 
-addToPath('../common')
-import MemConfig
-import HMC
+addToPath('../')
+
+from common import MemConfig
+from common import HMC
 
 parser = optparse.OptionParser()
 
diff -r 074694750c5d -r 612f75cf36a0 configs/example/ruby_direct_test.py
--- a/configs/example/ruby_direct_test.py       Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/ruby_direct_test.py       Fri Oct 14 10:37:38 2016 -0400
@@ -33,10 +33,10 @@
 from m5.defines import buildEnv
 from m5.util import addToPath
 import os, optparse, sys
-addToPath('../common')
+
 addToPath('../')
 
-import Options
+from common import Options
 from ruby import Ruby
 
 # Get paths we might need.  It's expected this file is in m5/configs/example.
diff -r 074694750c5d -r 612f75cf36a0 configs/example/ruby_gpu_random_test.py
--- a/configs/example/ruby_gpu_random_test.py   Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/ruby_gpu_random_test.py   Fri Oct 14 10:37:38 2016 -0400
@@ -38,10 +38,10 @@
 from m5.defines import buildEnv
 from m5.util import addToPath
 import os, optparse, sys
-addToPath('../common')
+
 addToPath('../')
 
-import Options
+from common import Options
 from ruby import Ruby
 
 # Get paths we might need.
diff -r 074694750c5d -r 612f75cf36a0 configs/example/ruby_mem_test.py
--- a/configs/example/ruby_mem_test.py  Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/ruby_mem_test.py  Fri Oct 14 10:37:38 2016 -0400
@@ -33,10 +33,10 @@
 from m5.defines import buildEnv
 from m5.util import addToPath
 import os, optparse, sys
-addToPath('../common')
+
 addToPath('../')
 
-import Options
+from common import Options
 from ruby import Ruby
 
 # Get paths we might need.  It's expected this file is in m5/configs/example.
diff -r 074694750c5d -r 612f75cf36a0 configs/example/ruby_random_test.py
--- a/configs/example/ruby_random_test.py       Fri Oct 14 09:02:03 2016 -0500
+++ b/configs/example/ruby_random_test.py       Fri Oct 14 10:37:38 2016 -0400
@@ -33,10 +33,10 @@
 from m5.defines import buildEnv
 from m5.util import addToPath
 import os, optparse, sys
-addToPath('../common')
+
 addToPath('../')
 
-import Options
+from common import Options
 from ruby import Ruby
 
 # Get paths we might need.  It's expected this file is in m5/configs/example.
diff -r 074694750c5d -r 612f75cf36a0 configs/example/se.py
--- a/configs/example/se.py     Fri Oct 14 09:02:03 2016 -0500
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to