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/learning_gem5 | |
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/learning_gem5')
-rw-r--r-- | configs/learning_gem5/part1/caches.py | 4 | ||||
-rw-r--r-- | configs/learning_gem5/part1/simple.py | 2 | ||||
-rw-r--r-- | configs/learning_gem5/part1/two_level.py | 1 | ||||
-rw-r--r-- | configs/learning_gem5/part2/hello_goodbye.py | 1 | ||||
-rw-r--r-- | configs/learning_gem5/part2/run_simple.py | 1 | ||||
-rw-r--r-- | configs/learning_gem5/part2/simple_cache.py | 1 | ||||
-rw-r--r-- | configs/learning_gem5/part2/simple_memobj.py | 1 | ||||
-rw-r--r-- | configs/learning_gem5/part3/msi_caches.py | 3 | ||||
-rw-r--r-- | configs/learning_gem5/part3/ruby_caches_MI_example.py | 3 | ||||
-rw-r--r-- | configs/learning_gem5/part3/ruby_test.py | 3 | ||||
-rw-r--r-- | configs/learning_gem5/part3/simple_ruby.py | 3 | ||||
-rw-r--r-- | configs/learning_gem5/part3/test_caches.py | 5 |
12 files changed, 25 insertions, 3 deletions
diff --git a/configs/learning_gem5/part1/caches.py b/configs/learning_gem5/part1/caches.py index 5183c134d..5e87c2b2f 100644 --- a/configs/learning_gem5/part1/caches.py +++ b/configs/learning_gem5/part1/caches.py @@ -33,6 +33,10 @@ This file contains L1 I/D and L2 caches to be used in the simple 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 5336b445b..c624de0aa 100644 --- a/configs/learning_gem5/part1/simple.py +++ b/configs/learning_gem5/part1/simple.py @@ -38,6 +38,8 @@ 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 diff --git a/configs/learning_gem5/part1/two_level.py b/configs/learning_gem5/part1/two_level.py index 51d51c474..b6f8781d2 100644 --- a/configs/learning_gem5/part1/two_level.py +++ b/configs/learning_gem5/part1/two_level.py @@ -41,6 +41,7 @@ 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 diff --git a/configs/learning_gem5/part2/hello_goodbye.py b/configs/learning_gem5/part2/hello_goodbye.py index e908ae0c3..e5ee5e78b 100644 --- a/configs/learning_gem5/part2/hello_goodbye.py +++ b/configs/learning_gem5/part2/hello_goodbye.py @@ -37,6 +37,7 @@ 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 diff --git a/configs/learning_gem5/part2/run_simple.py b/configs/learning_gem5/part2/run_simple.py index 1b729ae7c..7940c0e04 100644 --- a/configs/learning_gem5/part2/run_simple.py +++ b/configs/learning_gem5/part2/run_simple.py @@ -36,6 +36,7 @@ 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 diff --git a/configs/learning_gem5/part2/simple_cache.py b/configs/learning_gem5/part2/simple_cache.py index 98078df30..c65024233 100644 --- a/configs/learning_gem5/part2/simple_cache.py +++ b/configs/learning_gem5/part2/simple_cache.py @@ -34,6 +34,7 @@ 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 diff --git a/configs/learning_gem5/part2/simple_memobj.py b/configs/learning_gem5/part2/simple_memobj.py index 066bca08d..24c6a24d6 100644 --- a/configs/learning_gem5/part2/simple_memobj.py +++ b/configs/learning_gem5/part2/simple_memobj.py @@ -34,6 +34,7 @@ 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 diff --git a/configs/learning_gem5/part3/msi_caches.py b/configs/learning_gem5/part3/msi_caches.py index 7bd24efe1..42ec95a9f 100644 --- a/configs/learning_gem5/part3/msi_caches.py +++ b/configs/learning_gem5/part3/msi_caches.py @@ -36,6 +36,9 @@ 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 104f0dff9..db39bace7 100644 --- a/configs/learning_gem5/part3/ruby_caches_MI_example.py +++ b/configs/learning_gem5/part3/ruby_caches_MI_example.py @@ -38,6 +38,9 @@ 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 692a87e62..45c139bdf 100644 --- a/configs/learning_gem5/part3/ruby_test.py +++ b/configs/learning_gem5/part3/ruby_test.py @@ -35,13 +35,14 @@ 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 from m5.objects import * -from test_caches import TestCacheSystem +from .test_caches import TestCacheSystem # create the system we are going to simulate system = System() diff --git a/configs/learning_gem5/part3/simple_ruby.py b/configs/learning_gem5/part3/simple_ruby.py index 9b89b78fd..dda9e6dc7 100644 --- a/configs/learning_gem5/part3/simple_ruby.py +++ b/configs/learning_gem5/part3/simple_ruby.py @@ -38,6 +38,7 @@ 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 @@ -46,7 +47,7 @@ from m5.objects import * # You can import ruby_caches_MI_example to use the MI_example protocol instead # of the MSI protocol -from msi_caches import MyCacheSystem +from .msi_caches import MyCacheSystem # create the system we are going to simulate system = System() diff --git a/configs/learning_gem5/part3/test_caches.py b/configs/learning_gem5/part3/test_caches.py index 3721f4a6b..4b17250ff 100644 --- a/configs/learning_gem5/part3/test_caches.py +++ b/configs/learning_gem5/part3/test_caches.py @@ -36,12 +36,15 @@ 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 from m5.objects import * -from msi_caches import L1Cache, DirController, MyNetwork +from .msi_caches import L1Cache, DirController, MyNetwork class TestCacheSystem(RubySystem): |