diff options
author | dramforever <dramforever@live.com> | 2023-04-07 12:08:47 +0800 |
---|---|---|
committer | dramforever <dramforever@live.com> | 2023-04-07 12:11:06 +0800 |
commit | 89ac807055d4c4086b623325e0cc8a9e6f92cd21 (patch) | |
tree | 89179bebfc52d5dab170f2f38132272a0917d394 | |
parent | 5adef50bd3f8aaff379f7f99e5b6817e2dedf0ed (diff) | |
download | riscv-opcodes-89ac807055d4c4086b623325e0cc8a9e6f92cd21.zip riscv-opcodes-89ac807055d4c4086b623325e0cc8a9e6f92cd21.tar.gz riscv-opcodes-89ac807055d4c4086b623325e0cc8a9e6f92cd21.tar.bz2 |
Fix merging of instructions with the same name
Fixes generation of 'extension' field for instr_dict.yaml
-rwxr-xr-x | parse.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -247,8 +247,10 @@ def create_inst_dict(file_filter, include_pseudo=False, include_pseudo_ops=[]): err_msg += f'added from {item["extension"]} in same base extensions' logging.error(err_msg) raise SystemExit(1) - # update the final dict with the instruction - instr_dict[name] = single_dict + + if name not in instr_dict: + # update the final dict with the instruction + instr_dict[name] = single_dict # second pass if for pseudo instructions logging.debug('Collecting pseudo instructions now') @@ -382,10 +384,10 @@ def create_inst_dict(file_filter, include_pseudo=False, include_pseudo_ops=[]): err_msg += f'added from {var} but each have different encodings for the same instruction' logging.error(err_msg) raise SystemExit(1) - instr_dict[name]['extension'].append(single_dict['extension']) - - # update the final dict with the instruction - instr_dict[name] = single_dict + instr_dict[name]['extension'].extend(single_dict['extension']) + else: + # update the final dict with the instruction + instr_dict[name] = single_dict return instr_dict def make_priv_latex_table(): |