From b0259bcc3966b2a61fc38ffa8bd5f34dc4484102 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 8 Oct 2021 10:33:14 +0200 Subject: [PATCH 1/3] added explicit runtime/satman targets for makefile --- default.nix | 2 +- src/Makefile | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 2826ce1..b2b39b2 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}_target ''; installPhase = '' diff --git a/src/Makefile b/src/Makefile index a6a15e0..f9dbc2e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,9 +1,13 @@ TARGET := zc706 GWARGS := -V simple -all: ../build/runtime.bin +all: runtime_target -.PHONY: all +runtime_target: ../build/runtime.bin + +satman_target: ../build/satman.bin + +.PHONY: all runtime_target satman_target ../build/pl.rs ../build/rustc-cfg ../build/mem.rs: gateware/* mkdir -p ../build -- 2.44.1 From f24b76502a36b3763f2c4b5ae878698c39ec71dd Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 8 Oct 2021 14:37:11 +0200 Subject: [PATCH 2/3] find to print only files no dirs, removed suffix --- default.nix | 2 +- src/Makefile | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/default.nix b/default.nix index b2b39b2..e32d39b 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}" ${fwtype}_target + make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ${fwtype} ''; installPhase = '' diff --git a/src/Makefile b/src/Makefile index f9dbc2e..9b6c742 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,11 +1,11 @@ TARGET := zc706 GWARGS := -V simple -all: runtime_target +all: runtime -runtime_target: ../build/runtime.bin +runtime: ../build/runtime.bin -satman_target: ../build/satman.bin +satman: ../build/satman.bin .PHONY: all runtime_target satman_target @@ -13,7 +13,7 @@ satman_target: ../build/satman.bin 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 \ @@ -23,7 +23,7 @@ satman_target: ../build/satman.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 \ -- 2.44.1 From 469f168e79ea8e0d9bbd0ac12fa212cfafcb5df8 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 8 Oct 2021 14:45:50 +0200 Subject: [PATCH 3/3] Updated README to include satman information --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 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. -- 2.44.1