Allow the formal engine to perform a same-cycle result in the ALU
[soc.git] / nix / verilog.nix
index cb6df044788efbae3c918bc48dc74eb1bd18b648..600b6939d7a82cfcdb65a34213633bc93d6ea42a 100644 (file)
@@ -1,35 +1,20 @@
 { 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; [ 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