From d0cf375010f67a262f95b2fde46b9f2391ceba43 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 17 Mar 2021 19:45:39 -0700 Subject: [PATCH] force opcode field to be always specified in binary for opint=True CSVs --- src/soc/decoder/power_decoder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/soc/decoder/power_decoder.py b/src/soc/decoder/power_decoder.py index 23954142..79dd7951 100644 --- a/src/soc/decoder/power_decoder.py +++ b/src/soc/decoder/power_decoder.py @@ -382,8 +382,12 @@ class PowerDecoder(Elaboratable): eq += seqs for row in d.opcodes: opcode = row['opcode'] - if d.opint and '-' not in opcode: - opcode = int(opcode, 0) + if d.opint: + assert opcode.startswith('0b') + if '-' not in opcode: + opcode = int(opcode, 0) + else: + opcode = opcode[2:] if not row['unit']: continue if self.row_subsetfn: -- 2.30.2