History log of /gem5/src/python/m5/proxy.py
Revision Date Author Comments
# 13761:cf2082775e86 07-Mar-2019 Daniel R. Carvalho <odanrc@yahoo.com.br>

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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17048
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>


# 13742:9bc48e81b57e 27-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

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 <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/16004
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>


# 13719:74853963ddcf 25-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Add Python 3 workarounds for long

Python 3 doesn't have a separate long type. Make long an alias for int
where needed to maintain compatibility.

Change-Id: I4c0861302bc3a2fa5226b3041803ef975d29b2fd
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15988
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>


# 13716:950f9a2ffb78 26-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Fix params/proxy import loop

There is a circular dependency between params and proxy at import
time. This causes issues for Python 3. Add the imports to the specific
methods with the dependencies to make the import happen when the
method is executed instead.

Change-Id: I770112fd3c07c395459e204976942bda3dc7236f
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15993
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com>


# 13714:35636064b7a1 25-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Enforce absolute imports for Python 3 compatibility

Change-Id: Ia88d7fd472f7aed9b97df81468211384981bf6c6
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15983
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13663:9b64aeabf9a5 25-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Make exception handling Python 3 safe

Change-Id: I9c2cdfad20deb1ddfa224320cf93f2105d126652
Reviewed-on: https://gem5-review.googlesource.com/c/15980
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>


# 12798:d9fc94b42670 22-Jun-2018 Nikos Nikoleris <nikos.nikoleris@arm.com>

python: Add support for multiplying proxies to compatible Param

Previously we allowed multiplications between proxy Param and
compatible constants (int, long, float). This change extends this
functionality and adds support for multiplying with between proxy
Param and compatible proxy Param.

Change-Id: I23a083881ae4d770e818895b893534767cd2472d
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11510
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>


# 10195:7d4d0cd3f7e5 09-May-2014 Geoffrey Blake <Geoffrey.Blake@arm.com>

config: Avoid generating a reference to myself for Parent.any

The unproxy code for Parent.any can generate a circular reference
in certain situations with classes hierarchies like those in ClockDomain.py.
This patch solves this by marking ouself as visited to make sure the
search does not resolve to a self-reference.


# 9280:fda147c035b3 15-Oct-2012 Andreas Hansson <andreas.hansson@arm.com>

Param: Fix proxy traversal to support chained proxies

This patch modifies how proxies are traversed and unproxied to allow
chained proxies. The issue that is solved manifested itself when a
proxy during its evaluation ended up being hitting another proxy, and
the second one got evaluated using the object that was originally used
for the first proxy.

For a more tangible example, see the following patch on making the
default clock being inherited from the parent. In this patch, the CPU
clock is a proxy Parent.clock, which is overridden in the system to be
an actual value. This all works fine, but the AlphaLinuxSystem has a
boot_cpu_frequency parameter that is Self.cpu[0].clock.frequency. When
the latter is evaluated, it all happens relative to the current object
of the proxy, i.e. the system. Thus the cpu.clock is evaluated as
Parent.clock, but using the system rather than the cpu as the object
to enquire.


# 8927:bc3a389d1e37 05-Apr-2012 Andreas Hansson <andreas.hansson@arm.com>

Python: Make the All proxy traverse SimObject children as well

This patch changes the behaviour of the All proxy parameter to not
only consider the direct children, but also do a pre-order depth-first
traversal of the object tree and append all results from the
children.

This is used in a later patch to find all the memories in the system,
independent of where they are located in the hierarchy.


# 8459:b8c3c20d0385 10-Jul-2011 Ali Saidi <Ali.Saidi@ARM.com>

Config: Add support for a Self.all proxy object


# 3179:c86dfc93984b 08-Oct-2006 Steve Reinhardt <stever@eecs.umich.edu>

Fixes for Port proxies and proxy parameters.


# 3109:c3956807347f 08-Sep-2006 Steve Reinhardt <stever@eecs.umich.edu>

Add support for assigning lists of ports or proxies to VectorPorts.
Includes support for printing readable VectorPort and Proxy names
(via __str__).


# 3105:993f1abefd67 06-Sep-2006 Steve Reinhardt <stever@eecs.umich.edu>

Enable proxies (Self/Parent) for specifying ports.
Significant revamp of Port code.
Some cleanup of SimObject code too, particularly to
make the SimObject and MetaSimObject implementations of
__setattr__ more consistent.
Unproxy code split out of print_ini().

src/python/m5/multidict.py:
Make get() return None by default, to match semantics
of built-in dictionary objects.


# 3101:6cce868ddaa6 04-Sep-2006 Steve Reinhardt <stever@eecs.umich.edu>

Split config.py into multiple files.
Some tweaking to deal with mutually recursive imports.