"nix-litex": {
"flake": false,
"locked": {
- "lastModified": 1631733568,
- "narHash": "sha256-2w63+QxzZS1jX9GXDhXFEIL1C9JcdJUlZ12Sg4GGiZ0=",
- "owner": "L-as",
- "repo": "tock-litex",
- "rev": "46910f86e5610795efe9a9aa71a25592df429c6b",
+ "lastModified": 1631995585,
+ "narHash": "sha256-DOkmQo/Y7Oorhj4ayNZpzL/HDNPiZnaqssAHwLEv3F4=",
+ "owner": "lschuermann",
+ "repo": "nix-litex",
+ "rev": "032c4f53bc70a32b217aaf634ee9a1bbce43f2bb",
"type": "github"
},
"original": {
- "owner": "L-as",
- "repo": "tock-litex",
+ "owner": "lschuermann",
+ "ref": "staging",
+ "repo": "nix-litex",
"type": "github"
}
},
inputs.nmigen.flake = false;
inputs.nmigen-soc.url = "git+https://git.libre-soc.org/git/nmigen-soc.git";
inputs.nmigen-soc.flake = false;
- inputs.nix-litex.url = "github:L-as/tock-litex";
+ inputs.nix-litex.url = "github:lschuermann/nix-litex?ref=staging";
inputs.nix-litex.flake = false;
outputs = { self, nixpkgs, c4m-jtag, nmigen, nmigen-soc, nix-litex }:
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
+ litex = pkgs: import "${nix-litex}/pkgs" { inherit pkgs; };
+
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; });
- litexPkgs = pkgs: import "${nix-litex}/pkgs" { inherit pkgs; };
+ lib = nixpkgs.lib;
in
{
overlay = final: prev: {
python3Packages = prev.python3Packages.override {
- overrides = pfinal: pprev: {
+ overrides = lib.composeExtensions (litex final).pythonOverlay (pfinal: pprev: {
libresoc-ieee754fpu = pfinal.callPackage ./nix/ieee754fpu.nix {};
libresoc-openpower-isa = pfinal.callPackage ./nix/openpower-isa.nix {};
c4m-jtag = pfinal.callPackage (import ./nix/c4m-jtag.nix { src = c4m-jtag; version = getv c4m-jtag; }) {};
nmigen = pprev.nmigen.overrideAttrs (_: {
src = nmigen;
});
- };
+ });
};
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-ls180 = final.callPackage (import ./nix/ls180.nix { version = getv self; }) {};
libresoc-pinmux = final.callPackage (import ./nix/pinmux.nix { version = getv self; }) {};
};
soc = nixpkgsFor.${system}.python3Packages.libresoc-soc;
pre-litex = nixpkgsFor.${system}.libresoc-pre-litex;
pinmux = nixpkgsFor.${system}.libresoc-pinmux;
- ilang = nixpkgsFor.${system}.libresoc-ilang;
+ ls180 = nixpkgsFor.${system}.libresoc-ls180;
openpower-isa = nixpkgsFor.${system}.python3Packages.libresoc-openpower-isa;
});
+++ /dev/null
-{ version, litexPkgs }:
-
-{ stdenv, python3Packages, yosys, libresoc-verilog }:
-
-stdenv.mkDerivation {
- pname = "libresoc.il";
- inherit version;
-
- src = ../src/soc/litex/florent;
-
- strictDeps = true;
-
- nativeBuildInputs = (with python3Packages; [
- python migen c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa
- ]) ++ (with litexPkgs; [ litex litedram liteeth liteiclink litescope litesdcard ]);
-
- postPatch = ''
- patchShebangs --build .
-
- export PYTHONPATH="${../src}:$PYTHONPATH"
- '';
-
- configurePhase = "true";
-
- buildPhase = ''
- runHook preBuild
- cp ${libresoc-verilog} libresoc/libresoc.v
- ./ls180soc.py --build --platform=ls180sram4k --num-srams=2 --srams4k
- runHook postBuild
- '';
-
- installPhase = ''
- runHook preInstall
- mkdir $out
- mv build/ls180sram4k/gateware/ls180sram4k.v $out/ls180.v
- mv build/ls180sram4k/gateware/mem.init $out
- mv build/ls180sram4k/gateware/mem_1.init $out
- mv libresoc/libresoc.v $out
- mv libresoc/SPBlock_512W64B8W.v $out
- runHook postInstall
- '';
-
- fixupPhase = "true";
-}
--- /dev/null
+{ version }:
+
+{ stdenv, python3Packages, yosys, libresoc-pre-litex, libresoc-pinmux }:
+
+stdenv.mkDerivation {
+ pname = "libresoc-ls1804k";
+ inherit version;
+
+ src = ../src/soc/litex/florent;
+
+ nativeBuildInputs = with python3Packages; [
+ python libresoc-soc litex-unchecked litedram-unchecked liteeth-unchecked liteiclink-unchecked litescope-unchecked litesdcard-unchecked
+ ];
+
+ postPatch = ''
+ patchShebangs --build .
+ '';
+
+ configurePhase = "true";
+
+ buildPhase = ''
+ runHook preBuild
+ export PINMUX="$(mktemp -d)"
+ ln -s ${libresoc-pinmux} "$PINMUX/ls180"
+ cp ${libresoc-pre-litex} libresoc/libresoc.v
+ ./ls180soc.py --build --platform=ls180sram4k --num-srams=2 --srams4k
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+ mkdir $out
+ mv build/ls180sram4k/gateware/ls180sram4k.v $out/ls180.v
+ mv build/ls180sram4k/gateware/mem.init $out
+ mv build/ls180sram4k/gateware/mem_1.init $out
+ mv libresoc/libresoc.v $out
+ mv libresoc/SPBlock_512W64B8W.v $out
+ runHook postInstall
+ '';
+
+ fixupPhase = "true";
+}
--enable-xics --enable-sram4x4kblock --disable-svp64 \
$out
''; in
-runCommand "libresoc-pre-litex.v" {
+runCommand "libresoc-ls1804k-pre-litex.v" {
inherit version;
nativeBuildInputs = (with python3Packages; [