hdl.ast: fix ValueKey.__eq__
.
This commit is contained in:
parent
20db537162
commit
3d3846e996
|
@ -1745,7 +1745,7 @@ class ValueKey:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if isinstance(self.value, Const):
|
if isinstance(self.value, Const):
|
||||||
return self.value.value == other.value.value
|
return self.value.value == other.value.value and self.value.width == other.value.width
|
||||||
elif isinstance(self.value, (Signal, AnyValue)):
|
elif isinstance(self.value, (Signal, AnyValue)):
|
||||||
return self.value is other.value
|
return self.value is other.value
|
||||||
elif isinstance(self.value, (ClockSignal, ResetSignal)):
|
elif isinstance(self.value, (ClockSignal, ResetSignal)):
|
||||||
|
@ -1765,8 +1765,9 @@ class ValueKey:
|
||||||
self.value.width == other.value.width and
|
self.value.width == other.value.width and
|
||||||
self.value.stride == other.value.stride)
|
self.value.stride == other.value.stride)
|
||||||
elif isinstance(self.value, Cat):
|
elif isinstance(self.value, Cat):
|
||||||
return all(ValueKey(a) == ValueKey(b)
|
return (len(self.value.parts) == len(other.value.parts) and
|
||||||
for a, b in zip(self.value.parts, other.value.parts))
|
all(ValueKey(a) == ValueKey(b)
|
||||||
|
for a, b in zip(self.value.parts, other.value.parts)))
|
||||||
elif isinstance(self.value, Repl):
|
elif isinstance(self.value, Repl):
|
||||||
return (ValueKey(self.value.value) == ValueKey(other.value.value) and
|
return (ValueKey(self.value.value) == ValueKey(other.value.value) and
|
||||||
self.value.count == other.value.count)
|
self.value.count == other.value.count)
|
||||||
|
|
Loading…
Reference in a new issue