From: Steve Reinhardt Date: Sat, 4 Jan 2014 01:08:42 +0000 (-0800) Subject: python: don't die on assignment to cloned object X-Git-Tag: stable_2014_02_15~2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba9ec669bcf68e4d4e3322f07e5f51af19f05b4a;p=gem5.git python: don't die on assignment to cloned object Updating the SimObject topology of a cloned hierarchy is a little dangerous, in that cloning is a "deep copy" and the clone does not inherit SimObject updates the same way it would inherit scalar variable assignments. However, because of various SimObject-valued proxy parameters, like 'memories', 'clk_domain', and 'system', it turns out that there are a number of implicit topology changes that happen at instantiation, which means that these changes are impossible to avoid. So in order to make cloning systems useful, this error has to go. Changing it to a warning produces a lot of noise, so it seems best just to delete it. --- diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 9b60dfef6..013f609d6 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -740,11 +740,6 @@ class SimObject(object): self._get_port_ref(attr).connect(value) return - if isSimObjectOrSequence(value) and self._instantiated: - raise RuntimeError, \ - "cannot set SimObject parameter '%s' after\n" \ - " instance been cloned %s" % (attr, `self`) - param = self._params.get(attr) if param: try: