From: Jason Lowe-Power Date: Thu, 14 May 2020 00:04:29 +0000 (-0700) Subject: configs: Updates for python3 X-Git-Tag: v20.0.0.0~31 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e2a510acefac357d83754369e6abd3e79db5d904;p=gem5.git configs: Updates for python3 Change-Id: Iab2f83716ea2cb19f06282f037314f2db843327a Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29047 Maintainer: Bobby R. Bruce Tested-by: kokoro Reviewed-by: Giacomo Travaglini --- diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py index d49ad78e7..e15459370 100644 --- a/configs/common/FSConfig.py +++ b/configs/common/FSConfig.py @@ -41,12 +41,17 @@ 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) diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py index 97279f1bc..ec27656e0 100644 --- a/configs/common/FileSystemConfig.py +++ b/configs/common/FileSystemConfig.py @@ -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 diff --git a/configs/common/HMC.py b/configs/common/HMC.py index c65b201b7..c4c0acc9e 100644 --- a/configs/common/HMC.py +++ b/configs/common/HMC.py @@ -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[ diff --git a/configs/common/ObjectList.py b/configs/common/ObjectList.py index 8bffa5fe0..c91ea0c65 100644 --- a/configs/common/ObjectList.py +++ b/configs/common/ObjectList.py @@ -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_"): diff --git a/configs/common/Options.py b/configs/common/Options.py index 6d0c6c295..3eff04bf9 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -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") diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py index 73a0ff541..e53c755c6 100644 --- a/configs/common/Simulation.py +++ b/configs/common/Simulation.py @@ -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): diff --git a/configs/common/SysPaths.py b/configs/common/SysPaths.py index f37039e1e..440b0cfea 100644 --- a/configs/common/SysPaths.py +++ b/configs/common/SysPaths.py @@ -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( diff --git a/configs/dram/lat_mem_rd.py b/configs/dram/lat_mem_rd.py index 07f9afcbb..9b04e4bd2 100644 --- a/configs/dram/lat_mem_rd.py +++ b/configs/dram/lat_mem_rd.py @@ -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 diff --git a/configs/dram/sweep.py b/configs/dram/sweep.py index d3c86c334..a340b46a5 100644 --- a/configs/dram/sweep.py +++ b/configs/dram/sweep.py @@ -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") diff --git a/configs/example/arm/baremetal.py b/configs/example/arm/baremetal.py index 412625d57..04f60a19b 100644 --- a/configs/example/arm/baremetal.py +++ b/configs/example/arm/baremetal.py @@ -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") diff --git a/configs/example/arm/devices.py b/configs/example/arm/devices.py index a45188b9c..cc8ac5ead 100644 --- a/configs/example/arm/devices.py +++ b/configs/example/arm/devices.py @@ -38,12 +38,17 @@ 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() diff --git a/configs/example/arm/fs_bigLITTLE.py b/configs/example/arm/fs_bigLITTLE.py index b7e794d58..228d11c7f 100644 --- a/configs/example/arm/fs_bigLITTLE.py +++ b/configs/example/arm/fs_bigLITTLE.py @@ -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", diff --git a/configs/example/arm/starter_fs.py b/configs/example/arm/starter_fs.py index 7a202807e..3033890f0 100644 --- a/configs/example/arm/starter_fs.py +++ b/configs/example/arm/starter_fs.py @@ -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") diff --git a/configs/example/arm/starter_se.py b/configs/example/arm/starter_se.py index 0f20ecc64..0003ce994 100644 --- a/configs/example/arm/starter_se.py +++ b/configs/example/arm/starter_se.py @@ -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") diff --git a/configs/example/read_config.py b/configs/example/read_config.py index 167815c70..52a53ba57 100644 --- a/configs/example/read_config.py +++ b/configs/example/read_config.py @@ -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([ diff --git a/configs/ruby/AMD_Base_Constructor.py b/configs/ruby/AMD_Base_Constructor.py index cd51bcac6..a347f4373 100644 --- a/configs/ruby/AMD_Base_Constructor.py +++ b/configs/ruby/AMD_Base_Constructor.py @@ -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('../') diff --git a/configs/ruby/GPU_RfO.py b/configs/ruby/GPU_RfO.py index 26bea0c8f..58711ea0d 100644 --- a/configs/ruby/GPU_RfO.py +++ b/configs/ruby/GPU_RfO.py @@ -29,19 +29,23 @@ # 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 diff --git a/configs/ruby/GPU_VIPER.py b/configs/ruby/GPU_VIPER.py index f4ecc414d..58572ae19 100644 --- a/configs/ruby/GPU_VIPER.py +++ b/configs/ruby/GPU_VIPER.py @@ -29,19 +29,23 @@ # 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: diff --git a/configs/ruby/GPU_VIPER_Baseline.py b/configs/ruby/GPU_VIPER_Baseline.py index 46fdec9a3..5388a4ef6 100644 --- a/configs/ruby/GPU_VIPER_Baseline.py +++ b/configs/ruby/GPU_VIPER_Baseline.py @@ -29,19 +29,23 @@ # 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 diff --git a/configs/ruby/GPU_VIPER_Region.py b/configs/ruby/GPU_VIPER_Region.py index 7b1540314..a8b39aeae 100644 --- a/configs/ruby/GPU_VIPER_Region.py +++ b/configs/ruby/GPU_VIPER_Region.py @@ -29,17 +29,21 @@ # 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 diff --git a/configs/ruby/Garnet_standalone.py b/configs/ruby/Garnet_standalone.py index 4aee7a46d..4b7ca8d12 100644 --- a/configs/ruby/Garnet_standalone.py +++ b/configs/ruby/Garnet_standalone.py @@ -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 diff --git a/configs/ruby/MESI_Three_Level.py b/configs/ruby/MESI_Three_Level.py index 0bd893e38..7cfb83242 100644 --- a/configs/ruby/MESI_Three_Level.py +++ b/configs/ruby/MESI_Three_Level.py @@ -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 diff --git a/configs/ruby/MESI_Two_Level.py b/configs/ruby/MESI_Two_Level.py index 3ddf8eff7..77fef767f 100644 --- a/configs/ruby/MESI_Two_Level.py +++ b/configs/ruby/MESI_Two_Level.py @@ -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 diff --git a/configs/ruby/MI_example.py b/configs/ruby/MI_example.py index 2ea6699d8..264f709ec 100644 --- a/configs/ruby/MI_example.py +++ b/configs/ruby/MI_example.py @@ -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 diff --git a/configs/ruby/MOESI_AMD_Base.py b/configs/ruby/MOESI_AMD_Base.py index aa9dd5049..91ff4d232 100644 --- a/configs/ruby/MOESI_AMD_Base.py +++ b/configs/ruby/MOESI_AMD_Base.py @@ -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) diff --git a/configs/ruby/MOESI_CMP_directory.py b/configs/ruby/MOESI_CMP_directory.py index 2b7770a94..8778b61dc 100644 --- a/configs/ruby/MOESI_CMP_directory.py +++ b/configs/ruby/MOESI_CMP_directory.py @@ -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 diff --git a/configs/ruby/MOESI_CMP_token.py b/configs/ruby/MOESI_CMP_token.py index a2c41c08a..80944f566 100644 --- a/configs/ruby/MOESI_CMP_token.py +++ b/configs/ruby/MOESI_CMP_token.py @@ -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 diff --git a/configs/ruby/MOESI_hammer.py b/configs/ruby/MOESI_hammer.py index 5aac38b3e..c83bb72dc 100644 --- a/configs/ruby/MOESI_hammer.py +++ b/configs/ruby/MOESI_hammer.py @@ -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, diff --git a/configs/topologies/MeshDirCorners_XY.py b/configs/topologies/MeshDirCorners_XY.py index 6d97f8228..7d065de5b 100644 --- a/configs/topologies/MeshDirCorners_XY.py +++ b/configs/topologies/MeshDirCorners_XY.py @@ -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) diff --git a/configs/topologies/Mesh_XY.py b/configs/topologies/Mesh_XY.py index 3ae34857a..64a850616 100644 --- a/configs/topologies/Mesh_XY.py +++ b/configs/topologies/Mesh_XY.py @@ -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)