From b466d410eca3953c48e10bcdd87d4f700e438f18 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 19 Dec 2019 12:51:52 +0800 Subject: [PATCH] build Mirny CPLD image --- urukul.nix => cpld.nix | 2 +- {urukul => cpld}/default.nix | 26 ++++++++++++++++++++++++++ {urukul => cpld}/ise.nix | 0 hydra/artiq.nix | 9 +++++---- 4 files changed, 32 insertions(+), 5 deletions(-) rename urukul.nix => cpld.nix (64%) rename {urukul => cpld}/default.nix (54%) rename {urukul => cpld}/ise.nix (100%) diff --git a/urukul.nix b/cpld.nix similarity index 64% rename from urukul.nix rename to cpld.nix index 6e49e5b..b7ecb33 100644 --- a/urukul.nix +++ b/cpld.nix @@ -1,6 +1,6 @@ { pkgs ? import {} }: let - jobs = import ./urukul/default.nix { inherit pkgs; }; + jobs = import ./cpld/default.nix { inherit pkgs; }; in builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs diff --git a/urukul/default.nix b/cpld/default.nix similarity index 54% rename from urukul/default.nix rename to cpld/default.nix index 063b4f1..893e253 100644 --- a/urukul/default.nix +++ b/cpld/default.nix @@ -15,6 +15,19 @@ let echo file binary-dist $out/urukul.jed >> $out/nix-support/hydra-build-products ''; }; + buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation { + name = "mirny-cpld-${version}"; + inherit src; + buildInputs = [(pkgs.python3.withPackages(ps: [migen]))] ++ (builtins.attrValues ise); + phases = ["buildPhase" "installPhase"]; + buildPhase = "python $src/mirny_impl.py"; + installPhase = + '' + mkdir -p $out $out/nix-support + cp build/mirny.jed $out + echo file binary-dist $out/mirny.jed >> $out/nix-support/hydra-build-products + ''; + }; in { urukul-cpld-master = buildUrukulCpld { @@ -30,4 +43,17 @@ in sha256 = "1nvarspqbf9f7b27j34jkkh4mj6rwrlmccmfpz5nnzk3h2j6zbqc"; }; }; + mirny-cpld-master = buildMirnyCpld { + version = "master"; + src = ; + }; + mirny-cpld-release = buildMirnyCpld rec { + version = "0.2.4"; + src = pkgs.fetchFromGitHub { + owner = "quartiq"; + repo = "mirny"; + rev = "v${version}"; + sha256 = "0fyz0g1h1s54zdivkfqhgyhpq7gjkl9kxkcfy3104p2f889l1vgw"; + }; + }; } diff --git a/urukul/ise.nix b/cpld/ise.nix similarity index 100% rename from urukul/ise.nix rename to cpld/ise.nix diff --git a/hydra/artiq.nix b/hydra/artiq.nix index f1d496e..af4a605 100644 --- a/hydra/artiq.nix +++ b/hydra/artiq.nix @@ -74,12 +74,12 @@ "artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false } } }, - "urukul": { + "cpld": { "enabled": 1, "hidden": false, - "description": "Urukul CPLD gateware", + "description": "CPLD gateware", "nixexprinput": "nixScripts", - "nixexprpath": "urukul.nix", + "nixexprpath": "cpld.nix", "checkinterval": 172800, "schedulingshares": 1, "enableemail": false, @@ -88,7 +88,8 @@ "inputs": { "nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, - "urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false } + "urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false }, + "mirnySrc": { "type": "git", "value": "git://github.com/quartiq/mirny", "emailresponsible": false } } } }