From: Jacob Lifshay Date: Thu, 18 Mar 2021 02:45:39 +0000 (-0700) Subject: force opcode field to be always specified in binary for opint=True CSVs X-Git-Tag: convert-csv-opcode-to-binary~4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d0cf375010f67a262f95b2fde46b9f2391ceba43;p=soc.git force opcode field to be always specified in binary for opint=True CSVs --- 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: