2019-10-19 20:32:00 +00:00
|
|
|
{ stdenv, fetchFromGitHub, yosys, bash, python3, yices }:
|
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-02-08 15:31:47 +00:00
|
|
|
version = "2020.02.08";
|
2017-10-16 07:44:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-02-08 15:31:47 +00:00
|
|
|
owner = "YosysHQ";
|
|
|
|
repo = "SymbiYosys";
|
|
|
|
rev = "500b526131f434b9679732fc89515dbed67c8d7d";
|
|
|
|
sha256 = "1pwbirszc80r288x81nx032snniqgmc80i09bbha2i3zd0c3pj5h";
|
2017-10-16 07:44:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python3 yosys ];
|
|
|
|
|
2019-10-19 20:32:00 +00:00
|
|
|
propagatedBuildInputs = [ yices ];
|
|
|
|
|
2017-10-16 07:44:00 +00:00
|
|
|
buildPhase = "true";
|
|
|
|
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
|
|
|
|
|
|
|
|
# Fix up shebang and Yosys imports
|
|
|
|
patchShebangs $out/bin/sby
|
|
|
|
substituteInPlace $out/bin/sby \
|
|
|
|
--replace "##yosys-sys-path##" \
|
|
|
|
"sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]"
|
2019-08-30 20:02:40 +00:00
|
|
|
substituteInPlace $out/share/yosys/python3/sby_core.py \
|
|
|
|
--replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"'
|
2017-10-16 07:44:00 +00:00
|
|
|
'';
|
|
|
|
meta = {
|
2018-03-21 21:01:02 +00:00
|
|
|
description = "Tooling for Yosys-based verification flows";
|
2017-10-16 07:44:00 +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
|
|
|
};
|
|
|
|
}
|