coriolis/nix/libresoc.nix

86 lines
2.3 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-06 15:57:27 -05:00
{ stdenv, coriolis-combined, coriolis-unicorn, coriolis-cumulus, fetchurl
2021-10-26 16:10:09 -05:00
, python3Packages, alliance, yosys, writeShellScriptBin, fetchFromGitHub }:
2021-09-05 11:06:44 -05:00
let
2021-09-06 15:57:27 -05:00
C4MLogo = fetchurl {
url = "https://ftp.libre-soc.org/C4MLogo.gds";
sha256 = "0s1a2l4rh6vc1xg94jq87lsdkiqv68b0zi2rnv6wwcl9i2smacbf";
};
lip6 = fetchurl {
url = "https://ftp.libre-soc.org/lip6.gds";
sha256 = "0jj4z2d0is1vr3fziaqva39s7d85j0xqmmib0mdqnf2bg9iv91s4";
};
sorbonne_logo = fetchurl {
url = "https://ftp.libre-soc.org/sorbonne_logo.gds";
sha256 = "1p3plmb90kqljwsba2fahqzsy18iapmw2zvgkjh745c87lynn3dq";
};
libresoc_logo = fetchurl {
url = "https://ftp.libre-soc.org/libresoc_logo.gds";
sha256 = "1wbc5qrjlyrykaixdgp5d7brv5imlx71909y49xss907mil76bwh";
};
2021-09-05 11:06:44 -05:00
fakegit = writeShellScriptBin "git" "exit 0";
2021-09-06 15:57:27 -05:00
fakewget = writeShellScriptBin "wget" "exit 0";
yosys' = yosys.overrideAttrs (_: {
version = "0.9+4008";
src = fetchFromGitHub {
owner = "YosysHQ";
repo = "yosys";
rev = "049e3abf9baf795e69b9ecb9c4f19de6131f8418";
sha256 = "0h3w91jr5yws4wxk3n45h1pdq65jhj957d5pzy2799gzwkba5adh";
};
});
in
let yosys = yosys'; 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";
2021-09-06 15:57:27 -05:00
nativeBuildInputs = [ fakewget fakegit alliance coriolis-unicorn coriolis-cumulus yosys ];
2021-09-05 11:06:44 -05:00
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
2021-09-06 15:57:27 -05:00
ln -s ${C4MLogo} C4MLogo.gds
ln -s ${lip6} lip6.gds
ln -s ${sorbonne_logo} sorbonne_logo.gds
ln -s ${libresoc_logo} libresoc_logo.gds
2021-09-05 11:06:44 -05:00
./mksym.sh
./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
}