{ version }:
-{ stdenv, python3Packages }:
-
-stdenv.mkDerivation {
- pname = "libresoc.v";
+{ runCommand, python3Packages, libresoc-pinmux }:
+
+let script = ''
+ mkdir pinmux
+ ln -s ${libresoc-pinmux} pinmux/ls180
+ export PINMUX="$(realpath ./pinmux)"
+ python3 -m soc.simple.issuer_verilog \
+ --debug=jtag --enable-core --enable-pll \
+ --enable-xics --enable-sram4x4kblock --disable-svp64 \
+ $out
+''; in
+runCommand "libresoc.v" {
inherit version;
- src = ../.;
-
- strictDeps = true;
-
- nativeBuildInputs = with python3Packages; [
- c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa
- ];
-
- configurePhase = "true";
-
- buildPhase = ''
- runHook preBuild
- cd src
- export PYTHONPATH="$PWD:$PYTHONPATH"
- python3 soc/simple/issuer_verilog.py \
- --debug=jtag --enable-core --enable-pll \
- --enable-xics --enable-sram4x4kblock --disable-svp64 \
- libresoc.v
- runHook postBuild
- '';
-
- installPhase = ''
- runHook preInstall
- mv libresoc.v $out
- runHook postInstall
- '';
-
- fixupPhase = "true";
-}
+ nativeBuildInputs = (with python3Packages; [
+ libresoc-soc
+ ]) ++ [ libresoc-pinmux ];
+} script