hdl.ast: make Value.__abs__ return unsigned shape.

This commit is contained in:
Marcelina Kościelnicka 2023-06-07 17:50:01 +02:00 committed by Catherine
parent 51391be1ae
commit b1cce87630
2 changed files with 12 additions and 1 deletions

View file

@ -263,7 +263,7 @@ class Value(metaclass=ABCMeta):
def __abs__(self):
if self.shape().signed:
return Mux(self >= 0, self, -self)
return Mux(self >= 0, self, -self)[:len(self)]
else:
return self