mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
fhdl: make constants hashable
This commit is contained in:
parent
c1b8492b61
commit
26cf1b8840
1 changed files with 4 additions and 0 deletions
|
@ -146,6 +146,10 @@ class Constant(Value):
|
|||
|
||||
def __eq__(self, other):
|
||||
return self.bv == other.bv and self.n == other.n
|
||||
|
||||
def __hash__(self):
|
||||
return id(self)
|
||||
|
||||
|
||||
def binc(x, signed=False):
|
||||
return Constant(int(x, 2), BV(len(x), signed))
|
||||
|
|
Loading…
Reference in a new issue