Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/48380 )
Change subject: scons,python: Stop importing some values in m5.defines.
......................................................................
scons,python: Stop importing some values in m5.defines.
The compileDate and gem5Version fields are used in only one place,
gem5's python main function. These fields are the remaining difference
between the "fake" defines.py provided by the SimObject importer, and
the real one composed later. It makes sense to exclude them in the
"fake" version since those values come from c++, but it would feel like
an arbitrary and unexpected difference to people trying to use it.
Change-Id: Ie344765bf7c8063197da24f5b55f762379deff94
---
M src/SConscript
M src/python/m5/main.py
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/SConscript b/src/SConscript
index 5339f20..66a5c56 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -731,14 +731,7 @@
build_env = source[0].get_contents().decode('utf-8')
code = code_formatter()
- code("""
-import _m5.core
-
-buildEnv = dict($build_env)
-
-compileDate = _m5.core.compileDate
-gem5Version = _m5.core.gem5Version
-""")
+ code("buildEnv = dict($build_env)")
code.write(target[0].abspath)
defines_info = Value(build_env)
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 9342ad0..4fcdf70 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -213,6 +213,7 @@
def main(*args):
import m5
+ import _m5.core
from . import core
from . import debug
@@ -335,8 +336,8 @@
print(brief_copyright)
print()
- print("gem5 version %s" % defines.gem5Version)
- print("gem5 compiled %s" % defines.compileDate)
+ print("gem5 version %s" % _m5.core.gem5Version)
+ print("gem5 compiled %s" % _m5.core.compileDate)
print("gem5 started %s" %
datetime.datetime.now().strftime("%b %e %Y %X"))
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48380
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie344765bf7c8063197da24f5b55f762379deff94
Gerrit-Change-Number: 48380
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s