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";
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "2020.08.22";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "YosysHQ";
|
|
|
|
repo = "SymbiYosys";
|
2020-09-25 04:45:31 +00:00
|
|
|
rev = "33b0bb7d836fe2a73dc7b10587222f2a718beef4";
|
|
|
|
sha256 = "03rbrbwsji1sqcp2yhgbc0fca04zsryv2g4izjhdzv64nqjzjyhn";
|
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/"'
|
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
|
|
|
};
|
|
|
|
}
|