From cbd69287a78a0372c2e5996edfec3b84e952e603 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 22 Dec 2017 16:53:58 +0800 Subject: [PATCH] artiq_flash: select Sayma standalone variant by default --- RELEASE_NOTES.rst | 1 + artiq/frontend/artiq_flash.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index ff4698f88..890552f1b 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -11,6 +11,7 @@ Release notes server address argument and the notify port. * The master now has a ``--name`` argument. If given, the dashboard is labelled with this name rather than the server address. +* ``artiq_flash --adapter`` has been changed to ``artiq_flash --variant``. 3.1 diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 5f0218f47..db1a98f31 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -37,8 +37,8 @@ Prerequisites: """) parser.add_argument("-t", "--target", default="kc705", help="target board, default: %(default)s") - parser.add_argument("-m", "--adapter", default=None, - help="target adapter, default: board-dependent") + parser.add_argument("-m", "--variant", default=None, + help="board variant") parser.add_argument("--preinit-command", default=[], action="append", help="add a pre-initialization OpenOCD command. " "Useful for selecting a development board " @@ -192,7 +192,7 @@ def main(): "kc705": { "programmer_factory": partial(ProgrammerJtagSpi7, "kc705"), "proxy_bitfile": "bscan_spi_xc7k325t.bit", - "adapters": ["nist_clock", "nist_qc2"], + "variants": ["nist_clock", "nist_qc2"], "gateware": (0, 0x000000), "bios": (0, 0xaf0000), "runtime": (0, 0xb00000), @@ -201,7 +201,7 @@ def main(): "sayma": { "programmer_factory": ProgrammerSayma, "proxy_bitfile": "bscan_spi_xcku040-sayma.bit", - "adapters": [], + "variants": ["standalone"], "gateware": (0, 0x000000), "bios": (1, 0x000000), "runtime": (1, 0x010000), @@ -209,19 +209,19 @@ def main(): }, }[opts.target] - adapter = opts.adapter - if adapter is not None and adapter not in config["adapters"]: - raise SystemExit("Invalid adapter for this board") - if adapter is None and config["adapters"]: - adapter = config["adapters"][0] + variant = opts.variant + if variant is not None and variant not in config["variants"]: + raise SystemExit("Invalid variant for this board") + if variant is None and config["variants"]: + variant = config["variants"][0] bin_dir = opts.dir if bin_dir is None: - if adapter is None: + if variant is None: bin_dir = os.path.join(artiq_dir, "binaries", "{}".format(opts.target)) else: bin_dir = os.path.join(artiq_dir, "binaries", - "{}-{}".format(opts.target, adapter)) + "{}-{}".format(opts.target, variant)) if opts.srcbuild is None and not os.path.exists(bin_dir) and opts.action != ["start"]: raise SystemExit("Binaries directory '{}' does not exist" .format(bin_dir))