Skip to content

Commit

Permalink
seal5/backends/report/properties/writer.py: fix undefined opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Mar 5, 2025
1 parent ea61178 commit 3d8c878
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions seal5/backends/report/properties/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ def detect_opcode(instr_def): # TODO: move to transform and store as attr
}
OPCODE_LOOKUP_REV = {v: k for k, v in OPCODE_LOOKUP.items()}
size = 0 # TODO: use instr_def.size
opcode = None
for e in reversed(instr_def.encoding):
# print("e", e, dir(e))
if isinstance(e, arch.BitVal):
length = e.length
if size == 0:
if length == 7:
val = e.value
val = e.value
if length >= 7:
val = val & 0b1111111
opcode = val >> 2
elif isinstance(e, arch.BitField):
length = e.range.length
Expand Down

0 comments on commit 3d8c878

Please sign in to comment.