From: Sebastien Bourdeauducq Date: Sun, 10 Mar 2013 17:11:29 +0000 (+0100) Subject: bank/description/AutoReg: check that get_memories and get_registers are callable X-Git-Tag: 24jan2021_ls180~2099^2~666 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cddbc1157d793c334be4dfdfe1c3f85a21aa0d30;p=litex.git bank/description/AutoReg: check that get_memories and get_registers are callable --- diff --git a/migen/bank/description.py b/migen/bank/description.py index b68384cb..016d830c 100644 --- a/migen/bank/description.py +++ b/migen/bank/description.py @@ -67,7 +67,7 @@ class AutoReg: for k, v in self.__dict__.items(): if isinstance(v, Memory): r.append(v) - elif hasattr(v, "get_memories"): + elif hasattr(v, "get_memories") and callable(v.get_memories): r += memprefix(k + "_", v.get_memories()) return sorted(r, key=lambda x: x.huid) @@ -76,7 +76,7 @@ class AutoReg: for k, v in self.__dict__.items(): if isinstance(v, Register): r.append(v) - elif hasattr(v, "get_registers"): + elif hasattr(v, "get_registers") and callable(v.get_registers): r += regprefix(k + "_", v.get_registers()) return sorted(r, key=lambda x: x.huid)