Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions pkgs/development/compilers/nextpnr-xilinx/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{ stdenv
, cmake
, git
, lib
, fetchFromGitHub
, python310Packages
, python310
, eigen
, llvmPackages
}:
stdenv.mkDerivation rec {
pname = "nextpnr-xilinx";
version = "0.5.0";

src = fetchFromGitHub {
owner = "openXC7";
repo = "nextpnr-xilinx";
rev = version;
hash = "sha256-mDYEmq3MW1kK9HeR4PyGmKQnAzpvlOf+H66o7QTFx3k=";
fetchSubmodules = true;
};

nativeBuildInputs = [ cmake git ];
buildInputs = [ python310Packages.boost python310 eigen ]
++ (lib.optional stdenv.cc.isClang [ llvmPackages.openmp ]);

setupHook = ./nextpnr-setup-hook.sh;

cmakeFlags = [
"-DCURRENT_GIT_VERSION=${lib.substring 0 7 src.rev}"
"-DARCH=xilinx"
"-DBUILD_GUI=OFF"
"-DBUILD_TESTS=OFF"
"-DUSE_OPENMP=ON"
];

installPhase = ''
mkdir -p $out/bin
cp nextpnr-xilinx bba/bbasm $out/bin/
mkdir -p $out/share/nextpnr/external
cp -rv ../xilinx/external/prjxray-db $out/share/nextpnr/external/
cp -rv ../xilinx/external/nextpnr-xilinx-meta $out/share/nextpnr/external/
cp -rv ../xilinx/python/ $out/share/nextpnr/python/
cp ../xilinx/constids.inc $out/share/nextpnr
'';

meta = with lib; {
description = "Place and route tool for FPGAs";
homepage = "https://github.com/openXC7/nextpnr-xilinx";
license = licenses.isc;
platforms = platforms.all;
maintainers = with maintainers; [ jleightcap hansfbaier ];
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
addNextpnrPaths() {
addToSearchPath NEXTPNR_XILINX_DIR "$1/usr/share/nextpnr"
}

addEnvHooks "$targetOffset" addNextpnrPaths
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16826,6 +16826,8 @@ with pkgs;

nextpnr = callPackage ../development/compilers/nextpnr { };

nextpnr-xilinx = callPackage ../development/compilers/nextpnr-xilinx { };
Comment thread
jleightcap marked this conversation as resolved.

nextpnrWithGui = libsForQt5.callPackage ../development/compilers/nextpnr {
enableGui = true;
inherit (darwin.apple_sdk.frameworks) OpenGL;
Expand Down