From 3600675075bae0f9b2895f78efdfd7b2cb046597 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 18 Mar 2021 00:16:49 -0700 Subject: [PATCH] allow small decimal opcodes --- src/soc/decoder/power_decoder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/soc/decoder/power_decoder.py b/src/soc/decoder/power_decoder.py index 2b52cf5f..ace1ae28 100644 --- 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: -- 2.30.2