diff options
| author | Anton Johansson <anjo@rev.ng> | 2024-12-06 17:01:02 +0100 |
|---|---|---|
| committer | Brian Cain <brian.cain@oss.qualcomm.com> | 2024-12-12 21:43:52 -0600 |
| commit | e295796726131ff9c07a53afe2642c53229e6ca3 (patch) | |
| tree | 682d88709c99c0e14349abaa1d013e8da8819cba /target/hexagon/gen_helper_protos.py | |
| parent | f0db9f5759372d56d65cfb2d05b03285789468bf (diff) | |
| download | focaccia-qemu-e295796726131ff9c07a53afe2642c53229e6ca3.tar.gz focaccia-qemu-e295796726131ff9c07a53afe2642c53229e6ca3.zip | |
target/hexagon: Use argparse in all python scripts
QOL commit, all the various gen_* python scripts take a large set arguments where order is implicit. Using argparse we also get decent error messages if a field is missing or too many are added. Signed-off-by: Anton Johansson <anjo@rev.ng> Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Diffstat (limited to 'target/hexagon/gen_helper_protos.py')
| -rwxr-xr-x | target/hexagon/gen_helper_protos.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/target/hexagon/gen_helper_protos.py b/target/hexagon/gen_helper_protos.py index fd2bfd0f36..77f8e0a6a3 100755 --- a/target/hexagon/gen_helper_protos.py +++ b/target/hexagon/gen_helper_protos.py @@ -52,12 +52,13 @@ def gen_helper_prototype(f, tag, tagregs, tagimms): def main(): - hex_common.read_common_files() + args = hex_common.parse_common_args( + "Emit helper function prototypes for each instruction" + ) tagregs = hex_common.get_tagregs() tagimms = hex_common.get_tagimms() - output_file = sys.argv[-1] - with open(output_file, "w") as f: + with open(args.out, "w") as f: for tag in hex_common.tags: ## Skip the priv instructions if "A_PRIV" in hex_common.attribdict[tag]: |