aboutsummaryrefslogtreecommitdiff
path: root/target/hexagon/gen_helper_protos.py
diff options
context:
space:
mode:
Diffstat (limited to 'target/hexagon/gen_helper_protos.py')
-rwxr-xr-xtarget/hexagon/gen_helper_protos.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/target/hexagon/gen_helper_protos.py b/target/hexagon/gen_helper_protos.py
index ed4b9cf0d4..674bf370fa 100755
--- a/target/hexagon/gen_helper_protos.py
+++ b/target/hexagon/gen_helper_protos.py
@@ -146,11 +146,24 @@ def main():
hex_common.read_attribs_file(sys.argv[2])
hex_common.read_overrides_file(sys.argv[3])
hex_common.read_overrides_file(sys.argv[4])
+ ## Whether or not idef-parser is enabled is
+ ## determined by the number of arguments to
+ ## this script:
+ ##
+ ## 5 args. -> not enabled,
+ ## 6 args. -> idef-parser enabled.
+ ##
+ ## The 6:th arg. then holds a list of the successfully
+ ## parsed instructions.
+ is_idef_parser_enabled = len(sys.argv) > 6
+ if is_idef_parser_enabled:
+ hex_common.read_idef_parser_enabled_file(sys.argv[5])
hex_common.calculate_attribs()
tagregs = hex_common.get_tagregs()
tagimms = hex_common.get_tagimms()
- with open(sys.argv[5], 'w') as f:
+ output_file = sys.argv[-1]
+ with open(output_file, 'w') as f:
for tag in hex_common.tags:
## Skip the priv instructions
if ( "A_PRIV" in hex_common.attribdict[tag] ) :
@@ -168,6 +181,8 @@ def main():
if ( hex_common.skip_qemu_helper(tag) ):
continue
+ if ( hex_common.is_idef_parser_enabled(tag) ):
+ continue
gen_helper_prototype(f, tag, tagregs, tagimms)