Skip to content

Commit

Permalink
Merge pull request riscv#172 from dramforever/instr_dict_extension_fix
Browse files Browse the repository at this point in the history
Fix merging of instructions with the same name
  • Loading branch information
neelgala authored Apr 7, 2023
2 parents 5adef50 + 89ac807 commit 5466763
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 5466763

Please sign in to comment.