From 7110f3640e19d6853dc8c619cd429014d88ce9da Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 15 Oct 2014 16:11:47 +0800 Subject: [PATCH] add runelf debug utility --- frontend/runelf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 frontend/runelf diff --git a/frontend/runelf b/frontend/runelf new file mode 100755 index 000000000..94d8ec9ca --- /dev/null +++ b/frontend/runelf @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +import argparse +from artiq.devices import corecom_serial + + +def main(): + parser = argparse.ArgumentParser(description="Core device ELF loading tool") + parser.add_argument("-e", default=False, action="store_true", + help="show environment") + parser.add_argument("-f", default="run", + help="function to run") + parser.add_argument("file", + help="ELF binary to load") + args = parser.parse_args() + + with open(args.file, "rb") as f: + binary = f.read() + with corecom_serial.CoreCom() as com: + runtime_env = com.get_runtime_env() + if args.e: + print(runtime_env) + com.load(binary) + com.run(args.f) + com.serve(dict(), dict()) + +if __name__ == "__main__": + main()