Skip to content

Commit

Permalink
Fix incorrect encoding output in instr_dict.yaml. (riscv#127)
Browse files Browse the repository at this point in the history
Making a shallow copy of the list prevents updating the final encoding
output when checking for field overlap.

Incorrect:
encoding: 0000000rs2rs2rs2rs2rs2rs1rs1rs1rs1rs1000rdrdrdrdrd0110011

Correct:
encoding: 0000000----------000-----0110011
  • Loading branch information
kosayoda authored Jun 10, 2022
1 parent 4c1f976 commit 4d4ebb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def process_enc_line(line, ext):
# check if all args of the instruction are present in arg_lut present in
# constants.py
args = single_fixed.sub(' ', remaining).split()
encoding_args = encoding
encoding_args = encoding.copy()
for a in args:
if a not in arg_lut:
logging.error(f' Found variable {a} in instruction {name} whose mapping in arg_lut does not exist')
Expand Down

0 comments on commit 4d4ebb0

Please sign in to comment.