From e33d8b32d94ef1c68adfb7722eebf5df0a5dc7fc Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 6 Jul 2020 20:48:26 +0100 Subject: [PATCH] do abs slightly differently in SelectableInt --- src/soc/decoder/selectable_int.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 1bd2b94c..359afc97 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -199,7 +199,7 @@ class SelectableInt: def __abs__(self): print ("abs", self.value & (1<<(self.bits-1))) if self.value & (1<<(self.bits-1)) != 0: - return SelectableInt(0, self.bits) - self + return -self return self def __rsub__(self, b): -- 2.30.2