From 4172f745e3fca56a607ddb61115b6e4c05085272 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 12 Oct 2020 22:49:47 +0800 Subject: [PATCH] add Phaser gateware --- gluelogic/default.nix | 26 +++++++++++++++++++++++++- hydra/artiq.json | 3 ++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/gluelogic/default.nix b/gluelogic/default.nix index 6ba0c2c..1a7ceea 100644 --- a/gluelogic/default.nix +++ b/gluelogic/default.nix @@ -1,7 +1,8 @@ { pkgs ? import {} }: let - artiqpkgs = import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; misoc-new = false; }; + artiqpkgs = import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; misoc-new = true; }; ise = import ./ise.nix { inherit pkgs; }; + vivado = import ../artiq-fast/vivado.nix { inherit pkgs; }; buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation { name = "urukul-cpld-${version}"; inherit src; @@ -78,4 +79,27 @@ in echo file binary-dist $out/fastino.bin >> $out/nix-support/hydra-build-products ''; }; + phaser-fpga = pkgs.stdenv.mkDerivation { + name = "phaser-fpga"; + src = ; + patchPhase = '' + substituteInPlace phaser.py \ + --replace "Platform(load=True)" \ + "Platform()" + ''; + + buildInputs = [ (pkgs.python3.withPackages(ps: [ artiqpkgs.migen artiqpkgs.misoc ])) ] ++ [ vivado ]; + buildPhase = "python phaser.py"; + installPhase = + '' + mkdir -p $out $out/nix-support + cp build/phaser.bit $out + echo file binary-dist $out/phaser.bit >> $out/nix-support/hydra-build-products + ''; + dontFixup = true; + + doCheck = true; + checkInputs = [ pkgs.python3Packages.pytest ]; + checkPhase = "pytest"; + }; } diff --git a/hydra/artiq.json b/hydra/artiq.json index 6652b70..dfd6e68 100644 --- a/hydra/artiq.json +++ b/hydra/artiq.json @@ -85,7 +85,8 @@ "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 }, "mirnySrc": { "type": "git", "value": "git://github.com/quartiq/mirny", "emailresponsible": false }, - "fastinoSrc": { "type": "git", "value": "git://github.com/quartiq/fastino", "emailresponsible": false } + "fastinoSrc": { "type": "git", "value": "git://github.com/quartiq/fastino", "emailresponsible": false }, + "phaserSrc": { "type": "git", "value": "git://github.com/quartiq/phaser", "emailresponsible": false } } }, "zynq": {