From a089158a1d87e92202798020a227c28d69d95456 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 23 Aug 2019 17:01:39 +0800 Subject: [PATCH] add migen-axi to the development enviroment Enables Zynq gateware development. --- artiq-fast/default.nix | 4 +- artiq-fast/pkgs/python-deps.nix | 67 +++++++++++++++++++++++++++++++++ artiq-fast/shell-dev.nix | 2 +- 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index d147bf4..7f6192e 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -1,7 +1,7 @@ { pkgs ? import {}}: with pkgs; let - pythonDeps = callPackage ./pkgs/python-deps.nix {}; + pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; }; boards = [ { target = "kasli"; variant = "tester"; } @@ -18,7 +18,7 @@ let "artiq-board-${board.target}-${board.variant}" = boardBinaries; }) {} boards; mainPackages = rec { - inherit (pythonDeps) asyncserial levenshtein pythonparser quamash pyqtgraph-qt5 misoc migen microscope jesd204b lit outputcheck; + inherit (pythonDeps) asyncserial levenshtein pythonparser quamash pyqtgraph-qt5 misoc migen microscope jesd204b migen-axi lit outputcheck; binutils-or1k = callPackage ./pkgs/binutils-or1k.nix {}; llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {}; rustc = callPackage ./pkgs/rust diff --git a/artiq-fast/pkgs/python-deps.nix b/artiq-fast/pkgs/python-deps.nix index 97cbf46..97ae199 100644 --- a/artiq-fast/pkgs/python-deps.nix +++ b/artiq-fast/pkgs/python-deps.nix @@ -161,6 +161,73 @@ rec { }; }; + fastnumbers = python3Packages.buildPythonPackage rec { + pname = "fastnumbers"; + version = "2.2.1"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "0j15i54p7nri6hkzn1wal9pxri4pgql01wgjccig6ar0v5jjbvsy"; + }; + + meta = with stdenv.lib; { + description = "Super-fast and clean conversions to numbers"; + homepage = "https://github.com/SethMMorton/fastnumbers"; + license = licenses.mit; + platforms = platforms.unix; + }; + }; + + ramda = python3Packages.buildPythonPackage { + name = "ramda"; + + src = fetchFromGitHub { + owner = "peteut"; + repo = "ramda.py"; + rev = "bd58f8e69d0e9a713d9c1f286a1ac5e5603956b1"; + sha256 = "0qzd5yp9lbaham8p1wiymdjapzbqsli7lvngv24c3z4ybd9jlq9g"; + }; + + nativeBuildInputs = [ python3Packages.pbr python3Packages.pytest ]; + propagatedBuildInputs = [ fastnumbers ]; + + preBuild = '' + export PBR_VERSION=0.0.1 + ''; + + meta = with stdenv.lib; { + description = "Ramda, ported to Python"; + homepage = "https://github.com/peteut/ramda.py"; + license = licenses.mit; + platforms = platforms.unix; + }; + }; + + migen-axi = python3Packages.buildPythonPackage { + name = "migen-axi"; + + src = fetchFromGitHub { + owner = "peteut"; + repo = "migen-axi"; + rev = "8526eca769c01e18cc0a6024aacc515ceb8b9bd5"; + sha256 = "19gycn7s32j7zzy064qj2yv9g9jk9kn9z3q0fap2dg308g6d1pjs"; + }; + + nativeBuildInputs = [ python3Packages.pbr python3Packages.pytest ]; + propagatedBuildInputs = [ python3Packages.click python3Packages.numpy python3Packages.toolz ramda migen misoc ]; + + preBuild = '' + export PBR_VERSION=0.0.1 + ''; + + meta = with stdenv.lib; { + description = "AXI support for Migen/MiSoC"; + homepage = "https://github.com/peteut/migen-axi"; + license = licenses.mit; + platforms = platforms.unix; + }; + }; + # not using the nixpkgs version because it is Python 2 and an "application" lit = python3Packages.buildPythonPackage rec { pname = "lit"; diff --git a/artiq-fast/shell-dev.nix b/artiq-fast/shell-dev.nix index bf9e9a4..228a14c 100644 --- a/artiq-fast/shell-dev.nix +++ b/artiq-fast/shell-dev.nix @@ -8,7 +8,7 @@ in buildInputs = [ vivado pkgs.gnumake - (pkgs.python3.withPackages(ps: with ps; [ jinja2 numpy paramiko artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ])) + (pkgs.python3.withPackages(ps: (with ps; [ jinja2 numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ]))) pkgs.cargo artiqpkgs.rustc artiqpkgs.binutils-or1k