coriolis/nix/libresoc.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

2021-09-05 11:06:44 -05:00
{ alliance-check-toolkit, soclayout, pinmux, ... }:
2021-09-05 09:49:09 -05:00
2021-09-05 11:06:44 -05:00
{ stdenv, coriolis-combined, coriolis-unicorn, coriolis-cumulus
, python2Packages, alliance, yosys, writeShellScriptBin }:
let
fakegit = writeShellScriptBin "git" "exit 0";
in stdenv.mkDerivation rec {
2021-09-05 09:49:09 -05:00
name = "libresoc-check";
2021-09-05 12:47:17 -05:00
2021-09-05 09:49:09 -05:00
src = soclayout;
2021-09-05 11:06:44 -05:00
YOSYS_TOP = "${yosys}";
ALLIANCE_TOP = "${alliance}";
CORIOLIS_TOP = "${coriolis-combined}";
# The user configuration for verhaegs is empty,
# which is why we use it.
USER = "verhaegs";
nativeBuildInputs = [ fakegit alliance coriolis-unicorn coriolis-cumulus yosys ];
2021-09-05 09:49:09 -05:00
prePatch = ''
2021-09-05 11:06:44 -05:00
rmdir pinmux
2021-09-05 12:47:17 -05:00
cp -r ${pinmux} -T pinmux
cp -r ${alliance-check-toolkit} -T alliance-check-toolkit
chmod a+w -R alliance-check-toolkit pinmux
export ALLIANCE_TOOLKIT="$PWD/alliance-check-toolkit"
export CHECK_TOOLKIT="$ALLIANCE_TOOLKIT"
2021-09-05 09:49:09 -05:00
'';
2021-09-05 11:06:44 -05:00
postPatch = "patchShebangs .";
buildPhase = ''
runHook preBuild
cd experiments9
./mksym.sh
ln -s ${alliance-check-toolkit}/etc/mk/users.d/user-${USER}.mk mk/users.d/user-${USER}.mk
./build_full_4ksram.sh
runHook postBuild
'';
installPhase = ''
runHook preInstall
mv -T "$PWD" "$out"
runHook postInstall
'';
2021-09-05 09:49:09 -05:00
2021-09-05 11:06:44 -05:00
fixupPhase = "true";
2021-09-05 09:49:09 -05:00
}