Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/48380 )


1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48380
Tested-by: kokoro <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/SConscript
M src/python/m5/main.py
2 files changed, 4 insertions(+), 10 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/SConscript b/src/SConscript
index c71f07a..c53567f 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -693,14 +693,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 ab72395..a4af295 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -214,6 +214,7 @@

 def main(*args):
     import m5
+    import _m5.core

     from . import core
     from . import debug
@@ -336,8 +337,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: 12
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to