2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-02-28 03:51:35 +00:00
|
|
|
, yosys, symbiyosys, python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
python = python3.withPackages (p: with p; [ flask ]);
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "mcy";
|
2020-08-23 16:21:18 +01:00
|
|
|
version = "2020.08.03";
|
2020-02-28 03:51:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "YosysHQ";
|
|
|
|
repo = "mcy";
|
2020-08-23 16:21:18 +01:00
|
|
|
rev = "62048e69df13f8e03670424626755ae8ef4c36ff";
|
|
|
|
sha256 = "15xxgzx1zxzx5kshqyrxnfx33cz6cjzxcdcn6z98jhs9bwyvf96f";
|
2020-02-28 03:51:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python ];
|
|
|
|
patchPhase = ''
|
2020-07-09 16:33:09 +01:00
|
|
|
chmod +x scripts/create_mutated.sh
|
|
|
|
patchShebangs .
|
|
|
|
|
2020-02-28 03:51:35 +00:00
|
|
|
substituteInPlace mcy.py \
|
|
|
|
--replace yosys '${yosys}/bin/yosys' \
|
2020-03-17 11:06:49 +00:00
|
|
|
--replace 'os.execvp("mcy-dash"' "os.execvp(\"$out/bin/mcy-dash\""
|
|
|
|
substituteInPlace mcy-dash.py \
|
2020-07-09 16:33:09 +01:00
|
|
|
--replace 'app.run(debug=True)' 'app.run(host="0.0.0.0",debug=True)' \
|
|
|
|
--replace 'subprocess.Popen(["mcy"' "subprocess.Popen([\"$out/bin/mcy\""
|
|
|
|
substituteInPlace scripts/create_mutated.sh \
|
|
|
|
--replace yosys '${yosys}/bin/yosys'
|
2020-02-28 03:51:35 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# the build needs a bit of work...
|
|
|
|
buildPhase = "true";
|
|
|
|
installPhase = ''
|
2020-07-09 16:33:09 +01:00
|
|
|
mkdir -p $out/bin $out/share/mcy/{dash,scripts}
|
2020-03-17 11:06:49 +00:00
|
|
|
install mcy.py $out/bin/mcy && chmod +x $out/bin/mcy
|
|
|
|
install mcy-dash.py $out/bin/mcy-dash && chmod +x $out/bin/mcy-dash
|
2020-07-09 16:33:09 +01:00
|
|
|
cp -r dash/. $out/share/mcy/dash/.
|
|
|
|
cp -r scripts/. $out/share/mcy/scripts/.
|
2020-02-28 03:51:35 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Mutation-based coverage testing for hardware designs, with Yosys";
|
|
|
|
homepage = "https://github.com/YosysHQ/mcy";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice ];
|
|
|
|
platforms = lib.platforms.all;
|
2020-02-28 03:51:35 +00:00
|
|
|
};
|
|
|
|
}
|