artiq-board: check for constraint errors in vivado.log

Should fix Gitea issue #15
pull/16/head
Astro 2019-05-27 22:08:36 +02:00
parent 5f7def845a
commit 00e518e77d
1 changed files with 12 additions and 1 deletions

View File

@ -47,11 +47,22 @@ let
in pkgs.python3Packages.buildPythonPackage rec {
name = "artiq-board-${target}-${variant}-${version}";
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
phases = [ "buildPhase" "installPhase" ];
phases = [ "buildPhase" "installCheckPhase" "installPhase" ];
buildPhase =
''
${buildenv}/bin/artiq-dev -c "export CARGO_HOME=${cargoVendored}; ${buildCommand}"
'';
preCheck = ''
# Search for PCREs in the Vivado output to check for errors
function check_log() {
grep -Pe "$1" artiq_${target}/${variant}/gateware/vivado.log
if [ $? -ne 1 ]; then
exit 1
fi
}
check_log "\d+ constraint not met\."
check_log "Timing constraints are not met\."
'';
installPhase =
''
TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}