2019-05-12 18:05:37 +02:00
|
|
|
{ stdenv, fetchFromGitHub, yosys, bash, python3 }:
|
2017-10-16 09:44:00 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "symbiyosys-${version}";
|
2019-04-22 19:21:57 +02:00
|
|
|
version = "2019.04.18";
|
2017-10-16 09:44:00 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-02-04 18:59:35 +01:00
|
|
|
owner = "yosyshq";
|
2017-10-16 09:44:00 +02:00
|
|
|
repo = "symbiyosys";
|
2019-04-22 19:21:57 +02:00
|
|
|
rev = "b1de59032ef3de35e56fa420a914c2f14d2495e4";
|
|
|
|
sha256 = "0zci1n062csswl5xxjh9fwq09p9clv95ckag3yywxq06hnqzx0r7";
|
2017-10-16 09:44:00 +02: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-05-12 18:05:37 +02:00
|
|
|
substituteInPlace $out/share/yosys/python3/sby_core.py \
|
|
|
|
--replace "/bin/bash" \
|
|
|
|
"${bash}/bin/bash"
|
2017-10-16 09:44:00 +02:00
|
|
|
'';
|
|
|
|
meta = {
|
2018-03-21 22:01:02 +01:00
|
|
|
description = "Tooling for Yosys-based verification flows";
|
2017-10-16 09:44:00 +02:00
|
|
|
homepage = https://symbiyosys.readthedocs.io/;
|
2019-04-22 19:21:57 +02:00
|
|
|
license = stdenv.lib.licenses.isc;
|
2017-10-16 09:44:00 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
|
2018-04-16 13:44:53 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2017-10-16 09:44:00 +02:00
|
|
|
};
|
|
|
|
}
|