2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, autoconf, gperf, flex, bison, readline, ncurses
|
|
|
|
, bzip2, zlib
|
2020-10-07 09:15:18 +00:00
|
|
|
# Test inputs
|
|
|
|
, perl
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
let
|
|
|
|
iverilog-test = fetchFromGitHub {
|
2020-11-12 23:50:31 +00:00
|
|
|
owner = "steveicarus";
|
|
|
|
repo = "ivtest";
|
|
|
|
rev = "d4c80beb845cad92136c05074b3910b822a9315f";
|
|
|
|
sha256 = "13cpnkki3xmhsh2v4bp2s35mhwknapcikdh85g4q6925ka940r45";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-11-12 23:50:31 +00:00
|
|
|
pname = "iverilog";
|
|
|
|
version = "unstable-2020-10-24";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-11-12 23:50:31 +00:00
|
|
|
owner = "steveicarus";
|
|
|
|
repo = pname;
|
|
|
|
rev = "d6e01d0c557253414109a4dde46b2966a5a3fb08";
|
|
|
|
sha256 = "1bl75mbycj9zpjbpay8z12384yk9ih5q9agsrjh9pva0vv3h4y4y";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf gperf flex bison ];
|
|
|
|
buildInputs = [ readline ncurses bzip2 zlib ];
|
|
|
|
|
2020-11-12 23:50:31 +00:00
|
|
|
preConfigure = "bash $PWD/autoconf.sh";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
# most tests pass, but some that rely on exact text of floating-point numbers
|
|
|
|
# fail on aarch64.
|
2020-10-07 09:15:18 +00:00
|
|
|
doInstallCheck = !stdenv.isAarch64;
|
|
|
|
installCheckInputs = [ perl ];
|
|
|
|
installCheckPhase = ''
|
|
|
|
# copy tests to allow writing results
|
|
|
|
export TESTDIR=$(mktemp -d)
|
|
|
|
cp -r ${iverilog-test}/* $TESTDIR
|
|
|
|
|
|
|
|
pushd $TESTDIR
|
|
|
|
|
|
|
|
# Run & check tests
|
|
|
|
PATH=$out/bin:$PATH perl vvp_reg.pl
|
|
|
|
# Check the tests, will error if unexpected tests fail. Some failures MIGHT be normal.
|
|
|
|
diff regression_report-devel.txt regression_report.txt
|
|
|
|
PATH=$out/bin:$PATH perl vpi_reg.pl
|
|
|
|
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Icarus Verilog compiler";
|
2020-11-12 23:50:31 +00:00
|
|
|
homepage = "http://iverilog.icarus.com/";
|
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
maintainers = with maintainers; [ winden thoughtpolice ];
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|