From 2de5b0cf2510ec97b76cce4e33a5ca4c5ac877b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 13 Jun 2018 00:47:15 +0800 Subject: [PATCH] artiq_flash/sayma: check for DONE after load --- artiq/frontend/artiq_flash.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 813cd78463..d9589066d9 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -114,6 +114,8 @@ def __init__(self, client, preinit_script): self._loaded = defaultdict(lambda: None) self._script = ["init"] + add_commands(self._script, "source xilinx-stat.cfg") + def _transfer_script(self, script): if isinstance(self._client, LocalClient): return "[find {}]".format(script) @@ -144,6 +146,13 @@ def load(self, bitfile, pld): "pld load {pld} {{{filename}}}", pld=pld, filename=bitfile) + def check_done(self, tap): + add_commands(self._script, + "set stat [xilinx_get_stat {tap}]", + "echo [format {{{tap} stat: 0b%032b}} $stat]", + "if ![expr $stat & 0x1000] {{echo \"not DONE\"; exit 1;}}", + tap=tap) + def load_proxy(self): raise NotImplementedError @@ -355,8 +364,10 @@ def convert_gateware(bit_filename, header=False): if args.target == "sayma": rtm_gateware_bit = artifact_path("rtm_gateware", "rtm.bit") programmer.load(rtm_gateware_bit, 0) + programmer.check_done("xc7.tap") gateware_bit = artifact_path(variant, "gateware", "top.bit") programmer.load(gateware_bit, 1) + programmer.check_done("xcu.tap") else: gateware_bit = artifact_path(variant, "gateware", "top.bit") programmer.load(gateware_bit, 0)