2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, bash, python3, yosys
|
2020-09-25 04:45:31 +00:00
|
|
|
, yices, boolector, z3, aiger
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "symbiyosys";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "2021.11.30";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-06 16:07:01 +00:00
|
|
|
owner = "YosysHQ";
|
|
|
|
repo = "SymbiYosys";
|
|
|
|
rev = "b409b1179e36d2a3fff66c85b7d4e271769a2d9e";
|
|
|
|
hash = "sha256-S7of2upntiMkSdh4kf1RsrjriS31Eh8iEcVvG36isQg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildInputs = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
# 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-09-25 04:45:31 +00:00
|
|
|
--replace ', "btormc"' ', "${boolector}/bin/btormc"' \
|
|
|
|
--replace ', "aigbmc"' ', "${aiger}/bin/aigbmc"'
|
|
|
|
|
|
|
|
substituteInPlace sbysrc/sby_core.py \
|
|
|
|
--replace '##yosys-program-prefix##' '"${yosys}/bin/"'
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
substituteInPlace sbysrc/sby.py \
|
|
|
|
--replace '/usr/bin/env python3' '${python3}/bin/python'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = "true";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +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
|
|
|
|
|
|
|
|
chmod +x $out/bin/sby
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
doCheck = false; # not all provers are yet packaged...
|
|
|
|
checkInputs = [ python3 yosys boolector yices z3 aiger ];
|
|
|
|
checkPhase = "make test";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Tooling for Yosys-based verification flows";
|
|
|
|
homepage = "https://symbiyosys.readthedocs.io/";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice emily ];
|
|
|
|
platforms = lib.platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|