diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-02-25 11:55:02 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-03-18 15:13:52 +0000 |
commit | fe3e8084959a6910f4c8d075c5c03e40d0269527 (patch) | |
tree | 7e4e43608dfd8d3d5544177e439f57733f3837d8 /configs/ruby | |
parent | 9e22a2ab603d743b187108986cfbeba07c0c0b8d (diff) | |
download | gem5-fe3e8084959a6910f4c8d075c5c03e40d0269527.tar.xz |
configs: Use absolute import paths
Use absoluate import paths to be Python 3 compatible. This also
imports absolute_import from __future__ to ensure that Python 2.7
behaves the same way as Python 3.
Change-Id: Ica06ed95814e9cd3e768b3e1785075e36f6e56d0
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16708
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'configs/ruby')
-rw-r--r-- | configs/ruby/GPU_RfO.py | 4 | ||||
-rw-r--r-- | configs/ruby/MI_example.py | 4 | ||||
-rw-r--r-- | configs/ruby/Ruby.py | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/configs/ruby/GPU_RfO.py b/configs/ruby/GPU_RfO.py index afe9614c0..c9bda0bc9 100644 --- a/configs/ruby/GPU_RfO.py +++ b/configs/ruby/GPU_RfO.py @@ -36,8 +36,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 addToPath('../') diff --git a/configs/ruby/MI_example.py b/configs/ruby/MI_example.py index e3395bdd2..5e3ec58f0 100644 --- a/configs/ruby/MI_example.py +++ b/configs/ruby/MI_example.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 # # Declare caches used by the protocol diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 03e836eb0..ffa5a0294 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -81,7 +81,7 @@ def define_options(parser): help="Recycle latency for ruby controller input buffers") protocol = buildEnv['PROTOCOL'] - exec "import %s" % protocol + exec("from . import %s" % protocol) eval("%s.define_options(parser)" % protocol) Network.define_options(parser) @@ -144,7 +144,7 @@ def create_topology(controllers, options): found in configs/topologies/BaseTopology.py This is a wrapper for the legacy topologies. """ - exec "import topologies.%s as Topo" % options.topology + exec("import topologies.%s as Topo" % options.topology) topology = eval("Topo.%s(controllers)" % options.topology) return topology @@ -160,7 +160,7 @@ def create_system(options, full_system, system, piobus = None, dma_ports = [], ruby.network = network protocol = buildEnv['PROTOCOL'] - exec "import %s" % protocol + exec("from . import %s" % protocol) try: (cpu_sequencers, dir_cntrls, topology) = \ eval("%s.create_system(options, full_system, system, dma_ports,\ |