aboutsummaryrefslogtreecommitdiff
path: root/parse.py
diff options
context:
space:
mode:
authorKieran Siek <github@siek.dev>2022-06-10 18:08:19 -0400
committerGitHub <noreply@github.com>2022-06-10 15:08:19 -0700
commit4d4ebb01f2c05ed96c87078ac98d31d1504138f1 (patch)
treec5124866425a463f14c33d85e9b72fa8b7f1f3e1 /parse.py
parent4c1f97638c0d858056480605fa6ea4cb5e61745a (diff)
downloadriscv-opcodes-4d4ebb01f2c05ed96c87078ac98d31d1504138f1.zip
riscv-opcodes-4d4ebb01f2c05ed96c87078ac98d31d1504138f1.tar.gz
riscv-opcodes-4d4ebb01f2c05ed96c87078ac98d31d1504138f1.tar.bz2
Fix incorrect encoding output in instr_dict.yaml. (#127)
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
Diffstat (limited to 'parse.py')
-rwxr-xr-xparse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.py b/parse.py
index 227d123..2de8fbc 100755
--- a/parse.py
+++ b/parse.py
@@ -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')