2020-02-28 03:50:47 +00:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, bash, python3, yosys
|
2020-08-23 14:59:36 +00:00
|
|
|
, yices, boolector, z3, aiger
|
2020-02-28 03:50:47 +00:00
|
|
|
}:
|
2017-10-16 07:44:00 +00:00
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2019-08-13 23:46:49 +00:00
|
|
|
pname = "symbiyosys";
|
2020-08-23 14:59:36 +00:00
|
|
|
version = "2020.08.22";
|
2017-10-16 07:44:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-02-08 15:31:47 +00:00
|
|
|
owner = "YosysHQ";
|
|
|
|
repo = "SymbiYosys";
|
2020-08-23 14:59:36 +00:00
|
|
|
rev = "33b0bb7d836fe2a73dc7b10587222f2a718beef4";
|
|
|
|
sha256 = "03rbrbwsji1sqcp2yhgbc0fca04zsryv2g4izjhdzv64nqjzjyhn";
|
2017-10-16 07:44:00 +00:00
|
|
|
};
|
|
|
|
|
2020-08-23 14:59:36 +00:00
|
|
|
buildInputs = [ ];
|
2020-02-28 03:50:47 +00:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs .
|
2017-10-16 07:44:00 +00:00
|
|
|
|
2020-02-28 03:50:47 +00:00
|
|
|
# Fix up Yosys imports
|
|
|
|
substituteInPlace sbysrc/sby.py \
|
|
|
|
--replace "##yosys-sys-path##" \
|
|
|
|
"sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]"
|
|
|
|
|
|
|
|
# Fix various executable references
|
|
|
|
substituteInPlace sbysrc/sby_core.py \
|
|
|
|
--replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"' \
|
2020-08-23 14:59:36 +00:00
|
|
|
--replace ', "btormc"' ', "${boolector}/bin/btormc"' \
|
|
|
|
--replace ', "aigbmc"' ', "${aiger}/bin/aigbmc"'
|
|
|
|
|
|
|
|
substituteInPlace sbysrc/sby_core.py \
|
|
|
|
--replace '##yosys-program-prefix##' '"${yosys}/bin/"'
|
2020-02-28 03:50:47 +00:00
|
|
|
'';
|
2019-10-19 20:32:00 +00:00
|
|
|
|
2017-10-16 07:44:00 +00:00
|
|
|
buildPhase = "true";
|
2020-08-23 14:59:36 +00:00
|
|
|
|
2017-10-16 07:44:00 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/yosys/python3
|
|
|
|
|
|
|
|
cp sbysrc/sby_*.py $out/share/yosys/python3/
|
|
|
|
cp sbysrc/sby.py $out/bin/sby
|
|
|
|
|
2020-02-28 03:50:47 +00:00
|
|
|
chmod +x $out/bin/sby
|
2017-10-16 07:44:00 +00:00
|
|
|
'';
|
2020-02-28 03:50:47 +00:00
|
|
|
|
2020-08-23 14:59:36 +00:00
|
|
|
doCheck = false; # not all provers are yet packaged...
|
|
|
|
checkInputs = [ python3 yosys boolector yices z3 aiger ];
|
|
|
|
checkPhase = "make test";
|
|
|
|
|
2017-10-16 07:44:00 +00:00
|
|
|
meta = {
|
2018-03-21 21:01:02 +00:00
|
|
|
description = "Tooling for Yosys-based verification flows";
|
2020-02-28 03:50:47 +00:00
|
|
|
homepage = "https://symbiyosys.readthedocs.io/";
|
2019-04-22 17:21:57 +00:00
|
|
|
license = stdenv.lib.licenses.isc;
|
2019-08-20 09:43:59 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice emily ];
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
2017-10-16 07:44:00 +00:00
|
|
|
};
|
|
|
|
}
|