From eeedcfbdd7dc3946652575fb6bf6477438911754 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 22 Mar 2018 17:11:21 +0800 Subject: [PATCH] artiq_flash: do not suppress useful backtrace information --- artiq/frontend/artiq_flash.py | 75 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 39 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index a03cad20d..27d527579 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -327,46 +327,43 @@ def main(): atexit.register(lambda: os.unlink(bin_filename)) return bin_filename - try: - for action in args.action: - if action == "gateware": - gateware_bin = convert_gateware( - artifact_path(variant, "gateware", "top.bit")) - programmer.write_binary(*config["gateware"], gateware_bin) - if args.target == "sayma": - rtm_gateware_bin = convert_gateware( - artifact_path("rtm_gateware", "rtm.bit"), header=True) - programmer.write_binary(*config["rtm_gateware"], - rtm_gateware_bin) - elif action == "bootloader": - bootloader_bin = artifact_path(variant, "software", "bootloader", "bootloader.bin") - programmer.write_binary(*config["bootloader"], bootloader_bin) - elif action == "storage": - storage_img = args.storage - programmer.write_binary(*config["storage"], storage_img) - elif action == "firmware": - if variant == "satellite": - firmware = "satman" - else: - firmware = "runtime" - - firmware_fbi = artifact_path(variant, "software", firmware, firmware + ".fbi") - programmer.write_binary(*config["firmware"], firmware_fbi) - elif action == "load": - if args.target == "sayma": - rtm_gateware_bit = artifact_path("rtm_gateware", "rtm.bit") - programmer.load(rtm_gateware_bit, 0) - gateware_bit = artifact_path(variant, "gateware", "top.bit") - programmer.load(gateware_bit, 1) - else: - gateware_bit = artifact_path(variant, "gateware", "top.bit") - programmer.load(gateware_bit, 0) - elif action == "start": - programmer.start() + for action in args.action: + if action == "gateware": + gateware_bin = convert_gateware( + artifact_path(variant, "gateware", "top.bit")) + programmer.write_binary(*config["gateware"], gateware_bin) + if args.target == "sayma": + rtm_gateware_bin = convert_gateware( + artifact_path("rtm_gateware", "rtm.bit"), header=True) + programmer.write_binary(*config["rtm_gateware"], + rtm_gateware_bin) + elif action == "bootloader": + bootloader_bin = artifact_path(variant, "software", "bootloader", "bootloader.bin") + programmer.write_binary(*config["bootloader"], bootloader_bin) + elif action == "storage": + storage_img = args.storage + programmer.write_binary(*config["storage"], storage_img) + elif action == "firmware": + if variant == "satellite": + firmware = "satman" else: - raise ValueError("invalid action", action) - except FileNotFoundError as e: - raise SystemExit(e) + firmware = "runtime" + + firmware_fbi = artifact_path(variant, "software", firmware, firmware + ".fbi") + programmer.write_binary(*config["firmware"], firmware_fbi) + elif action == "load": + if args.target == "sayma": + rtm_gateware_bit = artifact_path("rtm_gateware", "rtm.bit") + programmer.load(rtm_gateware_bit, 0) + gateware_bit = artifact_path(variant, "gateware", "top.bit") + programmer.load(gateware_bit, 1) + else: + gateware_bit = artifact_path(variant, "gateware", "top.bit") + programmer.load(gateware_bit, 0) + elif action == "start": + programmer.start() + else: + raise ValueError("invalid action", action) if args.dry_run: print("\n".join(programmer.script()))