Andreas Sandberg has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/39755 )

Change subject: configs: Remove Python 2.7 glue code
......................................................................

configs: Remove Python 2.7 glue code

Remove uses of six and from __future__ imports as they are no longer
needed.

Change-Id: I6e2f270557d7343bbad30c8e6d743e363c43715a
Signed-off-by: Andreas Sandberg <andreas.sandb...@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39755
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M configs/common/Benchmarks.py
M configs/common/CacheConfig.py
M configs/common/Caches.py
M configs/common/CpuConfig.py
M configs/common/FSConfig.py
M configs/common/FileSystemConfig.py
M configs/common/GPUTLBConfig.py
M configs/common/GPUTLBOptions.py
M configs/common/HMC.py
M configs/common/MemConfig.py
M configs/common/ObjectList.py
M configs/common/Options.py
M configs/common/SimpleOpts.py
M configs/common/Simulation.py
M configs/common/SysPaths.py
M configs/common/__init__.py
M configs/common/cores/__init__.py
M configs/common/cores/arm/HPI.py
M configs/common/cores/arm/O3_ARM_v7a.py
M configs/common/cores/arm/__init__.py
M configs/common/cores/arm/ex5_LITTLE.py
M configs/common/cores/arm/ex5_big.py
M configs/common/cpu2000.py
M configs/dram/lat_mem_rd.py
M configs/dram/low_power_sweep.py
M configs/dram/sweep.py
M configs/example/apu_se.py
M configs/example/etrace_replay.py
M configs/example/fs.py
M configs/example/garnet_synth_traffic.py
M configs/example/hmc_hello.py
M configs/example/hmctest.py
M configs/example/memcheck.py
M configs/example/memtest.py
M configs/example/read_config.py
M configs/example/ruby_direct_test.py
M configs/example/ruby_gpu_random_test.py
M configs/example/ruby_mem_test.py
M configs/example/ruby_random_test.py
M configs/example/sc_main.py
M configs/example/se.py
M configs/learning_gem5/part1/caches.py
M configs/learning_gem5/part1/simple.py
M configs/learning_gem5/part1/two_level.py
M configs/learning_gem5/part2/hello_goodbye.py
M configs/learning_gem5/part2/run_simple.py
M configs/learning_gem5/part2/simple_cache.py
M configs/learning_gem5/part2/simple_memobj.py
M configs/learning_gem5/part3/msi_caches.py
M configs/learning_gem5/part3/ruby_caches_MI_example.py
M configs/learning_gem5/part3/ruby_test.py
M configs/learning_gem5/part3/simple_ruby.py
M configs/learning_gem5/part3/test_caches.py
M configs/network/Network.py
M configs/network/__init__.py
M configs/nvm/sweep.py
M configs/nvm/sweep_hybrid.py
M configs/ruby/GPU_VIPER.py
M configs/ruby/Ruby.py
M configs/splash2/cluster.py
M configs/splash2/run.py
M configs/topologies/BaseTopology.py
M configs/topologies/Cluster.py
M configs/topologies/Crossbar.py
M configs/topologies/CrossbarGarnet.py
M configs/topologies/MeshDirCorners_XY.py
M configs/topologies/Mesh_XY.py
M configs/topologies/Mesh_westfirst.py
M configs/topologies/Pt2Pt.py
M configs/topologies/__init__.py
70 files changed, 16 insertions(+), 241 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/configs/common/Benchmarks.py b/configs/common/Benchmarks.py
index 8477d77..591c044 100644
--- a/configs/common/Benchmarks.py
+++ b/configs/common/Benchmarks.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from common.SysPaths import script, disk, binary
 from os import environ as env
 from m5.defines import buildEnv
diff --git a/configs/common/CacheConfig.py b/configs/common/CacheConfig.py
index bd80c1a..bd68465 100644
--- a/configs/common/CacheConfig.py
+++ b/configs/common/CacheConfig.py
@@ -40,9 +40,6 @@
 # Configure the M5 cache hierarchy config in one place
 #

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import *
 from common.Caches import *
diff --git a/configs/common/Caches.py b/configs/common/Caches.py
index 77213e8..1468b95 100644
--- a/configs/common/Caches.py
+++ b/configs/common/Caches.py
@@ -37,9 +37,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.defines import buildEnv
 from m5.objects import *

diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 27febe2..d34143c 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -33,9 +33,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5 import fatal
 import m5.objects

diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 6fd39a5..6665225 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -38,20 +38,12 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
-import six
-
 import m5
 from m5.objects import *
 from m5.util import *
 from common.Benchmarks import *
 from common import ObjectList

-if six.PY3:
-    long = int
-
 # Populate to reflect supported os types per target ISA
 os_types = { 'mips'  : [ 'linux' ],
              'riscv' : [ 'linux' ], # TODO that's a lie
@@ -228,11 +220,11 @@
         pci_devices.append(self.pci_ide)

     self.mem_ranges = []
-    size_remain = long(Addr(mdesc.mem()))
+    size_remain = int(Addr(mdesc.mem()))
     for region in self.realview._mem_regions:
-        if size_remain > long(region.size()):
+        if size_remain > int(region.size()):
             self.mem_ranges.append(region)
-            size_remain = size_remain - long(region.size())
+            size_remain = size_remain - int(region.size())
         else:
self.mem_ranges.append(AddrRange(region.start, size=size_remain))
             size_remain = 0
diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py
index 29041fd..0d9f221 100644
--- a/configs/common/FileSystemConfig.py
+++ b/configs/common/FileSystemConfig.py
@@ -36,8 +36,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-
 import m5
 from m5.objects import *
 from m5.util.convert import *
diff --git a/configs/common/GPUTLBConfig.py b/configs/common/GPUTLBConfig.py
index c06bda1..958cf1f 100644
--- a/configs/common/GPUTLBConfig.py
+++ b/configs/common/GPUTLBConfig.py
@@ -29,9 +29,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 # Configure the TLB hierarchy
 # Places which would probably need to be modified if you
 # want a different hierarchy are specified by a <Modify here .. >'
diff --git a/configs/common/GPUTLBOptions.py b/configs/common/GPUTLBOptions.py
index 3634b80..a17b0c7 100644
--- a/configs/common/GPUTLBOptions.py
+++ b/configs/common/GPUTLBOptions.py
@@ -29,9 +29,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 def tlb_options(parser):

     #===================================================================
diff --git a/configs/common/HMC.py b/configs/common/HMC.py
index c4c0acc..58d2e62 100644
--- a/configs/common/HMC.py
+++ b/configs/common/HMC.py
@@ -119,9 +119,6 @@
# 2 Crossbars are connected to only local vaults. From other 2 crossbar, a
 #   request can be forwarded to any other vault.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import argparse

 import m5
diff --git a/configs/common/MemConfig.py b/configs/common/MemConfig.py
index 94b1655..6e78be5 100644
--- a/configs/common/MemConfig.py
+++ b/configs/common/MemConfig.py
@@ -33,9 +33,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5.objects
 from common import ObjectList
 from common import HMC
diff --git a/configs/common/ObjectList.py b/configs/common/ObjectList.py
index 82e4df8..aa3bda0 100644
--- a/configs/common/ObjectList.py
+++ b/configs/common/ObjectList.py
@@ -34,9 +34,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5.objects
 import inspect
 import sys
diff --git a/configs/common/Options.py b/configs/common/Options.py
index d02535f..c48bfe6 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -36,9 +36,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.defines import buildEnv
 from m5.objects import *
diff --git a/configs/common/SimpleOpts.py b/configs/common/SimpleOpts.py
index 3e60cf9..ce14f0e 100644
--- a/configs/common/SimpleOpts.py
+++ b/configs/common/SimpleOpts.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 """ Options wrapper for simple gem5 configuration scripts

 This module wraps the optparse class so that we can register options
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index a8d3771..067bc01 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -37,10 +37,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
-import six
 import sys
 from os import getcwd
 from os.path import join as joinpath
@@ -53,9 +49,6 @@
 from m5.objects import *
 from m5.util import *

-if six.PY3:
-    long = int
-
 addToPath('../common')

 def getCPUClass(cpu_type):
@@ -196,7 +189,7 @@
             if match:
                 cpts.append(match.group(1))

-        cpts.sort(key = lambda a: long(a))
+        cpts.sort(key = lambda a: int(a))

         cpt_num = options.checkpoint_restore
         if cpt_num > len(cpts):
diff --git a/configs/common/SysPaths.py b/configs/common/SysPaths.py
index 440b0cf..2b2fca3 100644
--- a/configs/common/SysPaths.py
+++ b/configs/common/SysPaths.py
@@ -24,10 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
-from six import string_types
 import os, sys

 config_path = os.path.dirname(os.path.abspath(__file__))
@@ -38,7 +34,7 @@
     environment_variable = 'M5_PATH'

     def __init__(self, subdirs, sys_paths=None):
-        if isinstance(subdirs, string_types):
+        if isinstance(subdirs, str):
             subdirs = [subdirs]
         self._subdir = os.path.join(*subdirs)
         if sys_paths:
diff --git a/configs/common/__init__.py b/configs/common/__init__.py
index 1950858..9b43643 100644
--- a/configs/common/__init__.py
+++ b/configs/common/__init__.py
@@ -33,6 +33,3 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
diff --git a/configs/common/cores/__init__.py b/configs/common/cores/__init__.py
index 0a12eca..dec209d 100644
--- a/configs/common/cores/__init__.py
+++ b/configs/common/cores/__init__.py
@@ -32,6 +32,3 @@
 # 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.
-
-from __future__ import print_function
-from __future__ import absolute_import
diff --git a/configs/common/cores/arm/HPI.py b/configs/common/cores/arm/HPI.py
index 8ccf24a..68b3862 100644
--- a/configs/common/cores/arm/HPI.py
+++ b/configs/common/cores/arm/HPI.py
@@ -42,9 +42,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.objects import *

 # Simple function to allow a string of [01x_] to be converted into a
diff --git a/configs/common/cores/arm/O3_ARM_v7a.py b/configs/common/cores/arm/O3_ARM_v7a.py
index 96726f2..a402e5f 100644
--- a/configs/common/cores/arm/O3_ARM_v7a.py
+++ b/configs/common/cores/arm/O3_ARM_v7a.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.objects import *

 # Simple ALU Instructions have a latency of 1
diff --git a/configs/common/cores/arm/__init__.py b/configs/common/cores/arm/__init__.py
index 1ad4a2e..dbc3b3e 100644
--- a/configs/common/cores/arm/__init__.py
+++ b/configs/common/cores/arm/__init__.py
@@ -33,9 +33,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from pkgutil import iter_modules
 from importlib import import_module

diff --git a/configs/common/cores/arm/ex5_LITTLE.py b/configs/common/cores/arm/ex5_LITTLE.py
index 3c448c6..b3f1ad5 100644
--- a/configs/common/cores/arm/ex5_LITTLE.py
+++ b/configs/common/cores/arm/ex5_LITTLE.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.objects import *

 #-----------------------------------------------------------------------
diff --git a/configs/common/cores/arm/ex5_big.py b/configs/common/cores/arm/ex5_big.py
index 41b5f87..c734c62 100644
--- a/configs/common/cores/arm/ex5_big.py
+++ b/configs/common/cores/arm/ex5_big.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.objects import *

 #-----------------------------------------------------------------------
diff --git a/configs/common/cpu2000.py b/configs/common/cpu2000.py
index 4edd945..266bba0 100644
--- a/configs/common/cpu2000.py
+++ b/configs/common/cpu2000.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import os
 import sys
 from os.path import basename, exists, join as joinpath, normpath
diff --git a/configs/dram/lat_mem_rd.py b/configs/dram/lat_mem_rd.py
index 4183d4a..191d4b5 100644
--- a/configs/dram/lat_mem_rd.py
+++ b/configs/dram/lat_mem_rd.py
@@ -33,11 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import gzip
-import six
 import optparse
 import os

@@ -53,9 +49,6 @@
 addToPath('../../util')
 import protolib

-if six.PY3:
-    long = int
-
 # this script is helpful to observe the memory latency for various
 # levels in a cache hierarchy, and various cache and memory
 # configurations, in essence replicating the lmbench lat_mem_rd thrash
@@ -206,8 +199,8 @@
     packet.size = int(burst_size)

     for addr in addrs:
-        packet.tick = long(tick)
-        packet.addr = long(addr)
+        packet.tick = int(tick)
+        packet.addr = int(addr)
         protolib.encodeMessage(proto_out, packet)
         tick = tick + itt

@@ -218,7 +211,7 @@

 nxt_range = 0
 nxt_state = 0
-period = long(itt * (max_range / burst_size))
+period = int(itt * (max_range / burst_size))

 # now we create the states for each range
 for r in ranges:
diff --git a/configs/dram/low_power_sweep.py b/configs/dram/low_power_sweep.py
index a9f7057..c21a180 100644
--- a/configs/dram/low_power_sweep.py
+++ b/configs/dram/low_power_sweep.py
@@ -33,9 +33,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import argparse

 import m5
diff --git a/configs/dram/sweep.py b/configs/dram/sweep.py
index 2f38373..8088091 100644
--- a/configs/dram/sweep.py
+++ b/configs/dram/sweep.py
@@ -33,9 +33,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import math
 import optparse

diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py
index 0bcf99b..7edc733 100644
--- a/configs/example/apu_se.py
+++ b/configs/example/apu_se.py
@@ -29,9 +29,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import optparse, os, re, getpass
 import math
 import glob
diff --git a/configs/example/etrace_replay.py b/configs/example/etrace_replay.py
index 6fe259e..9d752ee 100644
--- a/configs/example/etrace_replay.py
+++ b/configs/example/etrace_replay.py
@@ -35,9 +35,6 @@

 # Basic elastic traces replay script that configures a Trace CPU

-from __future__ import print_function
-from __future__ import absolute_import
-
 import optparse

 from m5.util import addToPath, fatal
diff --git a/configs/example/fs.py b/configs/example/fs.py
index 1cd53db..f388503 100644
--- a/configs/example/fs.py
+++ b/configs/example/fs.py
@@ -39,9 +39,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import optparse
 import sys

diff --git a/configs/example/garnet_synth_traffic.py b/configs/example/garnet_synth_traffic.py
index c56e1a8..2c74398 100644
--- a/configs/example/garnet_synth_traffic.py
+++ b/configs/example/garnet_synth_traffic.py
@@ -26,9 +26,6 @@
 #
 # Author: Tushar Krishna

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
diff --git a/configs/example/hmc_hello.py b/configs/example/hmc_hello.py
index 4e46235..8b3638f 100644
--- a/configs/example/hmc_hello.py
+++ b/configs/example/hmc_hello.py
@@ -30,9 +30,6 @@
 #
 # Author: Éder F. Zulian

-from __future__ import print_function
-from __future__ import absolute_import
-
 import sys
 import argparse

diff --git a/configs/example/hmctest.py b/configs/example/hmctest.py
index 32a8222..4fdba1e 100644
--- a/configs/example/hmctest.py
+++ b/configs/example/hmctest.py
@@ -1,7 +1,4 @@

-from __future__ import print_function
-from __future__ import absolute_import
-
 import sys
 import argparse
 import subprocess
diff --git a/configs/example/memcheck.py b/configs/example/memcheck.py
index bffd5a0..2de45ef 100644
--- a/configs/example/memcheck.py
+++ b/configs/example/memcheck.py
@@ -36,9 +36,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import optparse
 import random
 import sys
diff --git a/configs/example/memtest.py b/configs/example/memtest.py
index ef536c6..3153048 100644
--- a/configs/example/memtest.py
+++ b/configs/example/memtest.py
@@ -36,9 +36,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import optparse
 import random
 import sys
diff --git a/configs/example/read_config.py b/configs/example/read_config.py
index 52a53ba..de0e249 100644
--- a/configs/example/read_config.py
+++ b/configs/example/read_config.py
@@ -45,23 +45,16 @@
 # between system construction and run control may allow better
 # debugging.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import argparse
-from six.moves import configparser
+import configparser
 import inspect
 import json
 import re
-import six
 import sys

 import m5
 import m5.ticks as ticks

-if six.PY3:
-    long = int
-
 sim_object_classes_by_name = {
     cls.__name__: cls for cls in list(m5.objects.__dict__.values())
     if inspect.isclass(cls) and issubclass(cls, m5.objects.SimObject) }
@@ -92,13 +85,13 @@
     _param = param.split(':')
     (start, end) = _param[0:2]
     if len(_param) == 2:
-        return m5.objects.AddrRange(start=long(start), end=long(end))
+        return m5.objects.AddrRange(start=int(start), end=int(end))
     else:
         assert len(_param) > 2
         intlv_match = _param[2]
-        masks = [ long(m) for m in _param[3:] ]
-        return m5.objects.AddrRange(start=long(start), end=long(end),
- masks=masks, intlvMatch=long(intlv_match))
+        masks = [ int(m) for m in _param[3:] ]
+        return m5.objects.AddrRange(start=int(start), end=int(end),
+ masks=masks, intlvMatch=int(intlv_match))


 def memory_bandwidth_parser(cls, flags, param):
@@ -114,7 +107,7 @@
 param_parsers = {
     'Bool': simple_parser(),
     'ParamValue': no_parser,
-    'NumericParamValue': simple_parser(cast=long),
+    'NumericParamValue': simple_parser(cast=int),
     'TickParamValue': tick_parser(),
     'Frequency': tick_parser(cast=m5.objects.Latency),
     'Current': simple_parser(suffix='A'),
diff --git a/configs/example/ruby_direct_test.py b/configs/example/ruby_direct_test.py
index 89a2351..60defb9 100644
--- a/configs/example/ruby_direct_test.py
+++ b/configs/example/ruby_direct_test.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
diff --git a/configs/example/ruby_gpu_random_test.py b/configs/example/ruby_gpu_random_test.py
index 26de081..ae4ff0b 100644
--- a/configs/example/ruby_gpu_random_test.py
+++ b/configs/example/ruby_gpu_random_test.py
@@ -29,9 +29,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
diff --git a/configs/example/ruby_mem_test.py b/configs/example/ruby_mem_test.py
index 310ee3c..cf47a60 100644
--- a/configs/example/ruby_mem_test.py
+++ b/configs/example/ruby_mem_test.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
diff --git a/configs/example/ruby_random_test.py b/configs/example/ruby_random_test.py
index 68402d5..dc76827 100644
--- a/configs/example/ruby_random_test.py
+++ b/configs/example/ruby_random_test.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
diff --git a/configs/example/sc_main.py b/configs/example/sc_main.py
index ae25f9d..ef7746a 100755
--- a/configs/example/sc_main.py
+++ b/configs/example/sc_main.py
@@ -23,8 +23,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-
 import sys

 import m5
diff --git a/configs/example/se.py b/configs/example/se.py
index 9119c40..c552e57 100644
--- a/configs/example/se.py
+++ b/configs/example/se.py
@@ -40,9 +40,6 @@
 #
 # "m5 test.py"

-from __future__ import print_function
-from __future__ import absolute_import
-
 import optparse
 import sys
 import os
diff --git a/configs/learning_gem5/part1/caches.py b/configs/learning_gem5/part1/caches.py
index 6a36ba9..c9df723 100644
--- a/configs/learning_gem5/part1/caches.py
+++ b/configs/learning_gem5/part1/caches.py
@@ -32,9 +32,6 @@
 line options from each individual class.
 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5
 from m5.objects import Cache

diff --git a/configs/learning_gem5/part1/simple.py b/configs/learning_gem5/part1/simple.py
index 3e90c62..69521fe 100644
--- a/configs/learning_gem5/part1/simple.py
+++ b/configs/learning_gem5/part1/simple.py
@@ -35,10 +35,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
-
 # import the m5 (gem5) library created when gem5 is built
 import m5
 # import all of the SimObjects
diff --git a/configs/learning_gem5/part1/two_level.py b/configs/learning_gem5/part1/two_level.py
index 79f8795..0c0fadd 100644
--- a/configs/learning_gem5/part1/two_level.py
+++ b/configs/learning_gem5/part1/two_level.py
@@ -38,9 +38,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 # import the m5 (gem5) library created when gem5 is built
 import m5
 # import all of the SimObjects
diff --git a/configs/learning_gem5/part2/hello_goodbye.py b/configs/learning_gem5/part2/hello_goodbye.py
index fc586ac..f5ac46b 100644
--- a/configs/learning_gem5/part2/hello_goodbye.py
+++ b/configs/learning_gem5/part2/hello_goodbye.py
@@ -34,9 +34,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 # import the m5 (gem5) library created when gem5 is built
 import m5
 # import all of the SimObjects
diff --git a/configs/learning_gem5/part2/run_simple.py b/configs/learning_gem5/part2/run_simple.py
index 0c1f5d1..4d3a253 100644
--- a/configs/learning_gem5/part2/run_simple.py
+++ b/configs/learning_gem5/part2/run_simple.py
@@ -33,9 +33,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 # import the m5 (gem5) library created when gem5 is built
 import m5
 # import all of the SimObjects
diff --git a/configs/learning_gem5/part2/simple_cache.py b/configs/learning_gem5/part2/simple_cache.py
index 7303a73..b7465dc 100644
--- a/configs/learning_gem5/part2/simple_cache.py
+++ b/configs/learning_gem5/part2/simple_cache.py
@@ -31,9 +31,6 @@
 This config file assumes that the x86 ISA was built.
 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 # import the m5 (gem5) library created when gem5 is built
 import m5
 # import all of the SimObjects
diff --git a/configs/learning_gem5/part2/simple_memobj.py b/configs/learning_gem5/part2/simple_memobj.py
index ae86396..f8bafea 100644
--- a/configs/learning_gem5/part2/simple_memobj.py
+++ b/configs/learning_gem5/part2/simple_memobj.py
@@ -31,9 +31,6 @@
 This config file assumes that the x86 ISA was built.
 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 # import the m5 (gem5) library created when gem5 is built
 import m5
 # import all of the SimObjects
diff --git a/configs/learning_gem5/part3/msi_caches.py b/configs/learning_gem5/part3/msi_caches.py
index 822d98a..1614c46 100644
--- a/configs/learning_gem5/part3/msi_caches.py
+++ b/configs/learning_gem5/part3/msi_caches.py
@@ -35,9 +35,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 import math

 from m5.defines import buildEnv
diff --git a/configs/learning_gem5/part3/ruby_caches_MI_example.py b/configs/learning_gem5/part3/ruby_caches_MI_example.py
index e7d20dd..0406829 100644
--- a/configs/learning_gem5/part3/ruby_caches_MI_example.py
+++ b/configs/learning_gem5/part3/ruby_caches_MI_example.py
@@ -37,9 +37,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 import math

 from m5.defines import buildEnv
diff --git a/configs/learning_gem5/part3/ruby_test.py b/configs/learning_gem5/part3/ruby_test.py
index 24203a0..d0c3910 100644
--- a/configs/learning_gem5/part3/ruby_test.py
+++ b/configs/learning_gem5/part3/ruby_test.py
@@ -33,8 +33,6 @@
also needs to be updated. For now, email Jason <ja...@lowepower.com>

 """
-from __future__ import print_function
-from __future__ import absolute_import

 # import the m5 (gem5) library created when gem5 is built
 import m5
diff --git a/configs/learning_gem5/part3/simple_ruby.py b/configs/learning_gem5/part3/simple_ruby.py
index 8e9f186..2e65ebd 100644
--- a/configs/learning_gem5/part3/simple_ruby.py
+++ b/configs/learning_gem5/part3/simple_ruby.py
@@ -36,8 +36,6 @@
also needs to be updated. For now, email Jason <ja...@lowepower.com>

 """
-from __future__ import print_function
-from __future__ import absolute_import

 # import the m5 (gem5) library created when gem5 is built
 import m5
diff --git a/configs/learning_gem5/part3/test_caches.py b/configs/learning_gem5/part3/test_caches.py
index cdf5d19..227c2db 100644
--- a/configs/learning_gem5/part3/test_caches.py
+++ b/configs/learning_gem5/part3/test_caches.py
@@ -35,9 +35,6 @@

 """

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.defines import buildEnv
 from m5.util import fatal

diff --git a/configs/network/Network.py b/configs/network/Network.py
index a907d9a..8690912 100644
--- a/configs/network/Network.py
+++ b/configs/network/Network.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import math
 import m5
 from m5.objects import *
diff --git a/configs/network/__init__.py b/configs/network/__init__.py
index 98ab3ae..4fe0002 100644
--- a/configs/network/__init__.py
+++ b/configs/network/__init__.py
@@ -32,6 +32,3 @@
 # 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.
-
-from __future__ import print_function
-from __future__ import absolute_import
diff --git a/configs/nvm/sweep.py b/configs/nvm/sweep.py
index 7e0bd9e..8dc137a 100644
--- a/configs/nvm/sweep.py
+++ b/configs/nvm/sweep.py
@@ -35,9 +35,6 @@
 #
 # Authors: Andreas Hansson

-from __future__ import print_function
-from __future__ import absolute_import
-
 import math
 import optparse

diff --git a/configs/nvm/sweep_hybrid.py b/configs/nvm/sweep_hybrid.py
index 94edfd4..b7901cc 100644
--- a/configs/nvm/sweep_hybrid.py
+++ b/configs/nvm/sweep_hybrid.py
@@ -35,9 +35,6 @@
 #
 # Authors: Andreas Hansson

-from __future__ import print_function
-from __future__ import absolute_import
-
 import math
 import optparse

diff --git a/configs/ruby/GPU_VIPER.py b/configs/ruby/GPU_VIPER.py
index fe52d62..4ebd8ce 100644
--- a/configs/ruby/GPU_VIPER.py
+++ b/configs/ruby/GPU_VIPER.py
@@ -29,7 +29,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.

-import six
 import math
 import m5
 from m5.objects import *
@@ -44,9 +43,6 @@
 from topologies.Cluster import Cluster
 from topologies.Crossbar import Crossbar

-if six.PY3:
-    long = int
-
 class CntrlBase:
     _seqs = 0
     @classmethod
@@ -261,8 +257,8 @@
self.dataArrayBanks = 256 / options.num_tccs #number of data banks
           self.tagArrayBanks = 256 / options.num_tccs #number of tag banks
         self.size.value = self.size.value / options.num_tccs
-        if ((self.size.value / long(self.assoc)) < 128):
-            self.size.value = long(128 * self.assoc)
+        if ((self.size.value / int(self.assoc)) < 128):
+            self.size.value = int(128 * self.assoc)
         self.start_index_bit = math.log(options.cacheline_size, 2) + \
                                math.log(options.num_tccs, 2)
         self.replacement_policy = TreePLRURP()
diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py
index 8aa99be..4779005 100644
--- a/configs/ruby/Ruby.py
+++ b/configs/ruby/Ruby.py
@@ -37,8 +37,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-
 import math
 import m5
 from m5.objects import *
diff --git a/configs/splash2/cluster.py b/configs/splash2/cluster.py
index 67f64f3..b5e77cd 100644
--- a/configs/splash2/cluster.py
+++ b/configs/splash2/cluster.py
@@ -28,9 +28,6 @@
 #
 # "m5 test.py"

-from __future__ import print_function
-from __future__ import absolute_import
-
 import os
 import optparse
 import sys
diff --git a/configs/splash2/run.py b/configs/splash2/run.py
index 3da73d5..38fdbc8 100644
--- a/configs/splash2/run.py
+++ b/configs/splash2/run.py
@@ -27,9 +27,6 @@
 # Splash2 Run Script
 #

-from __future__ import print_function
-from __future__ import absolute_import
-
 import os
 import optparse
 import sys
diff --git a/configs/topologies/BaseTopology.py b/configs/topologies/BaseTopology.py
index 74e197f..848f230 100644
--- a/configs/topologies/BaseTopology.py
+++ b/configs/topologies/BaseTopology.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 import m5

 class BaseTopology(object):
diff --git a/configs/topologies/Cluster.py b/configs/topologies/Cluster.py
index 76ee50c..5d292c9 100644
--- a/configs/topologies/Cluster.py
+++ b/configs/topologies/Cluster.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from topologies.BaseTopology import BaseTopology

 class Cluster(BaseTopology):
diff --git a/configs/topologies/Crossbar.py b/configs/topologies/Crossbar.py
index 8248fdf..63e90bd 100644
--- a/configs/topologies/Crossbar.py
+++ b/configs/topologies/Crossbar.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.params import *
 from m5.objects import *

diff --git a/configs/topologies/CrossbarGarnet.py b/configs/topologies/CrossbarGarnet.py
index ef58f71..db7dc27 100644
--- a/configs/topologies/CrossbarGarnet.py
+++ b/configs/topologies/CrossbarGarnet.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.params import *
 from m5.objects import *

diff --git a/configs/topologies/MeshDirCorners_XY.py b/configs/topologies/MeshDirCorners_XY.py
index e0aea52..b4100ff 100644
--- a/configs/topologies/MeshDirCorners_XY.py
+++ b/configs/topologies/MeshDirCorners_XY.py
@@ -24,9 +24,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.params import *
 from m5.objects import *

diff --git a/configs/topologies/Mesh_XY.py b/configs/topologies/Mesh_XY.py
index faec1e3..8926bcd 100644
--- a/configs/topologies/Mesh_XY.py
+++ b/configs/topologies/Mesh_XY.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.params import *
 from m5.objects import *

diff --git a/configs/topologies/Mesh_westfirst.py b/configs/topologies/Mesh_westfirst.py
index 057fe12..9b73c05 100644
--- a/configs/topologies/Mesh_westfirst.py
+++ b/configs/topologies/Mesh_westfirst.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.params import *
 from m5.objects import *

diff --git a/configs/topologies/Pt2Pt.py b/configs/topologies/Pt2Pt.py
index 335ff15..fb75549 100644
--- a/configs/topologies/Pt2Pt.py
+++ b/configs/topologies/Pt2Pt.py
@@ -25,9 +25,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-from __future__ import print_function
-from __future__ import absolute_import
-
 from m5.params import *
 from m5.objects import *

diff --git a/configs/topologies/__init__.py b/configs/topologies/__init__.py
index 98ab3ae..4fe0002 100644
--- a/configs/topologies/__init__.py
+++ b/configs/topologies/__init__.py
@@ -32,6 +32,3 @@
 # 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.
-
-from __future__ import print_function
-from __future__ import absolute_import

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39755
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6e2f270557d7343bbad30c8e6d743e363c43715a
Gerrit-Change-Number: 39755
Gerrit-PatchSet: 2
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to