diff --git a/flake.nix b/flake.nix index 8cb8a25..48062e7 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,6 @@ ]; # patches, version pins, new pkgs here. } )); - in { devShells = forAllSystems (pkgs: { default = pkgs.mkShell { @@ -36,6 +35,12 @@ cocotb cocotb-bus litex + litedram + liteeth + litescope + pythondata-cpu-vexriscv + pythondata-software-compiler_rt + pythondata-software-picolibc amaranth ])) yosys @@ -50,7 +55,6 @@ ecpdap # easier to poke probes. ]; }; - }); }; } diff --git a/litex/default.nix b/litex/default.nix index 34ae2fd..a754421 100644 --- a/litex/default.nix +++ b/litex/default.nix @@ -5,6 +5,12 @@ in final: prev: { pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ (python-final: python-prev: { litex = python-final.callPackage(import ./litex.nix tag) { }; + litedram = python-final.callPackage(import ./litedram.nix tag) { }; + liteeth = python-final.callPackage(import ./liteeth.nix tag) { }; + litescope = python-final.callPackage(import ./litescope.nix tag) { }; + pythondata-cpu-vexriscv = python-final.callPackage(import ./pythondata-cpu-vexriscv.nix tag) { }; + pythondata-software-compiler_rt = python-final.callPackage(import ./pythondata-software-compiler_rt.nix tag) { }; + pythondata-software-picolibc = python-final.callPackage(import ./pythondata-software-picolibc.nix tag) { }; }) ]; } diff --git a/litex/litedram.nix b/litex/litedram.nix new file mode 100644 index 0000000..7eb6c18 --- /dev/null +++ b/litex/litedram.nix @@ -0,0 +1,27 @@ +tag: { + pkgs +, lib +, buildPythonPackage +, migen +, pyyaml +}: buildPythonPackage { + pname = "litedram"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "enjoy-digital"; + repo = "litedram"; + rev = "${tag}"; + hash = "sha256-EaUszy0v6r5sKM5d5YmpRbR8Cf9xITObU71zUpg9cLU="; + }; + + buildInputs = [ + pyyaml + migen + ]; + + checkPhase = '' + python -m unittest test + ''; + doCheck = true; +} diff --git a/litex/liteeth.nix b/litex/liteeth.nix new file mode 100644 index 0000000..dfb1f43 --- /dev/null +++ b/litex/liteeth.nix @@ -0,0 +1,36 @@ +tag: { + pkgs +, lib +, buildPythonPackage +, migen +, setuptools +, litex +, pyyaml +}: buildPythonPackage { + pname = "liteeth"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "enjoy-digital"; + repo = "liteeth"; + rev = "${tag}"; + hash = "sha256-DUNwDzcFLVmL5F/ZWmok7T7jO7ixC9IuDr1WUarnAqk="; + }; + + buildInputs = [ + litex + ]; + + propagatedBuildInputs = [ + migen + ]; + + nativeCheckInputs = [ + pyyaml + ]; + + checkPhase = '' + python -m unittest test + ''; + doCheck = true; +} diff --git a/litex/litescope.nix b/litex/litescope.nix new file mode 100644 index 0000000..a731763 --- /dev/null +++ b/litex/litescope.nix @@ -0,0 +1,27 @@ +tag: { + pkgs +, lib +, buildPythonPackage +, migen +, setuptools +, litex +}: buildPythonPackage { + pname = "litescope"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "enjoy-digital"; + repo = "litescope"; + rev = "${tag}"; + hash = "sha256-OWC+XwB+BzlCQkPKJCbQ0W4T6JbsInldrn9jYYjWypM="; + }; + + buildInputs = [ + litex + ]; + + checkPhase = '' + python -m unittest test + ''; + doCheck = true; +} diff --git a/litex/litex.nix b/litex/litex.nix index 5619107..15255a5 100644 --- a/litex/litex.nix +++ b/litex/litex.nix @@ -5,13 +5,11 @@ tag: { , pyserial , migen , requests -, colorama , packaging -, setuptools +, pexpect }: buildPythonPackage { pname = "litex"; version = "${tag}"; - pyproject = true; src = pkgs.fetchFromGitHub { owner = "enjoy-digital"; @@ -21,14 +19,12 @@ tag: { }; buildInputs = [ - setuptools + migen ]; propagatedBuildInputs = [ - migen requests pyserial - colorama packaging ]; diff --git a/litex/pythondata-cpu-vexriscv.nix b/litex/pythondata-cpu-vexriscv.nix new file mode 100644 index 0000000..4f93207 --- /dev/null +++ b/litex/pythondata-cpu-vexriscv.nix @@ -0,0 +1,16 @@ +tag: { + pkgs +, buildPythonPackage +}: buildPythonPackage rec { + pname = "pythondata-cpu-vexriscv"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "litex-hub"; + repo = "pythondata-cpu-vexriscv"; + rev = "${tag}"; + hash = "sha256-1RgwJCYxtiP5dfRHulfTNBgu6fum6RfoqkbFIlRTgKI="; + }; + + doCheck = false; +} diff --git a/litex/pythondata-software-compiler_rt.nix b/litex/pythondata-software-compiler_rt.nix new file mode 100644 index 0000000..9629e9e --- /dev/null +++ b/litex/pythondata-software-compiler_rt.nix @@ -0,0 +1,16 @@ +tag: { + pkgs +, buildPythonPackage +}: buildPythonPackage rec { + pname = "pythondata-software-compiler_rt"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "litex-hub"; + repo = "pythondata-software-compiler_rt"; + rev = "${tag}"; + hash = "sha256-s/tfxhPwYAnu1z1LxEimeYWjX6IHbF2uD/1HjvQn/xo="; + }; + + doCheck = false; +} diff --git a/litex/pythondata-software-picolibc.nix b/litex/pythondata-software-picolibc.nix new file mode 100644 index 0000000..770b110 --- /dev/null +++ b/litex/pythondata-software-picolibc.nix @@ -0,0 +1,16 @@ +tag: { + pkgs +, buildPythonPackage +}: buildPythonPackage rec { + pname = "pythondata-software-picolibc"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "litex-hub"; + repo = "pythondata-software-picolibc"; + rev = "${tag}"; + hash = "sha256-5OY17BA37c6aHOvUwb0gJwXxGey4TdUiTTxJD5wuSGU="; + }; + + doCheck = false; +}