From 44dd9f79c77ed0d87553f6ce7a1ab4447d8ab1e8 Mon Sep 17 00:00:00 2001 From: saji Date: Fri, 19 Apr 2024 15:06:31 -0500 Subject: [PATCH] added litespi Signed-off-by: saji --- flake.nix | 1 + litex/default.nix | 1 + litex/litespi.nix | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 litex/litespi.nix diff --git a/flake.nix b/flake.nix index 48062e7..750d518 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,7 @@ litedram liteeth litescope + litespi pythondata-cpu-vexriscv pythondata-software-compiler_rt pythondata-software-picolibc diff --git a/litex/default.nix b/litex/default.nix index a754421..62b82e1 100644 --- a/litex/default.nix +++ b/litex/default.nix @@ -8,6 +8,7 @@ in final: prev: { litedram = python-final.callPackage(import ./litedram.nix tag) { }; liteeth = python-final.callPackage(import ./liteeth.nix tag) { }; litescope = python-final.callPackage(import ./litescope.nix tag) { }; + litespi = python-final.callPackage(import ./litespi.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/litespi.nix b/litex/litespi.nix new file mode 100644 index 0000000..9437817 --- /dev/null +++ b/litex/litespi.nix @@ -0,0 +1,34 @@ +tag: { + pkgs +, lib +, buildPythonPackage +, migen +, setuptools +, litex +}: buildPythonPackage { + pname = "litespi"; + version = "${tag}"; + + src = pkgs.fetchFromGitHub { + owner = "litex-hub"; + repo = "litespi"; + rev = "${tag}"; + hash = "sha256-XYeWokF1IGtZWRK+6jhRSN91MOV5vyh5aO08sbtFBxw="; + }; + + buildInputs = [ + litex + ]; + + propagatedBuildInputs = [ + migen + ]; + + nativeCheckInputs = [ + ]; + + checkPhase = '' + python -m unittest test + ''; + doCheck = true; +}