diff options
author | Neel Gala <neelgala@incoresemi.com> | 2023-04-07 16:25:46 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 16:25:46 +0530 |
commit | 546676352d6f8d3c8df73f69dccf6e1ea2389d11 (patch) | |
tree | 89179bebfc52d5dab170f2f38132272a0917d394 | |
parent | 5adef50bd3f8aaff379f7f99e5b6817e2dedf0ed (diff) | |
parent | 89ac807055d4c4086b623325e0cc8a9e6f92cd21 (diff) | |
download | riscv-opcodes-546676352d6f8d3c8df73f69dccf6e1ea2389d11.zip riscv-opcodes-546676352d6f8d3c8df73f69dccf6e1ea2389d11.tar.gz riscv-opcodes-546676352d6f8d3c8df73f69dccf6e1ea2389d11.tar.bz2 |
Merge pull request #172 from dramforever/instr_dict_extension_fix
Fix merging of instructions with the same name
-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(): |