configs: Updates for python3
authorJason Lowe-Power <jason@lowepower.com>
Thu, 14 May 2020 00:04:29 +0000 (17:04 -0700)
committerJason Lowe-Power <power.jg@gmail.com>
Mon, 18 May 2020 20:10:35 +0000 (20:10 +0000)
Change-Id: Iab2f83716ea2cb19f06282f037314f2db843327a
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29047
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
30 files changed:
configs/common/FSConfig.py
configs/common/FileSystemConfig.py
configs/common/HMC.py
configs/common/ObjectList.py
configs/common/Options.py
configs/common/Simulation.py
configs/common/SysPaths.py
configs/dram/lat_mem_rd.py
configs/dram/sweep.py
configs/example/arm/baremetal.py
configs/example/arm/devices.py
configs/example/arm/fs_bigLITTLE.py
configs/example/arm/starter_fs.py
configs/example/arm/starter_se.py
configs/example/read_config.py
configs/ruby/AMD_Base_Constructor.py
configs/ruby/GPU_RfO.py
configs/ruby/GPU_VIPER.py
configs/ruby/GPU_VIPER_Baseline.py
configs/ruby/GPU_VIPER_Region.py
configs/ruby/Garnet_standalone.py
configs/ruby/MESI_Three_Level.py
configs/ruby/MESI_Two_Level.py
configs/ruby/MI_example.py
configs/ruby/MOESI_AMD_Base.py
configs/ruby/MOESI_CMP_directory.py
configs/ruby/MOESI_CMP_token.py
configs/ruby/MOESI_hammer.py
configs/topologies/MeshDirCorners_XY.py
configs/topologies/Mesh_XY.py

index d49ad78e750b43a75819230aed03284faff010f9..e15459370cab6b1b1e924ebd38b32c257b4018f2 100644 (file)
 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
@@ -574,7 +579,7 @@ def makeLinuxX86System(mem_mode, numCPUs=1, mdesc=None, Ruby=False,
 
     # We assume below that there's at least 1MB of memory. We'll require 2
     # just to avoid corner cases.
-    phys_mem_size = sum(map(lambda r: r.size(), self.mem_ranges))
+    phys_mem_size = sum([r.size() for r in self.mem_ranges])
     assert(phys_mem_size >= 0x200000)
     assert(len(self.mem_ranges) <= 2)
 
index 97279f1bc8b3057c9e9651c33377d03c92963708..ec27656e05537863e3c29261ddb7ef0f16ed8447 100644 (file)
@@ -132,7 +132,7 @@ def config_filesystem(system, options = None):
         file_append((procdir, 'cpuinfo'), one_cpu)
 
     file_append((procdir, 'stat'), 'cpu 0 0 0 0 0 0 0\n')
-    for i in xrange(len(cpus)):
+    for i in range(len(cpus)):
         file_append((procdir, 'stat'), 'cpu%d 0 0 0 0 0 0 0\n' % i)
 
     # Set up /sys
index c65b201b7fa9d0623d537678f8651864e538f17d..c4c0acc9e3bd8795041f42edb9b8c807cc15b072 100644 (file)
@@ -432,7 +432,7 @@ def config_hmc_dev(opt, system, hmc_host):
                                   for i in range(numx*(opt.mem_chunk-1))]
 
         # Buffer iterator
-        it = iter(range(len(system.hmc_dev.buffers)))
+        it = iter(list(range(len(system.hmc_dev.buffers))))
 
         # necesarry to add system_port to one of the xbar
         system.system_port = system.hmc_dev.xbar[3].slave
@@ -443,7 +443,7 @@ def config_hmc_dev(opt, system, hmc_host):
                 # connect xbar to all other xbars except itself
                 if i != j:
                     # get the next index of buffer
-                    index = it.next()
+                    index = next(it)
 
                     # Change the default values for ranges of bridge
                     system.hmc_dev.buffers[index].ranges = system.mem_ranges[
index 8bffa5fe08f8001de04ee871d4ccd9265ea2d7f5..c91ea0c6535d70a9f0a45cae1a6e42aaf568d19f 100644 (file)
@@ -75,7 +75,7 @@ class ObjectList(object):
         print("Available {} classes:".format(self.base_cls))
         doc_wrapper = TextWrapper(initial_indent="\t\t",
             subsequent_indent="\t\t")
-        for name, cls in self._sub_classes.items():
+        for name, cls in list(self._sub_classes.items()):
             print("\t{}".format(name))
 
             # Try to extract the class documentation from the class help
@@ -87,7 +87,7 @@ class ObjectList(object):
 
         if self._aliases:
             print("\Aliases:")
-            for alias, target in self._aliases.items():
+            for alias, target in list(self._aliases.items()):
                 print("\t{} => {}".format(alias, target))
 
     def get_names(self):
@@ -156,7 +156,7 @@ class EnumList(ObjectList):
     def _add_objects(self):
         """ Add all enum values to the ObjectList """
         self._sub_classes = {}
-        for (key, value) in self.base_cls.__members__.items():
+        for (key, value) in list(self.base_cls.__members__.items()):
             # All Enums have a value Num_NAME at the end which we
             # do not want to include
             if not key.startswith("Num_"):
index 6d0c6c295b55d548802278fa5c3aed1c3e015347..3eff04bf9a4cd68d78ab0542457fc900924a9c18 100644 (file)
@@ -110,7 +110,7 @@ def addNoISAOptions(parser):
                       help="Specify the physical memory size (single memory)")
     parser.add_option("--enable-dram-powerdown", action="store_true",
                        help="Enable low-power states in DRAMCtrl")
-    parser.add_option("--mem-channels-intlv", type="int",
+    parser.add_option("--mem-channels-intlv", type="int", default=0,
                       help="Memory channels interleave")
 
 
index 73a0ff5413b9ec397fed0893e62d36daa4d6ef6f..e53c755c6c09e1e5528158eaa29966641cd1a8bc 100644 (file)
@@ -40,6 +40,7 @@
 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
@@ -52,6 +53,9 @@ from m5.defines import buildEnv
 from m5.objects import *
 from m5.util import *
 
+if six.PY3:
+    long = int
+
 addToPath('../common')
 
 def getCPUClass(cpu_type):
index f37039e1efd29cdad089ff722e42c2a772573ad5..440b0cfea0cebb73cec6c33591a3e5a55f74ee25 100644 (file)
@@ -55,10 +55,10 @@ class PathSearchFunc(object):
                     paths = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ]
 
                 # expand '~' and '~user' in paths
-                paths = map(os.path.expanduser, paths)
+                paths = list(map(os.path.expanduser, paths))
 
                 # filter out non-existent directories
-                paths = filter(os.path.isdir, paths)
+                paths = list(filter(os.path.isdir, paths))
 
                 if not paths:
                     raise IOError(
index 07f9afcbb9400febc7ea00d71fb534e88d416760..9b04e4bd263ffd7ed6f817314c3f0468a438f7ca 100644 (file)
@@ -37,6 +37,7 @@ from __future__ import print_function
 from __future__ import absolute_import
 
 import gzip
+import six
 import optparse
 import os
 
@@ -52,6 +53,9 @@ 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
index d3c86c3344cf20aff55b34e0c05e5bb40c3fdaf8..a340b46a5821ffd85855ded38b4b1d44db927790 100644 (file)
@@ -73,7 +73,7 @@ parser.add_option("--rd_perc", type="int", default=100,
                   help = "Percentage of read commands")
 
 parser.add_option("--mode", type="choice", default="DRAM",
-                  choices=dram_generators.keys(),
+                  choices=list(dram_generators.keys()),
                   help = "DRAM: Random traffic; \
                           DRAM_ROTATE: Traffic rotating across banks and ranks")
 
index 412625d576cebc2b66c156d9e4bdd6783d5c3930..04f60a19b36caed97b95eb9ee171084b100177e2 100644 (file)
@@ -203,7 +203,7 @@ def main():
                         help="Disk to instantiate")
     parser.add_argument("--readfile", type=str, default="",
                         help = "File to return with the m5 readfile command")
-    parser.add_argument("--cpu", type=str, choices=cpu_types.keys(),
+    parser.add_argument("--cpu", type=str, choices=list(cpu_types.keys()),
                         default="atomic",
                         help="CPU model to use")
     parser.add_argument("--cpu-freq", type=str, default="4GHz")
index a45188b9c84e73b57d76107a30188a81181bea84..cc8ac5ead3a70b810438cde1e87d1de85c76febd 100644 (file)
 from __future__ import print_function
 from __future__ import absolute_import
 
+import six
+
 import m5
 from m5.objects import *
 m5.util.addToPath('../../')
 from common.Caches import *
 from common import ObjectList
 
+if six.PY3:
+    long = int
+
 have_kvm = "ArmV8KvmCPU" in ObjectList.cpu_list.get_names()
 have_fastmodel = "FastModelCortexA76" in ObjectList.cpu_list.get_names()
 
index b7e794d58ca343a983fd6b6fcce522247dd92dc3..228d11c7f1808d78d85b4f18ac340fd8d9e2a20b 100644 (file)
@@ -177,7 +177,7 @@ def addOptions(parser):
                         help="Disks to instantiate")
     parser.add_argument("--bootscript", type=str, default=default_rcs,
                         help="Linux bootscript")
-    parser.add_argument("--cpu-type", type=str, choices=cpu_types.keys(),
+    parser.add_argument("--cpu-type", type=str, choices=list(cpu_types.keys()),
                         default="timing",
                         help="CPU simulation mode. Default: %(default)s")
     parser.add_argument("--kernel-init", type=str, default="/sbin/init",
index 7a202807e758476dab4d22c42dc9f9dde2799baf..3033890f0454dfb58f3b7af7ff6afb71588a3cd2 100644 (file)
@@ -208,7 +208,7 @@ def main():
                         help="Disk to instantiate")
     parser.add_argument("--script", type=str, default="",
                         help = "Linux bootscript")
-    parser.add_argument("--cpu", type=str, choices=cpu_types.keys(),
+    parser.add_argument("--cpu", type=str, choices=list(cpu_types.keys()),
                         default="atomic",
                         help="CPU model to use")
     parser.add_argument("--cpu-freq", type=str, default="4GHz")
index 0f20ecc6451d069d6d2b1008b86b2a7658779eed..0003ce994d24d8beb8d27ca9644e7eaf87f60cae 100644 (file)
@@ -183,7 +183,7 @@ def main():
 
     parser.add_argument("commands_to_run", metavar="command(s)", nargs='*',
                         help="Command(s) to run")
-    parser.add_argument("--cpu", type=str, choices=cpu_types.keys(),
+    parser.add_argument("--cpu", type=str, choices=list(cpu_types.keys()),
                         default="atomic",
                         help="CPU model to use")
     parser.add_argument("--cpu-freq", type=str, default="4GHz")
index 167815c70218de28155b9591746d8bb2ff665fc4..52a53ba5763064e0cc7e1f768d051f9e8a135503 100644 (file)
@@ -49,7 +49,7 @@ from __future__ import print_function
 from __future__ import absolute_import
 
 import argparse
-import ConfigParser
+from six.moves import configparser
 import inspect
 import json
 import re
@@ -63,7 +63,7 @@ if six.PY3:
     long = int
 
 sim_object_classes_by_name = {
-    cls.__name__: cls for cls in m5.objects.__dict__.values()
+    cls.__name__: cls for cls in list(m5.objects.__dict__.values())
     if inspect.isclass(cls) and issubclass(cls, m5.objects.SimObject) }
 
 # Add some parsing functions to Param classes to handle reading in .ini
@@ -129,7 +129,7 @@ param_parsers = {
     'EthernetAddr': simple_parser()
     }
 
-for name, parser in param_parsers.items():
+for name, parser in list(param_parsers.items()):
     setattr(m5.params.__dict__[name], 'parse_ini', classmethod(parser))
 
 class PortConnection(object):
@@ -193,7 +193,7 @@ class ConfigManager(object):
 
         parsed_params = {}
 
-        for param_name, param in object_class._params.items():
+        for param_name, param in list(object_class._params.items()):
             if issubclass(param.ptype, m5.params.ParamValue):
                 if isinstance(param, m5.params.VectorParamDesc):
                     param_values = self.config.get_param_vector(object_name,
@@ -221,7 +221,7 @@ class ConfigManager(object):
         if object_name == 'Null':
             return NULL
 
-        for param_name, param in obj.__class__._params.items():
+        for param_name, param in list(obj.__class__._params.items()):
             if issubclass(param.ptype, m5.objects.SimObject):
                 if isinstance(param, m5.params.VectorParamDesc):
                     param_values = self.config.get_param_vector(object_name,
@@ -286,11 +286,11 @@ class ConfigManager(object):
             return NULL
 
         parsed_ports = []
-        for port_name, port in obj.__class__._ports.items():
+        for port_name, port in list(obj.__class__._ports.items()):
             # Assume that unnamed ports are unconnected
             peers = self.config.get_port_peers(object_name, port_name)
 
-            for index, peer in zip(range(0, len(peers)), peers):
+            for index, peer in zip(list(range(0, len(peers))), peers):
                 parsed_ports.append((
                     PortConnection(object_name, port.name, index),
                     PortConnection.from_string(peer)))
@@ -368,12 +368,12 @@ class ConfigManager(object):
         # Now fill in SimObject-valued parameters in the knowledge that
         #   this won't be interpreted as becoming the parent of objects
         #   which are already in the root hierarchy
-        for name, obj in self.objects_by_name.items():
+        for name, obj in list(self.objects_by_name.items()):
             self.fill_in_simobj_parameters(name, obj)
 
         # Gather a list of all port-to-port connections
         connections = []
-        for name, obj in self.objects_by_name.items():
+        for name, obj in list(self.objects_by_name.items()):
             connections += self.gather_port_connections(name, obj)
 
         # Find an acceptable order to bind those port connections and
@@ -415,7 +415,7 @@ class ConfigFile(object):
 
 class ConfigIniFile(ConfigFile):
     def __init__(self):
-        self.parser = ConfigParser.ConfigParser()
+        self.parser = configparser.ConfigParser()
 
     def load(self, config_file):
         self.parser.read(config_file)
@@ -466,7 +466,7 @@ class ConfigJsonFile(ConfigFile):
             for elem in node:
                 self.find_all_objects(elem)
         elif isinstance(node, dict):
-            for elem in node.values():
+            for elem in list(node.values()):
                 self.find_all_objects(elem)
 
     def load(self, config_file):
@@ -505,7 +505,7 @@ class ConfigJsonFile(ConfigFile):
         obj = self.object_dicts[object_name]
 
         children = []
-        for name, node in obj.items():
+        for name, node in list(obj.items()):
             if self.is_sim_object(node):
                 children.append((name, node['path']))
             elif isinstance(node, list) and node != [] and all([
index cd51bcac60c2d8afd0319db832617697be3240ce..a347f437390b8185fef80b7044037b1448ad33f3 100644 (file)
@@ -34,7 +34,7 @@ import m5
 from m5.objects import *
 from m5.defines import buildEnv
 from m5.util import addToPath, convert
-from CntrlBase import *
+from .CntrlBase import *
 
 addToPath('../')
 
index 26bea0c8fd9ffd16693e7036217e47c0102bd7ba..58711ea0d0a67264fc081d8fc66374621bbbb57f 100644 (file)
 # 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 *
 from m5.defines import buildEnv
 from m5.util import addToPath
-from Ruby import create_topology
-from Ruby import send_evicts
+from .Ruby import create_topology
+from .Ruby import send_evicts
 
 addToPath('../')
 
 from topologies.Cluster import Cluster
 from topologies.Crossbar import Crossbar
 
+if six.PY3:
+    long = int
+
 class CntrlBase:
     _seqs = 0
     @classmethod
index f4ecc414df87af7f4745d13723f06a2bbba5f5ac..58572ae193a83c54d9e9bbd9febcf5c077edf39a 100644 (file)
 # 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 *
 from m5.defines import buildEnv
 from m5.util import addToPath
-from Ruby import create_topology
-from Ruby import send_evicts
+from .Ruby import create_topology
+from .Ruby import send_evicts
 
 addToPath('../')
 
 from topologies.Cluster import Cluster
 from topologies.Crossbar import Crossbar
 
+if six.PY3:
+    long = int
+
 class CntrlBase:
     _seqs = 0
     @classmethod
@@ -516,16 +520,16 @@ def create_system(options, full_system, system, dma_devices, bootmem,
 
     # Register CPUs and caches for each CorePair and directory (SE mode only)
     if not full_system:
-        for i in xrange((options.num_cpus + 1) // 2):
+        for i in range((options.num_cpus + 1) // 2):
             FileSystemConfig.register_cpu(physical_package_id = 0,
                                           core_siblings = \
-                                            xrange(options.num_cpus),
+                                            range(options.num_cpus),
                                           core_id = i*2,
                                           thread_siblings = [])
 
             FileSystemConfig.register_cpu(physical_package_id = 0,
                                           core_siblings = \
-                                            xrange(options.num_cpus),
+                                            range(options.num_cpus),
                                           core_id = i*2+1,
                                           thread_siblings = [])
 
@@ -564,7 +568,7 @@ def create_system(options, full_system, system, dma_devices, bootmem,
                                             line_size = options.cacheline_size,
                                             assoc = options.l3_assoc,
                                             cpus = [n for n in
-                                                xrange(options.num_cpus)])
+                                                range(options.num_cpus)])
 
     gpuCluster = None
     if hasattr(options, 'bw_scalor') and options.bw_scalor > 0:
index 46fdec9a3be5011d657bbf91b5a652feda3dcd70..5388a4ef6bfcf4b53ad75463a51397d54d06adb1 100644 (file)
 # 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 *
 from m5.defines import buildEnv
 from m5.util import addToPath
-from Ruby import create_topology
-from Ruby import send_evicts
+from .Ruby import create_topology
+from .Ruby import send_evicts
 
 addToPath('../')
 
 from topologies.Cluster import Cluster
 from topologies.Crossbar import Crossbar
 
+if six.PY3:
+    long = int
+
 class CntrlBase:
     _seqs = 0
     @classmethod
index 7b15403140cc0582dc495261724390ffec1616c0..a8b39aeae3966a6b900056e31a1039b5e3460b2c 100644 (file)
 # 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 *
 from m5.defines import buildEnv
 from m5.util import addToPath
-from Ruby import send_evicts
+from .Ruby import send_evicts
 
 addToPath('../')
 
 from topologies.Cluster import Cluster
 
+if six.PY3:
+    long = int
+
 class CntrlBase:
     _seqs = 0
     @classmethod
index 4aee7a46d26e3b11c76aabd0dca1524a843cb9b8..4b7ca8d1225f2bd042551c711803176b5e83bf8e 100644 (file)
@@ -29,7 +29,7 @@ import m5
 from m5.objects import *
 from m5.defines import buildEnv
 from m5.util import addToPath
-from Ruby import create_topology, create_directories
+from .Ruby import create_topology, create_directories
 
 #
 # Declare caches used by the protocol
index 0bd893e380c0343159db029322a85423a7302544..7cfb83242f265da7d98ec3704b2758d5519e36c2 100644 (file)
@@ -31,8 +31,8 @@ import math
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
-from Ruby import create_topology, create_directories
-from Ruby import send_evicts
+from .Ruby import create_topology, create_directories
+from .Ruby import send_evicts
 from common import FileSystemConfig
 
 #
@@ -294,10 +294,10 @@ def create_system(options, full_system, system, dma_ports, bootmem,
         all_cntrls = all_cntrls + [io_controller]
     # Register configuration with filesystem
     else:
-        for i in xrange(options.num_clusters):
-            for j in xrange(num_cpus_per_cluster):
+        for i in range(options.num_clusters):
+            for j in range(num_cpus_per_cluster):
                 FileSystemConfig.register_cpu(physical_package_id = 0,
-                                              core_siblings = xrange(options.num_cpus),
+                                              core_siblings = range(options.num_cpus),
                                               core_id = i*num_cpus_per_cluster+j,
                                               thread_siblings = [])
 
@@ -329,7 +329,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                                    num_l2caches_per_cluster)+'B',
                                             line_size = options.cacheline_size,
                                             assoc = options.l2_assoc,
-                                            cpus = [n for n in xrange(i*num_cpus_per_cluster, \
+                                            cpus = [n for n in range(i*num_cpus_per_cluster, \
                                                                      (i+1)*num_cpus_per_cluster)])
 
     ruby_system.network.number_of_virtual_networks = 3
index 3ddf8eff7161f70b0e3c248837c82fbd10e56378..77fef767fe9daabfa3fca933b7a64fa2be78e1c6 100644 (file)
@@ -29,8 +29,8 @@ import math
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
-from Ruby import create_topology, create_directories
-from Ruby import send_evicts
+from .Ruby import create_topology, create_directories
+from .Ruby import send_evicts
 
 #
 # Declare caches used by the protocol
index 2ea6699d8a299ce1ff21b398055d37c43e62f8ca..264f709ecca87b664c4a54f2a3c0f101060202e5 100644 (file)
@@ -29,8 +29,8 @@ import math
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
-from Ruby import create_topology, create_directories
-from Ruby import send_evicts
+from .Ruby import create_topology, create_directories
+from .Ruby import send_evicts
 
 #
 # Declare caches used by the protocol
@@ -113,7 +113,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
         l1_cntrl.responseToCache = MessageBuffer(ordered = True)
         l1_cntrl.responseToCache.slave = ruby_system.network.master
 
-    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
+    phys_mem_size = sum([r.size() for r in system.mem_ranges])
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index aa9dd5049049f3585c5ae7afb9cc8252375463c3..91ff4d232a650b7a50233778940580f02f7f8f06 100644 (file)
@@ -34,8 +34,8 @@ import m5
 from m5.objects import *
 from m5.defines import buildEnv
 from m5.util import addToPath
-from Ruby import create_topology
-from Ruby import send_evicts
+from .Ruby import create_topology
+from .Ruby import send_evicts
 from common import FileSystemConfig
 
 addToPath('../')
@@ -328,16 +328,16 @@ def create_system(options, full_system, system, dma_devices, bootmem,
 
     # Register CPUs and caches for each CorePair and directory (SE mode only)
     if not full_system:
-        for i in xrange((options.num_cpus + 1) // 2):
+        for i in range((options.num_cpus + 1) // 2):
             FileSystemConfig.register_cpu(physical_package_id = 0,
                                           core_siblings =
-                                            xrange(options.num_cpus),
+                                            range(options.num_cpus),
                                           core_id = i*2,
                                           thread_siblings = [])
 
             FileSystemConfig.register_cpu(physical_package_id = 0,
                                           core_siblings =
-                                            xrange(options.num_cpus),
+                                            range(options.num_cpus),
                                           core_id = i*2+1,
                                           thread_siblings = [])
 
@@ -376,7 +376,7 @@ def create_system(options, full_system, system, dma_devices, bootmem,
                                             line_size = options.cacheline_size,
                                             assoc = options.l3_assoc,
                                             cpus = [n for n in
-                                                xrange(options.num_cpus)])
+                                                range(options.num_cpus)])
 
     # Assuming no DMA devices
     assert(len(dma_devices) == 0)
index 2b7770a948173900504870bb2cdae7f5249e7609..8778b61dcb820f0c235ebdf597de121c3783a3a8 100644 (file)
@@ -41,8 +41,8 @@ import math
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
-from Ruby import create_topology, create_directories
-from Ruby import send_evicts
+from .Ruby import create_topology, create_directories
+from .Ruby import send_evicts
 
 #
 # Declare caches used by the protocol
index a2c41c08a01762eace87c1c76adc431ff4b0f1cc..80944f56605dda764d5098008b73d42e91021ceb 100644 (file)
@@ -29,8 +29,8 @@ import math
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
-from Ruby import create_topology, create_directories
-from Ruby import send_evicts
+from .Ruby import create_topology, create_directories
+from .Ruby import send_evicts
 
 #
 # Declare caches used by the protocol
index 5aac38b3e956f28195928c5079fd6509b47b2893..c83bb72dcddf9e9308dc4705a0067fd158079701 100644 (file)
@@ -29,8 +29,8 @@ import math
 import m5
 from m5.objects import *
 from m5.defines import buildEnv
-from Ruby import create_topology, create_directories
-from Ruby import send_evicts
+from .Ruby import create_topology, create_directories
+from .Ruby import send_evicts
 from common import FileSystemConfig
 
 #
@@ -257,7 +257,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
         all_cntrls = all_cntrls + [io_controller]
     # Register configuration with filesystem
     else:
-        for i in xrange(options.num_cpus):
+        for i in range(options.num_cpus):
             FileSystemConfig.register_cpu(physical_package_id = 0,
                                           core_siblings = [],
                                           core_id = i,
index 6d97f8228db7b16592768bf9ba69b7407e4eb0f6..7d065de5b9aba791c1ca092acc8490e79430c20a 100644 (file)
@@ -101,7 +101,7 @@ class MeshDirCorners_XY(SimpleTopology):
         # NUMA Node for each quadrant
         # With odd columns or rows, the nodes will be unequal
         numa_nodes = [ [], [], [], []]
-        for i in xrange(num_routers):
+        for i in range(num_routers):
             if i % num_columns < num_columns / 2  and \
                i < num_routers / 2:
                 numa_nodes[0].append(i)
index 3ae34857ad77167756ac44caeace84c6935240ac..64a8506160e11028c4854b6478f8797c2947a6aa 100644 (file)
@@ -176,6 +176,6 @@ class Mesh_XY(SimpleTopology):
 
     # Register nodes with filesystem
     def registerTopology(self, options):
-        for i in xrange(options.num_cpus):
+        for i in range(options.num_cpus):
             FileSystemConfig.register_node([i],
                     MemorySize(options.mem_size) / options.num_cpus, i)