From 885ab40946c96fa95be165e9a2854bcb1fd6b850 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 28 Jan 2018 14:27:08 +0000 Subject: [PATCH] conda: split RTM and AMC packages back. This avoids multiplying the RTM compilation time by the number of AMC packages. --- artiq/frontend/artiq_devtool.py | 4 ++-- artiq/frontend/artiq_flash.py | 2 +- artiq/gateware/targets/sayma_amc.py | 2 +- artiq/gateware/targets/sayma_rtm.py | 2 +- conda/artiq-sayma-standalone/build.sh | 8 ++++---- conda/artiq-sayma-standalone/meta.yaml | 3 ++- conda/artiq-sayma_rtm/build.sh | 8 ++++++++ conda/artiq-sayma_rtm/meta.yaml | 23 +++++++++++++++++++++++ 8 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 conda/artiq-sayma_rtm/build.sh create mode 100644 conda/artiq-sayma_rtm/meta.yaml diff --git a/artiq/frontend/artiq_devtool.py b/artiq/frontend/artiq_devtool.py index 9d76f65a0..ae54960a0 100755 --- a/artiq/frontend/artiq_devtool.py +++ b/artiq/frontend/artiq_devtool.py @@ -151,8 +151,8 @@ def main(): if action == "build": logger.info("Building target") if args.target == "sayma": - build("sayma_rtm", output_dir=build_dir("rtm")) - build("sayma_amc", "--rtm-csr-csv", build_dir("rtm", "rtm_csr.csv")) + build("sayma_rtm", output_dir=build_dir("rtm_gateware")) + build("sayma_amc", "--rtm-csr-csv", build_dir("rtm_gateware", "rtm_csr.csv")) else: build(args.target) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 6f6ebc8ce..12d1855e9 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -329,7 +329,7 @@ def main(): programmer.write_binary(*config["firmware"], firmware_fbi) elif action == "load": if args.target == "sayma": - rtm_gateware_bit = artifact_path("rtm", "rtm.bit") + rtm_gateware_bit = artifact_path("rtm_gateware", "rtm.bit") programmer.load(rtm_gateware_bit, 0) gateware_bit = artifact_path("gateware", "top.bit") programmer.load(gateware_bit, 1) diff --git a/artiq/gateware/targets/sayma_amc.py b/artiq/gateware/targets/sayma_amc.py index 938d054a2..c45f8d37a 100755 --- a/artiq/gateware/targets/sayma_amc.py +++ b/artiq/gateware/targets/sayma_amc.py @@ -445,7 +445,7 @@ def main(): "standalone/master/satellite " "(default: %(default)s)") parser.add_argument("--rtm-csr-csv", - default=os.path.join("artiq_sayma", "rtm", "rtm_csr.csv"), + default=os.path.join("artiq_sayma", "rtm_gateware", "rtm_csr.csv"), help="CSV file listing remote CSRs on RTM (default: %(default)s)") parser.add_argument("--without-sawg", default=False, action="store_true", diff --git a/artiq/gateware/targets/sayma_rtm.py b/artiq/gateware/targets/sayma_rtm.py index cf4ad3fdf..718a9d4ed 100755 --- a/artiq/gateware/targets/sayma_rtm.py +++ b/artiq/gateware/targets/sayma_rtm.py @@ -190,7 +190,7 @@ class SaymaRTM(Module): def main(): parser = argparse.ArgumentParser( description="ARTIQ device binary builder for Kasli systems") - parser.add_argument("--output-dir", default="artiq_sayma/rtm", + parser.add_argument("--output-dir", default="artiq_sayma/rtm_gateware", help="output directory for generated " "source files and binaries") parser.add_argument("--no-compile-gateware", action="store_true", diff --git a/conda/artiq-sayma-standalone/build.sh b/conda/artiq-sayma-standalone/build.sh index a333452d1..824329f3e 100644 --- a/conda/artiq-sayma-standalone/build.sh +++ b/conda/artiq-sayma-standalone/build.sh @@ -1,13 +1,13 @@ #!/bin/bash +RTM_PREFIX=$SP_DIR/artiq/binaries/sayma_rtm + SOC_PREFIX=$PREFIX/lib/python3.5/site-packages/artiq/binaries/sayma-standalone mkdir -p $SOC_PREFIX -$PYTHON -m artiq.gateware.targets.sayma_rtm -cp artiq_sayma/rtm_gateware/rtm.bit $SOC_PREFIX - $PYTHON -m artiq.gateware.targets.sayma_amc -V standalone \ - --rtm-csr-csv artiq_sayma/rtm/sayma_rtm_csr.csv + --rtm-csr-csv $RTM_PREFIX/rtm_csr.csv cp artiq_sayma/gateware/top.bit $SOC_PREFIX cp artiq_sayma/software/bootloader/bootloader.bin $SOC_PREFIX cp artiq_sayma/software/runtime/runtime.{elf,fbi} $SOC_PREFIX +cp $RTM_PREFIX/rtm.bit $SOC_PREFIX diff --git a/conda/artiq-sayma-standalone/meta.yaml b/conda/artiq-sayma-standalone/meta.yaml index cb717d376..8450d3319 100644 --- a/conda/artiq-sayma-standalone/meta.yaml +++ b/conda/artiq-sayma-standalone/meta.yaml @@ -14,10 +14,11 @@ build: requirements: build: - artiq-dev {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_FULL_HASH", "")[:8]) if "GIT_DESCRIBE_TAG" in environ else "" }} + - artiq-sayma_rtm {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_FULL_HASH", "")[:8]) if "GIT_DESCRIBE_TAG" in environ else "" }} run: - artiq {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_FULL_HASH", "")[:8]) if "GIT_DESCRIBE_TAG" in environ else "" }} about: home: https://m-labs.hk/artiq license: LGPL - summary: 'AMC and RTM bitstream, BIOS and runtime for stand-alone Sayma AMC' + summary: 'Bitstream, BIOS and runtime for stand-alone Sayma AMC' diff --git a/conda/artiq-sayma_rtm/build.sh b/conda/artiq-sayma_rtm/build.sh new file mode 100644 index 000000000..282ad44d2 --- /dev/null +++ b/conda/artiq-sayma_rtm/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +SOC_PREFIX=$PREFIX/lib/python3.5/site-packages/artiq/binaries/sayma_rtm +mkdir -p $SOC_PREFIX + +$PYTHON -m artiq.gateware.targets.sayma_rtm +cp artiq_sayma/rtm/rtm.bit $SOC_PREFIX +cp artiq_sayma/rtm/rtm_csr.csv $SOC_PREFIX diff --git a/conda/artiq-sayma_rtm/meta.yaml b/conda/artiq-sayma_rtm/meta.yaml new file mode 100644 index 000000000..0aed97148 --- /dev/null +++ b/conda/artiq-sayma_rtm/meta.yaml @@ -0,0 +1,23 @@ +package: + name: artiq-sayma_rtm + version: {{ environ.get("GIT_DESCRIBE_TAG", "") }} + +source: + git_url: ../.. + +build: + noarch: python + ignore_prefix_files: True + number: {{ environ.get("GIT_DESCRIBE_NUMBER", 0) }} + string: py_{{ environ.get("GIT_DESCRIBE_NUMBER", 0) }}+git{{ environ.get("GIT_FULL_HASH", "")[:8] }} + +requirements: + build: + - artiq-dev {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_FULL_HASH", "")[:8]) if "GIT_DESCRIBE_TAG" in environ else "" }} + run: + - artiq {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_FULL_HASH", "")[:8]) if "GIT_DESCRIBE_TAG" in environ else "" }} + +about: + home: https://m-labs.hk/artiq + license: LGPL + summary: 'Bitstream and CSR map for Sayma RTM'