aboutsummaryrefslogtreecommitdiff
path: root/parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'parse.py')
-rwxr-xr-xparse.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/parse.py b/parse.py
index 635f952..1c41d9c 100755
--- a/parse.py
+++ b/parse.py
@@ -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():
@@ -982,10 +984,7 @@ if __name__ == "__main__":
if '-c' in sys.argv[1:]:
instr_dict_c = create_inst_dict(extensions, False,
- include_pseudo_ops=['pause', 'prefetch_r', 'prefetch_w', 'prefetch_i',
- 'slli_rv32', 'srli_rv32', 'srai_rv32',
- 'slli_rv128', 'srli_rv128', 'srai_rv128',
- ])
+ include_pseudo_ops=emitted_pseudo_ops)
instr_dict_c = collections.OrderedDict(sorted(instr_dict_c.items()))
make_c(instr_dict_c)
logging.info('encoding.out.h generated successfully')