2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-11-19 00:13:47 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoconf
|
|
|
|
, bison
|
|
|
|
, bzip2
|
|
|
|
, flex
|
|
|
|
, gperf
|
|
|
|
, ncurses
|
2020-10-07 09:15:18 +00:00
|
|
|
, perl
|
2020-11-19 00:13:47 +00:00
|
|
|
, readline
|
|
|
|
, zlib
|
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";
|
2020-11-19 00:13:47 +00:00
|
|
|
rev = "253609b89576355b3bef2f91e90db62223ecf2be";
|
|
|
|
sha256 = "18i7jlr2csp7mplcrwjhllwvb6w3v7x7mnx7vdw48nd3g5scrydx";
|
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";
|
2020-11-19 00:13:47 +00:00
|
|
|
version = "11.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-11-12 23:50:31 +00:00
|
|
|
owner = "steveicarus";
|
|
|
|
repo = pname;
|
2021-01-17 00:15:33 +00:00
|
|
|
rev = "v${lib.replaceStrings ["."] ["_"] version}";
|
2020-11-19 00:13:47 +00:00
|
|
|
sha256 = "0nzcyi6l2zv9wxzsv9i963p3igyjds0n55x0ph561mc3pfbc7aqp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-11-19 00:13:47 +00:00
|
|
|
nativeBuildInputs = [ autoconf bison flex gperf ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-19 00:13:47 +00:00
|
|
|
buildInputs = [ bzip2 ncurses readline zlib ];
|
|
|
|
|
|
|
|
preConfigure = "sh autoconf.sh";
|
2020-11-12 23:50:31 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2020-11-19 00:13:47 +00:00
|
|
|
|
2021-02-13 14:23:35 +00: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 23:50:31 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
installCheckInputs = [ perl ];
|
2020-11-19 00:13:47 +00:00
|
|
|
|
2020-10-07 09:15:18 +00: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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Icarus Verilog compiler";
|
2020-11-19 00:13:47 +00:00
|
|
|
homepage = "http://iverilog.icarus.com/"; # https does not work
|
2020-11-12 23:50:31 +00:00
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
maintainers = with maintainers; [ winden thoughtpolice ];
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|