projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbae5bc
)
Fix error with selecting a selectableint using a selectableint
author
Michael Nolan
<mtnolan2640@gmail.com>
Mon, 18 May 2020 17:53:48 +0000
(13:53 -0400)
committer
Michael Nolan
<mtnolan2640@gmail.com>
Mon, 18 May 2020 17:53:48 +0000
(13:53 -0400)
src/soc/decoder/selectable_int.py
patch
|
blob
|
history
diff --git
a/src/soc/decoder/selectable_int.py
b/src/soc/decoder/selectable_int.py
index 522f65161277b9ed53b40311bb593a72a009e445..02f0ca831014bec4b908b39eed855c83fb196118 100644
(file)
--- a/
src/soc/decoder/selectable_int.py
+++ b/
src/soc/decoder/selectable_int.py
@@
-235,6
+235,8
@@
class SelectableInt:
return SelectableInt(self.value >> b.value, self.bits)
def __getitem__(self, key):
+ if isinstance(key, SelectableInt):
+ key = key.value
if isinstance(key, int):
assert key < self.bits, "key %d accessing %d" % (key, self.bits)
assert key >= 0
@@
-260,6
+262,8
@@
class SelectableInt:
return SelectableInt(value, bits)
def __setitem__(self, key, value):
+ if isinstance(key, SelectableInt):
+ key = key.value
if isinstance(key, int):
assert key < self.bits
assert key >= 0