Andreas Sandberg has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/16004 )

Change subject: python: Fix issue when Self proxy resolves to a another proxy
......................................................................

python: Fix issue when Self proxy resolves to a another proxy

The problem occurs when a proxy is being resolved to another proxy
that hasn't been resolved yet. The problematic case that was
triggering this issues in the VGIC. It was caused by parameters
looking a bit like this:

gic = Param.GicV2(Parent.any)
some_param = Param.Int(Self.gic.some_param)

When 'some_param' was resolved, it found the 'gic' parameter in
Self. However, that parameter hadn't been resolved yet, so the
existing code was setting the proxy evaluation context to the
unresolved Parent.any proxy without first unproxying it.

It seems like this bug depends on the graph traversal order and I have
so far only seen it when compiling gem5 with Python 3.

Change-Id: Iea12cc138765e70bfd6bb776b1efa012364db066
Signed-off-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/16004
Reviewed-by: Jason Lowe-Power <[email protected]>
---
M src/python/m5/proxy.py
1 file changed, 5 insertions(+), 3 deletions(-)

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



diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py
index 5128156..d289545 100644
--- a/src/python/m5/proxy.py
+++ b/src/python/m5/proxy.py
@@ -187,13 +187,15 @@
             if hasattr(val, '_visited'):
                 visited = getattr(val, '_visited')

-            if not visited:
+            if visited:
+                return None, False
+
+            if not isproxy(val):
                 # for any additional unproxying to be done, pass the
                 # current, rather than the original object so that proxy
                 # has the right context
                 obj = val
-            else:
-                return None, False
+
         except:
             return None, False
         while isproxy(val):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/16004
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: Iea12cc138765e70bfd6bb776b1efa012364db066
Gerrit-Change-Number: 16004
Gerrit-PatchSet: 11
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[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