projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4fcd97f
)
allow small decimal opcodes
convert-csv-opcode-to-binary
author
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 18 Mar 2021 07:16:49 +0000
(
00:16
-0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 18 Mar 2021 07:16:49 +0000
(
00:16
-0700)
src/soc/decoder/power_decoder.py
patch
|
blob
|
history
diff --git
a/src/soc/decoder/power_decoder.py
b/src/soc/decoder/power_decoder.py
index 2b52cf5fbc19f156a3020576e0fee59aabee27d5..ace1ae280c6334bc9ca30b17c3da0379ef949d06 100644
(file)
--- a/
src/soc/decoder/power_decoder.py
+++ b/
src/soc/decoder/power_decoder.py
@@
-178,7
+178,9
@@
def parse_opcode(opcode, opint=True):
if isinstance(opcode, (int, PatternOpcode)):
return opcode
assert isinstance(opcode, str)
- assert opcode.startswith('0b')
+ if len(opcode) > 4 or '-' in opcode:
+ # all binary numbers must start with 0b
+ assert opcode.startswith('0b')
if '-' not in opcode:
opcode = int(opcode, 0)
else: