From 219c07593183f2cfee1f8e29ad0e9816ac2d6b53 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 8 Oct 2021 21:06:23 +0800 Subject: [PATCH] added explicit runtime/satman targets for makefile Reviewed-on: https://git.m-labs.hk/M-Labs/artiq-zynq/pulls/144 Co-authored-by: mwojcik Co-committed-by: mwojcik --- README.md | 8 +++++--- default.nix | 2 +- src/Makefile | 12 ++++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 029ff0f..fdae0d7 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Note: if you are using Nix channels the first time, you need to be aware of this Pure build with Nix and execution on a remote JTAG server: ```shell -nix-build -A zc706-nist_clock-jtag # or zc706-nist_qc2-jtag or zc706-nist_clock_satellite-jtag +nix-build -A zc706-nist_clock-jtag # or zc706-nist_qc2-jtag or zc706-nist_clock_satellite-jtag etc. ./remote_run.sh ``` @@ -54,8 +54,8 @@ Impure incremental build and execution on a remote JTAG server: ```shell nix-shell cd src -gateware/zc706.py -g ../build/gateware # build gateware -make # build firmware +gateware/zc706.py -g ../build/gateware -v # build gateware +make GWARGS="-v " # build firmware cd .. ./remote_run.sh -i ``` @@ -64,6 +64,8 @@ Notes: - This is developed with Nixpkgs 21.05, and the ``nixbld.m-labs.hk`` binary substituter can also be used here (see the ARTIQ manual for the public key and instructions). - The impure build process is also compatible with non-Nix systems. +- When calling make, you need to specify both the variant and firmware type. +- Firmware type must be either ``runtime`` for DRTIO-less or DRTIO master variants, or ``satman`` for DRTIO satellite. - If the board is connected to the local machine, use the ``local_run.sh`` script. - To update ``zynq-rs``, update the cargo files as per usual for Rust projects, but also keep ``zynq-rs.nix`` in sync. diff --git a/default.nix b/default.nix index dbac0c1..40ce07d 100644 --- a/default.nix +++ b/default.nix @@ -35,7 +35,7 @@ let export XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library" export CLANG_EXTRA_INCLUDE_DIR="${pkgs.llvmPackages_9.clang-unwrapped.lib}/lib/clang/9.0.1/include" export CARGO_HOME=$(mktemp -d cargo-home.XXX) - make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ../build/${fwtype}.bin + make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${fwtype} ''; installPhase = '' diff --git a/src/Makefile b/src/Makefile index 12f33a7..f12fb29 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,15 +1,19 @@ TARGET := zc706 GWARGS := -V nist_clock -all: ../build/runtime.bin +all: runtime -.PHONY: all +runtime: ../build/runtime.bin + +satman: ../build/satman.bin + +.PHONY: all runtime_target satman_target ../build/pl.rs ../build/rustc-cfg ../build/mem.rs: gateware/* mkdir -p ../build python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs $(GWARGS) -../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -print) +../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -type f -print) cd runtime && \ XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \ cargo xbuild --release \ @@ -19,7 +23,7 @@ all: ../build/runtime.bin ../build/runtime.bin: ../build/firmware/armv7-none-eabihf/release/runtime llvm-objcopy -O binary ../build/firmware/armv7-none-eabihf/release/runtime ../build/runtime.bin -../build/firmware/armv7-none-eabihf/release/satman: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -print) +../build/firmware/armv7-none-eabihf/release/satman: ../build/pl.rs ../build/rustc-cfg ../build/mem.rs $(shell find . -type f -print) cd satman && \ XBUILD_SYSROOT_PATH=`pwd`/../../build/sysroot \ cargo xbuild --release \