bigfloat = pfinal.callPackage ./nix/bigfloat.nix {};
modgrammar = pfinal.callPackage ./nix/modgrammar.nix {};
libresoc-nmutil = pfinal.callPackage ./nix/nmutil.nix {};
+ libresoc-soc = pfinal.callPackage (import ./nix/soc.nix { version = getv self; }) {};
nmigen-soc = pprev.nmigen-soc.overrideAttrs (_: {
doCheck = false;
};
};
- libresoc-verilog = final.callPackage (import ./nix/verilog.nix { version = getv self; }) {};
+ libresoc-pre-litex = final.callPackage (import ./nix/pre-litex.nix { version = getv self; }) {};
libresoc-ilang = final.callPackage (import ./nix/ilang.nix { version = getv self; litexPkgs = litexPkgs final; }) {};
+ libresoc-pinmux = final.callPackage (import ./nix/pinmux.nix { version = getv self; }) {};
};
packages = forAllSystems (system: {
- verilog = nixpkgsFor.${system}.libresoc-verilog;
+ soc = nixpkgsFor.${system}.python3Packages.libresoc-soc;
+ pre-litex = nixpkgsFor.${system}.libresoc-pre-litex;
+ pinmux = nixpkgsFor.${system}.libresoc-pinmux;
ilang = nixpkgsFor.${system}.libresoc-ilang;
openpower-isa = nixpkgsFor.${system}.python3Packages.libresoc-openpower-isa;
});
- defaultPackage = forAllSystems (system: self.packages.${system}.verilog);
+ defaultPackage = forAllSystems (system: self.packages.${system}.pre-litex);
};
}
--- /dev/null
+{ version }:
+
+{ stdenv, python2 }:
+
+stdenv.mkDerivation {
+ pname = "libresoc-pinmux";
+ inherit version;
+
+ src = ../pinmux;
+
+ nativeBuildInputs = [ python2 ];
+
+ configurePhase = "true";
+
+ buildPhase = ''
+ runHook preBuild
+ python src/pinmux_generator.py -v -s ls180 -o ls180
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+ mv ls180 $out
+ runHook postInstall
+ '';
+
+ fixupPhase = "true";
+}
--- /dev/null
+{ version }:
+
+{ 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-pre-litex.v" {
+ inherit version;
+
+ nativeBuildInputs = (with python3Packages; [
+ libresoc-soc
+ ]) ++ [ libresoc-pinmux ];
+} script
src = runCommand "libresoc-soc-source" {} ''
mkdir $out
cp -r ${../src} -T $out/src
- cp -r ${../pinmux} -T $out/pinmux
cp -r ${../setup.py} -T $out/setup.py
+ cp -r ${../README.md} -T $out/README.md
+ cp -r ${../NEWS.txt} -T $out/NEWS.txt
'';
in
buildPythonPackage {
doCheck = false;
+ prePatch = ''
+ rm -r src/soc/litex
+ '';
+
pythonImportsCheck = [ "soc" ];
meta = with lib; {
+++ /dev/null
-{ version }:
-
-{ stdenv, python3Packages, runCommand, python2, yosys }:
-
-let
- # If we use ../. as source, then any change to
- # any unrelated Nix file would cause a rebuild,
- # since the build would have access to it.
- src = runCommand "libresoc-verilog-source" {} ''
- mkdir $out
- cp -r ${../src} -T $out/src
- cp -r ${../mkpinmux.sh} -T $out/mkpinmux.sh
- cp -r ${../pinmux} -T $out/pinmux
- cp -r ${../Makefile} -T $out/Makefile
- '';
-in
-stdenv.mkDerivation {
- pname = "libresoc.v";
- inherit version src;
-
- strictDeps = true;
-
- nativeBuildInputs = (with python3Packages; [
- c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa
- ]) ++ [ yosys ];
-
- configurePhase = "true";
-
- buildPhase = ''
- runHook preBuild
- env -C pinmux ${python2}/bin/python src/pinmux_generator.py -v -s ls180 -o ls180
- cp pinmux/ls180/ls180_pins.py src/soc/debug
- cp pinmux/ls180/ls180_pins.py src/soc/litex/florent/libresoc
- 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";
-}
pth = os.path.split(pth)[0]
# path is relative to this filename, in the pinmux submodule
- fname = "%s/../../../pinmux/%s/litex_pinpads.json" % (pth, chipname)
+ pinmux = os.getenv("PINMUX", "%s/../../../pinmux" % pth)
+ fname = "%s/%s/litex_pinpads.json" % (pinmux, chipname)
with open(fname) as f:
txt = f.read()