2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2020-11-05 17:27:58 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoconf
|
|
|
|
, bison
|
|
|
|
, bzip2
|
|
|
|
, flex
|
|
|
|
, gperf
|
|
|
|
, ncurses
|
2020-09-10 15:10:01 +02:00
|
|
|
, perl
|
2020-11-05 17:27:58 +01:00
|
|
|
, readline
|
|
|
|
, zlib
|
2019-08-02 10:34:39 +02:00
|
|
|
}:
|
2010-11-25 23:01:14 +01:00
|
|
|
|
2020-09-10 15:10:01 +02:00
|
|
|
let
|
|
|
|
iverilog-test = fetchFromGitHub {
|
2020-11-12 21:14:08 +01:00
|
|
|
owner = "steveicarus";
|
|
|
|
repo = "ivtest";
|
2020-11-05 17:27:58 +01:00
|
|
|
rev = "253609b89576355b3bef2f91e90db62223ecf2be";
|
|
|
|
sha256 = "18i7jlr2csp7mplcrwjhllwvb6w3v7x7mnx7vdw48nd3g5scrydx";
|
2020-09-10 15:10:01 +02:00
|
|
|
};
|
|
|
|
in
|
2010-11-25 23:01:14 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2020-11-12 21:14:08 +01:00
|
|
|
pname = "iverilog";
|
2020-11-05 17:27:58 +01:00
|
|
|
version = "11.0";
|
2010-11-25 23:01:14 +01:00
|
|
|
|
2016-05-21 22:16:10 +02:00
|
|
|
src = fetchFromGitHub {
|
2020-11-12 21:14:08 +01:00
|
|
|
owner = "steveicarus";
|
|
|
|
repo = pname;
|
2021-01-15 14:21:58 +01:00
|
|
|
rev = "v${lib.replaceStrings ["."] ["_"] version}";
|
2020-11-05 17:27:58 +01:00
|
|
|
sha256 = "0nzcyi6l2zv9wxzsv9i963p3igyjds0n55x0ph561mc3pfbc7aqp";
|
2010-11-25 23:01:14 +01:00
|
|
|
};
|
|
|
|
|
2020-11-05 17:27:58 +01:00
|
|
|
nativeBuildInputs = [ autoconf bison flex gperf ];
|
2010-11-25 23:01:14 +01:00
|
|
|
|
2020-11-05 17:27:58 +01:00
|
|
|
buildInputs = [ bzip2 ncurses readline zlib ];
|
|
|
|
|
|
|
|
preConfigure = "sh autoconf.sh";
|
2020-11-12 21:14:08 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2020-11-05 17:27:58 +01:00
|
|
|
|
2021-02-12 21:33:52 +01:00
|
|
|
# tests try to access /proc/ which does not exist on darwin
|
|
|
|
# Cannot locate IVL modules : couldn't get command path from OS.
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2020-11-12 21:14:08 +01:00
|
|
|
|
2020-09-10 15:10:01 +02:00
|
|
|
installCheckInputs = [ perl ];
|
2020-11-05 17:27:58 +01:00
|
|
|
|
2020-09-10 15:10:01 +02:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2010-11-25 23:01:14 +01:00
|
|
|
description = "Icarus Verilog compiler";
|
2020-11-05 17:27:58 +01:00
|
|
|
homepage = "http://iverilog.icarus.com/"; # https does not work
|
2020-11-12 21:14:08 +01:00
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
maintainers = with maintainers; [ winden thoughtpolice ];
|
|
|
|
platforms = platforms.all;
|
2010-11-25 23:01:14 +01:00
|
|
|
};
|
|
|
|
}
|