Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33695 )

Change subject: scons: Make scons aware of changes to cxx_type in param types.
......................................................................

scons: Make scons aware of changes to cxx_type in param types.

If the cxx_type value changes, then the way the parameter is declared
in the param struct will also change, and the header needs to be
updated. scons would miss this sort of change before because it was only
checking the module the SimObject's source came from. The python names
and types of the parameters could stay the same, but the C++
representation might have changed because of edits somewhere else.

This CL assumes that cxx_type is the only thing that will change and
transparently affect the params struct. I tried making scons sensitive
to the entire ptype which would capture other parameters, but that
didn't work for some reason. This should be pretty safe in general, but
not 100% safe

Issue-on: https://gem5.atlassian.net/browse/GEM5-753
Change-Id: I06774889e60b987f727799f55d7ea2a775b6a319
---
M src/SConscript
1 file changed, 8 insertions(+), 0 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index 66db2f7..d9cde28 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -922,9 +922,17 @@
 # Generate all of the SimObject param C++ struct header files
 params_hh_files = []
 for name,simobj in sorted(sim_objects.items()):
+    # If this simobject's source changes, we need to regenerate the header.
     py_source = PySource.modules[simobj.__module__]
     extra_deps = [ py_source.tnode ]

+    # Get the params for just this SimObject, excluding base classes.
+    params = simobj._params.local.values()
+    # Extract the parameters' c++ types.
+    types = sorted(map(lambda p: p.ptype.cxx_type, params))
+    # If any of these types have changed, we need to regenerate the header.
+    extra_deps.append(Value(types))
+
     hh_file = File('params/%s.hh' % name)
     params_hh_files.append(hh_file)
     env.Command(hh_file, Value(name),

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33695
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: I06774889e60b987f727799f55d7ea2a775b6a319
Gerrit-Change-Number: 33695
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

Reply via email to