From faf9714e10cf39e9ec0e652ead20052488294873 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 15 Feb 2021 19:52:13 +0800 Subject: [PATCH] add demo build for Kasli-SoC --- default.nix | 11 ++++++----- src/Makefile | 4 ++-- src/gateware/{kasli_soc_generic.py => kasli_soc.py} | 0 3 files changed, 8 insertions(+), 7 deletions(-) rename src/gateware/{kasli_soc_generic.py => kasli_soc.py} (100%) diff --git a/default.nix b/default.nix index f1f14ed1..1969f834 100644 --- a/default.nix +++ b/default.nix @@ -8,7 +8,7 @@ let vivado = import { inherit pkgs; }; # FSBL configuration supplied by Vivado 2020.1 for these boards: fsblTargets = ["zc702" "zc706" "zed"]; - build = { target, variant }: let + build = { target, variant, json ? null }: let szl = (import zynq-rs)."${target}-szl"; fsbl = import "${zynq-rs}/nix/fsbl.nix" { inherit pkgs; @@ -24,7 +24,7 @@ let nativeBuildInputs = [ pkgs.gnumake - (pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc artiq ]))) + (pkgs.python3.withPackages(ps: (with artiqpkgs; [ ps.jsonschema migen migen-axi misoc artiq ]))) cargo-xbuild pkgs.llvmPackages_9.llvm pkgs.llvmPackages_9.clang-unwrapped @@ -32,7 +32,7 @@ let buildPhase = '' export XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library" export CARGO_HOME=$(mktemp -d cargo-home.XXX) - make TARGET=${target} VARIANT=${variant} + make TARGET=${target} GWARGS="${if json == null then "-V ${variant}" else json}" ''; installPhase = '' @@ -49,12 +49,12 @@ let gateware = pkgs.runCommand "${target}-${variant}-gateware" { nativeBuildInputs = [ - (pkgs.python3.withPackages(ps: (with artiqpkgs; [ migen migen-axi misoc artiq ]))) + (pkgs.python3.withPackages(ps: (with artiqpkgs; [ ps.jsonschema migen migen-axi misoc artiq ]))) vivado ]; } '' - python ${./src/gateware}/${target}.py -g build -V ${variant} + python ${./src/gateware}/${target}.py -g build ${if json == null then "-V ${variant}" else json} mkdir -p $out $out/nix-support cp build/top.bit $out echo file binary-dist $out/top.bit >> $out/nix-support/hydra-build-products @@ -136,5 +136,6 @@ in (build { target = "zc706"; variant = "acpki_simple"; }) // (build { target = "zc706"; variant = "acpki_nist_clock"; }) // (build { target = "zc706"; variant = "acpki_nist_qc2"; }) // + (build { target = "kasli_soc"; variant = "demo"; json = ./demo.json; }) // { inherit zynq-rs; } ) diff --git a/src/Makefile b/src/Makefile index da0d6563..e2dc0943 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ TARGET := zc706 -VARIANT := simple +GWARGS := -V simple all: ../build/firmware/armv7-none-eabihf/release/runtime ../build/runtime.bin @@ -8,7 +8,7 @@ all: ../build/firmware/armv7-none-eabihf/release/runtime ../build/runtime.bin ../build/pl.rs ../build/rustc-cfg: gateware/* mkdir -p ../build - python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg -V $(VARIANT) + python gateware/$(TARGET).py -r ../build/pl.rs -c ../build/rustc-cfg $(GWARGS) ../build/firmware/armv7-none-eabihf/release/runtime: ../build/pl.rs ../build/rustc-cfg $(shell find . -print) cd runtime && \ diff --git a/src/gateware/kasli_soc_generic.py b/src/gateware/kasli_soc.py similarity index 100% rename from src/gateware/kasli_soc_generic.py rename to src/gateware/kasli_soc.py