From: Sebastien Bourdeauducq Date: Tue, 6 Nov 2012 12:51:51 +0000 (+0100) Subject: fhdl/structure: make all values hashable X-Git-Tag: 24jan2021_ls180~2099^2~816 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56d4cdeb48b25df1f86bfcf8f8c1c89b1e6cdf9c;p=litex.git fhdl/structure: make all values hashable --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index fa97b793..f0ab2de8 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -109,6 +109,9 @@ class Value: def eq(self, r): return _Assign(self, r) + + def __hash__(self): + return id(self) class _Operator(Value): def __init__(self, op, operands): @@ -168,9 +171,6 @@ class Signal(Value): def __len__(self): return self.bv.width - def __hash__(self): - return id(self) - def __repr__(self): return ""