From 1ccc7025398a78e0483ec5a9706a8de019d83474 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Thu, 23 Mar 2017 10:22:12 +0000 Subject: [PATCH] python: Fix unproxing of VectorParams Previously proxy vector parameters would resolve correctly only for Parent.all. Any other proxy such as Parent.any, or exact ones such as Parent.addr_range would resolve to a *vector* of the right value resulting into a vector of a vector. For example if we set: DirectoryController0.addr_range = [0x100000-0x1fffff, 0x200000-0x2fffff] DirectoryMemory0.addr_range = Parent.addr_range where DirectoryController0 is the parent SimObject of DirectoryMemory0 after unproxying the Parent.addr_range VectorParam we would get DirectoryMemory0.addr_range = [[0x100000-0x1fffff, 0x200000-0x2fffff]] This change unifies handling of all three proxies to the same correct unproxy mechanism. Change-Id: Ie5107f69f58eb700b3e1b92c55210e0d53e6788d Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2901 Maintainer: Andreas Sandberg Reviewed-by: Jason Lowe-Power --- src/python/m5/params.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 7a1eec84b..776fbe22b 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -245,10 +245,12 @@ class VectorParamValue(list): return [ v.getValue() for v in self ] def unproxy(self, base): - if len(self) == 1 and isinstance(self[0], proxy.AllProxy): + if len(self) == 1 and isinstance(self[0], proxy.BaseProxy): + # The value is a proxy (e.g. Parent.any, Parent.all or + # Parent.x) therefore try resolve it return self[0].unproxy(base) else: - return [v.unproxy(base) for v in self] + return [v.unproxy(base) for v in self] class SimObjectVector(VectorParamValue): # support clone operation -- 2.30.2