1
0
Fork 0

build Mirny CPLD image

This commit is contained in:
Sebastien Bourdeauducq 2019-12-19 12:51:52 +08:00
parent 1f2eabed65
commit b466d410ec
4 changed files with 32 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
let let
jobs = import ./urukul/default.nix { inherit pkgs; }; jobs = import ./cpld/default.nix { inherit pkgs; };
in in
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs

View File

@ -15,6 +15,19 @@ let
echo file binary-dist $out/urukul.jed >> $out/nix-support/hydra-build-products 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 in
{ {
urukul-cpld-master = buildUrukulCpld { urukul-cpld-master = buildUrukulCpld {
@ -30,4 +43,17 @@ in
sha256 = "1nvarspqbf9f7b27j34jkkh4mj6rwrlmccmfpz5nnzk3h2j6zbqc"; sha256 = "1nvarspqbf9f7b27j34jkkh4mj6rwrlmccmfpz5nnzk3h2j6zbqc";
}; };
}; };
mirny-cpld-master = buildMirnyCpld {
version = "master";
src = <mirnySrc>;
};
mirny-cpld-release = buildMirnyCpld rec {
version = "0.2.4";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "mirny";
rev = "v${version}";
sha256 = "0fyz0g1h1s54zdivkfqhgyhpq7gjkl9kxkcfy3104p2f889l1vgw";
};
};
} }

View File

@ -74,12 +74,12 @@
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false } "artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }
} }
}, },
"urukul": { "cpld": {
"enabled": 1, "enabled": 1,
"hidden": false, "hidden": false,
"description": "Urukul CPLD gateware", "description": "CPLD gateware",
"nixexprinput": "nixScripts", "nixexprinput": "nixScripts",
"nixexprpath": "urukul.nix", "nixexprpath": "cpld.nix",
"checkinterval": 172800, "checkinterval": 172800,
"schedulingshares": 1, "schedulingshares": 1,
"enableemail": false, "enableemail": false,
@ -88,7 +88,8 @@
"inputs": { "inputs": {
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false }, "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 }, "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 }
} }
} }
} }