Daniel Carvalho has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/17048 )

Change subject: python: Fix unknown params and proxy multiplication
......................................................................

python: Fix unknown params and proxy multiplication

One of the recent changes made params not visible anymore:
    NameError: global name 'params' is not defined
This is fixed by adding the proper import statement.

However, the second error makes the multiplication values be assigned
to other proxies (that are not even used on the multiplication). A
workaround is added to prevent this from happening by extending "*=".

Change-Id: I3ad276a456efff62058672d16caac2b3ad1b326b
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17048
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
---
M src/python/m5/proxy.py
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved



diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py
index d289545..8632196 100644
--- a/src/python/m5/proxy.py
+++ b/src/python/m5/proxy.py
@@ -87,6 +87,7 @@
     __rmul__ = __mul__

     def _mulcheck(self, result, base):
+        from . import params
         for multiplier in self._multipliers:
             if isproxy(multiplier):
                 multiplier = multiplier.unproxy(base)
@@ -96,7 +97,7 @@
                     raise TypeError(
                         "Proxy multiplier must be a numerical param")
                 multiplier = multiplier.getValue()
-            result *= multiplier
+            result = result * multiplier
         return result

     def unproxy(self, base):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17048
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I3ad276a456efff62058672d16caac2b3ad1b326b
Gerrit-Change-Number: 17048
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to