From: Andreas Sandberg Date: Tue, 26 Jan 2021 12:32:39 +0000 (+0000) Subject: configs: Remove Python 2.7 glue code X-Git-Tag: develop-gem5-snapshot~212 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40c581be44824fa0ade1d95d58a656714b88cc40;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39755 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/configs/common/Benchmarks.py b/configs/common/Benchmarks.py index 8477d77c4..591c04467 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 bd80c1a70..bd684651e 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 77213e8ee..1468b953c 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 27febe252..d34143cbf 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 6fd39a5aa..66652257e 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 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None, 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 29041fdcd..0d9f22190 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 c06bda1a2..958cf1f72 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 ' diff --git a/configs/common/GPUTLBOptions.py b/configs/common/GPUTLBOptions.py index 3634b8054..a17b0c7b5 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 c4c0acc9e..58d2e626a 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 94b165535..6e78be529 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 82e4df8fe..aa3bda0c9 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 d02535f52..c48bfe64e 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 3e60cf919..ce14f0e20 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 a8d3771cc..067bc01da 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.defines import buildEnv from m5.objects import * from m5.util import * -if six.PY3: - long = int - addToPath('../common') def getCPUClass(cpu_type): @@ -196,7 +189,7 @@ def findCptDir(options, cptdir, testsys): 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 440b0cfea..2b2fca378 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 @@ class PathSearchFunc(object): 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 1950858a8..9b43643f9 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 0a12ecae7..dec209db4 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 8ccf24a2a..68b386243 100644 --- a/configs/common/cores/arm/HPI.py +++ b/configs/common/cores/arm/HPI.py @@ -42,9 +42,6 @@ at: http://www.arm.com/ResearchEnablement/SystemModeling """ -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 96726f238..a402e5fa0 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 1ad4a2e91..dbc3b3e4d 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 3c448c6e9..b3f1ad52a 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 41b5f87f4..c734c629e 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 4edd945a0..266bba0f7 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 4183d4aec..191d4b51c 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 @@ from common import MemConfig 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 @@ def create_trace(filename, max_addr, burst_size, itt): 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 @@ print("Generating traces, please wait...") 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 a9f7057b0..c21a18021 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 2f3837339..808809112 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 0bcf99bc4..7edc733fb 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 6fe259ed6..9d752ee9d 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 1cd53db14..f388503e2 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 c56e1a800..2c7439814 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 4e4623509..8b3638f17 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 32a82222b..4fdba1ef8 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 bffd5a050..2de45efa2 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 ef536c66c..31530484a 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 52a53ba57..de0e2498b 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 @@ def addr_range_parser(cls, flags, param): _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 @@ def memory_bandwidth_parser(cls, flags, param): 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 89a235189..60defb9f5 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 26de08193..ae4ff0bf1 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 310ee3c03..cf47a60e9 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 68402d5f2..dc768270a 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 ae25f9db3..ef7746a3a 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 9119c408a..c552e57d3 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 6a36ba9e4..c9df72374 100644 --- a/configs/learning_gem5/part1/caches.py +++ b/configs/learning_gem5/part1/caches.py @@ -32,9 +32,6 @@ gem5 configuration script. It uses the SimpleOpts wrapper to set up command 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 3e90c624a..69521fe07 100644 --- a/configs/learning_gem5/part1/simple.py +++ b/configs/learning_gem5/part1/simple.py @@ -35,10 +35,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book """ -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 79f87955f..0c0faddaa 100644 --- a/configs/learning_gem5/part1/two_level.py +++ b/configs/learning_gem5/part1/two_level.py @@ -38,9 +38,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book """ -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 fc586acf3..f5ac46bdd 100644 --- a/configs/learning_gem5/part2/hello_goodbye.py +++ b/configs/learning_gem5/part2/hello_goodbye.py @@ -34,9 +34,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book """ -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 0c1f5d10e..4d3a253d3 100644 --- a/configs/learning_gem5/part2/run_simple.py +++ b/configs/learning_gem5/part2/run_simple.py @@ -33,9 +33,6 @@ system. Since there are no events, this "simulation" should finish immediately """ -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 7303a73fa..b7465dcfa 100644 --- a/configs/learning_gem5/part2/simple_cache.py +++ b/configs/learning_gem5/part2/simple_cache.py @@ -31,9 +31,6 @@ World application. Adds a simple cache between the CPU and the membus. 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 ae8639670..f8bafea41 100644 --- a/configs/learning_gem5/part2/simple_memobj.py +++ b/configs/learning_gem5/part2/simple_memobj.py @@ -31,9 +31,6 @@ World application. Adds a simple memobj between the CPU and the membus. 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 822d98a60..1614c467e 100644 --- a/configs/learning_gem5/part3/msi_caches.py +++ b/configs/learning_gem5/part3/msi_caches.py @@ -35,9 +35,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book """ -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 e7d20dd63..04068294a 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 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book """ -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 24203a07f..d0c391096 100644 --- a/configs/learning_gem5/part3/ruby_test.py +++ b/configs/learning_gem5/part3/ruby_test.py @@ -33,8 +33,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book also needs to be updated. For now, email Jason """ -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 8e9f18691..2e65ebd8e 100644 --- a/configs/learning_gem5/part3/simple_ruby.py +++ b/configs/learning_gem5/part3/simple_ruby.py @@ -36,8 +36,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book also needs to be updated. For now, email Jason """ -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 cdf5d1952..227c2dba5 100644 --- a/configs/learning_gem5/part3/test_caches.py +++ b/configs/learning_gem5/part3/test_caches.py @@ -35,9 +35,6 @@ IMPORTANT: If you modify this file, it's likely that the Learning gem5 book """ -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 a907d9ac4..869091298 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 98ab3ae8d..4fe000268 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 7e0bd9e7f..8dc137a8a 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 94edfd452..b7901cce6 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 fe52d62e4..4ebd8ce34 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 @@ addToPath('../') from topologies.Cluster import Cluster from topologies.Crossbar import Crossbar -if six.PY3: - long = int - class CntrlBase: _seqs = 0 @classmethod @@ -261,8 +257,8 @@ class TCC(RubyCache): 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 8aa99be30..47790058f 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 67f64f34f..b5e77cd1f 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 3da73d509..38fdbc89b 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 74e197f9a..848f230e9 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 76ee50cc5..5d292c9d3 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 8248fdf39..63e90bd4d 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 ef58f710a..db7dc2747 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 e0aea5212..b4100ff5c 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 faec1e3c3..8926bcd29 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 057fe1240..9b73c05bc 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 335ff1518..fb7554918 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 98ab3ae8d..4fe000268 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