2019-05-12 16:05:37 +00:00
|
|
|
{ stdenv, fetchFromGitHub, yosys, bash, python3 }:
|
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";
|
2019-10-13 16:28:52 +00:00
|
|
|
version = "2019.10.11";
|
2017-10-16 07:44:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-02-04 17:59:35 +00:00
|
|
|
owner = "yosyshq";
|
2017-10-16 07:44:00 +00:00
|
|
|
repo = "symbiyosys";
|
2019-10-13 16:28:52 +00:00
|
|
|
rev = "23f89011b678daa9da406d4f45f790e45f8f68ca";
|
|
|
|
sha256 = "01596yvfj79iywwczjwlb2l9qnh7bsj7jff66jdk1ybjnxf841f0";
|
2017-10-16 07:44:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python3 yosys ];
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|