add vivado buildBitstream derivation
This commit is contained in:
parent
55e12d3185
commit
6082e5a1de
|
@ -0,0 +1,37 @@
|
|||
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
|
||||
# nix.sandboxPaths = ["/opt"];
|
||||
|
||||
{ pkgs ? import <nixpkgs> {}}:
|
||||
let
|
||||
vivadoEnv = pkgs.buildFHSUserEnv {
|
||||
name = "vivado-env";
|
||||
targetPkgs = pkgs: (
|
||||
with pkgs; [
|
||||
ncurses5
|
||||
zlib
|
||||
libuuid
|
||||
xorg.libSM
|
||||
xorg.libICE
|
||||
xorg.libXrender
|
||||
xorg.libX11
|
||||
xorg.libXext
|
||||
xorg.libXtst
|
||||
xorg.libXi
|
||||
]
|
||||
);
|
||||
};
|
||||
in
|
||||
{
|
||||
buildBitstream = { name, src, vivadoPath ? "/opt/Xilinx/Vivado/2018.3" }:
|
||||
pkgs.stdenv.mkDerivation {
|
||||
inherit name src;
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase =
|
||||
''
|
||||
cp --no-preserve=mode,ownership -R $src/* .
|
||||
${vivadoEnv}/bin/vivado-env -c "source ${vivadoPath}/settings64.sh && vivado -mode batch -source top.tcl"
|
||||
mkdir $out
|
||||
cp *.dcp *.rpt *.bit $out
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue